Skip to content

Commit e796260

Browse files
author
Shota Aoki
authored
makeSearchMapとmakeMap2の順番を変更 (#12)
1 parent e108fc5 commit e796260

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

uROS_STEP8_micromouse/map_manager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class MapManager
5555
t_position mypos;
5656
short goal_mx, goal_my;
5757

58-
void makeMap2(int x, int y);
5958
void makeSearchMap(int x, int y);
59+
void makeMap2(int x, int y);
6060
int getPriority(unsigned char x, unsigned char y, t_direction_glob dir);
6161
};
6262

uROS_STEP8_micromouse/map_manager.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ t_direction MapManager::getNextDir2(short x, short y, t_direction_glob * dir)
471471
return front;
472472
}
473473

474-
void MapManager::makeMap2(int x, int y)
474+
void MapManager::makeSearchMap(int x, int y)
475475
{
476476
bool change_flag;
477477

@@ -488,7 +488,7 @@ void MapManager::makeMap2(int x, int y)
488488
for (int j = 0; j < MAZESIZE_Y; j++) {
489489
if (steps_map[i][j] == 65535) continue;
490490
if (j < (MAZESIZE_Y - 1)) {
491-
if (wall[i][j].north == NOWALL) {
491+
if (wall[i][j].north != WALL) {
492492
if (steps_map[i][j + 1] == 65535) {
493493
steps_map[i][j + 1] = steps_map[i][j] + 1;
494494
change_flag = true;
@@ -497,7 +497,7 @@ void MapManager::makeMap2(int x, int y)
497497
}
498498

499499
if (i < (MAZESIZE_X - 1)) {
500-
if (wall[i][j].east == NOWALL) {
500+
if (wall[i][j].east != WALL) {
501501
if (steps_map[i + 1][j] == 65535) {
502502
steps_map[i + 1][j] = steps_map[i][j] + 1;
503503
change_flag = true;
@@ -506,7 +506,7 @@ void MapManager::makeMap2(int x, int y)
506506
}
507507

508508
if (j > 0) {
509-
if (wall[i][j].south == NOWALL) {
509+
if (wall[i][j].south != WALL) {
510510
if (steps_map[i][j - 1] == 65535) {
511511
steps_map[i][j - 1] = steps_map[i][j] + 1;
512512
change_flag = true;
@@ -515,7 +515,7 @@ void MapManager::makeMap2(int x, int y)
515515
}
516516

517517
if (i > 0) {
518-
if (wall[i][j].west == NOWALL) {
518+
if (wall[i][j].west != WALL) {
519519
if (steps_map[i - 1][j] == 65535) {
520520
steps_map[i - 1][j] = steps_map[i][j] + 1;
521521
change_flag = true;
@@ -527,7 +527,7 @@ void MapManager::makeMap2(int x, int y)
527527
} while (change_flag == true);
528528
}
529529

530-
void MapManager::makeSearchMap(int x, int y)
530+
void MapManager::makeMap2(int x, int y)
531531
{
532532
bool change_flag;
533533

@@ -544,7 +544,7 @@ void MapManager::makeSearchMap(int x, int y)
544544
for (int j = 0; j < MAZESIZE_Y; j++) {
545545
if (steps_map[i][j] == 65535) continue;
546546
if (j < (MAZESIZE_Y - 1)) {
547-
if (wall[i][j].north != WALL) {
547+
if (wall[i][j].north == NOWALL) {
548548
if (steps_map[i][j + 1] == 65535) {
549549
steps_map[i][j + 1] = steps_map[i][j] + 1;
550550
change_flag = true;
@@ -553,7 +553,7 @@ void MapManager::makeSearchMap(int x, int y)
553553
}
554554

555555
if (i < (MAZESIZE_X - 1)) {
556-
if (wall[i][j].east != WALL) {
556+
if (wall[i][j].east == NOWALL) {
557557
if (steps_map[i + 1][j] == 65535) {
558558
steps_map[i + 1][j] = steps_map[i][j] + 1;
559559
change_flag = true;
@@ -562,7 +562,7 @@ void MapManager::makeSearchMap(int x, int y)
562562
}
563563

564564
if (j > 0) {
565-
if (wall[i][j].south != WALL) {
565+
if (wall[i][j].south == NOWALL) {
566566
if (steps_map[i][j - 1] == 65535) {
567567
steps_map[i][j - 1] = steps_map[i][j] + 1;
568568
change_flag = true;
@@ -571,7 +571,7 @@ void MapManager::makeSearchMap(int x, int y)
571571
}
572572

573573
if (i > 0) {
574-
if (wall[i][j].west != WALL) {
574+
if (wall[i][j].west == NOWALL) {
575575
if (steps_map[i - 1][j] == 65535) {
576576
steps_map[i - 1][j] = steps_map[i][j] + 1;
577577
change_flag = true;

0 commit comments

Comments
 (0)