rtabmap icon indicating copy to clipboard operation
rtabmap copied to clipboard

how to change 2d map when i navigate from 1f to 2f

Open qetuo105487900 opened this issue 1 year ago • 5 comments

excuse me. i have a problem about changing 2d map from 1f to 2f.

i have a amr. it will use joystick to make amr start at 1f a point then take a elevater to 2f b point.

Do I just need to shut down the node and then restart it ? or rtabmap have some service can clear current map and load new map ?

qetuo105487900 avatar Mar 11 '24 08:03 qetuo105487900

You may create 2 databases, one for each floor. You can either kill the node and reload with other database, or call service rtabmap/load_database.

If you want to keep both floors in same database, after mapping the first floor you call service rtabmap/pause in the elevator, rotate the robot so it doesn't see the same last image of the first floor session, then call rtabmap/trigger_new_map and rtabmap/resume to continue mapping. Map the second floor. After the run, you will have a single database with 2 disjoints maps inside. On localization mode, the robot would switch between the maps implicitly after exiting the elevator. The occupancy grid map should be updated based on the map the robot is now in.

matlabbe avatar Mar 13 '24 03:03 matlabbe

hello , @matlabbe . if i perfer use call service rtabmap/load_database . does rtabmap localizate automatic when i use joystick move robot to 2f ?

are this steps right ? run sensor -> automatic localization at 1f a points -> navigation move to elevator -> call service rtabmap/load_database when take elevator -> automatic localization at 2f (out of elevator) -> navigation move to 2f b point .

qetuo105487900 avatar Mar 13 '24 07:03 qetuo105487900

In your example, I assume that you already created two databases, one for each floor. If you know on which floor the robot should be, you can indeed call rtabmap/load_database with the corresponding database when it is in the elevator.

matlabbe avatar Mar 16 '24 22:03 matlabbe

@matlabbe , so, use service call can change the initial pose and database_path at the same time?

qetuo105487900 avatar Apr 23 '24 18:04 qetuo105487900

If you call rtabmap/load_database, it would change the path of the database used by rtabmap node. For the pose, the robot may jump to latest location saved in that database. You may override the pose by sending a new pose on /rtabmap/initialpose topic.

matlabbe avatar Apr 28 '24 23:04 matlabbe

ok . i see . thank you so much !

qetuo105487900 avatar May 07 '24 13:05 qetuo105487900