Skip to content

STEP12 MapManagerのリファクタリング #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions uROS_STEP12_micromouse/map_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,39 +30,35 @@ typedef struct

class MapManager
{
private:
unsigned short steps_map[MAZESIZE_X][MAZESIZE_Y]; //歩数マップ
t_wall wall[MAZESIZE_X][MAZESIZE_Y]; //壁の情報を格納する構造体配列
t_position mypos;
short goal_mx, goal_my;

public:
void view(char view_weight_f);
MapManager();

void positionInit(void);
void setMyPos(char x, char y, t_direction_glob dir);
void setMyPosDir(t_direction_glob dir);
short getMyPosX(void);
short getMyPosY(void);
t_direction_glob getMyPosDir(void);
char getWallData(unsigned char x, unsigned char y, t_direction_glob dir);
void setWallData(unsigned char x, unsigned char y, t_direction_glob dir, char data);
unsigned short getStepMapData(unsigned char x, unsigned char y);
char getGoalX(void);
char getGoalY(void);
void setGoalX(short data);
void setGoalY(short data);

void makeMap2(int x, int y);
void makeSearchMap(int x, int y);
t_direction getNextDir2(short x, short y, t_direction_glob * dir);
t_direction getNextDir(char x, char y, t_direction_glob * dir);
void axisUpdate(void);
void nextDir(t_direction dir);
void wallch(int x, int y, int x2, int y2);
void setWall(bool IS_SEN_FR, bool IS_SEN_R, bool IS_SEN_L);
int getPriority(unsigned char x, unsigned char y, t_direction_glob dir);
t_direction getNextDir(char x, char y, t_direction_glob * dir);
t_direction getNextDir2(short x, short y, t_direction_glob * dir);

MapManager();
private:
unsigned short steps_map[MAZESIZE_X][MAZESIZE_Y]; //歩数マップ
t_wall wall[MAZESIZE_X][MAZESIZE_Y]; //壁の情報を格納する構造体配列
t_position mypos;
short goal_mx, goal_my;

void makeSearchMap(int x, int y);
void makeMap2(int x, int y);
int getPriority(unsigned char x, unsigned char y, t_direction_glob dir);
};

#endif // MAP_MANAGER_H_
Loading