2018-05-06-mapping-athome
Note: When using Jenny, mapping is run on cob1
Bringup the robot
Run roscore:
roscoreRun rviz:
rosrun rviz rvizSet the global frame to
base_link.
In simulation
Launch the robot:
roslaunch mdr_bringup_sim robot.launch
Using the real robot
Make sure you have initialized Jenny (see here for more details).
Export Jenny's ssh alias:
export_cob1To shh the Jenny (PC1) run the following in all terminals:
cob1Launch the robot:
roslaunch mdr_bringup robot.launch
Launch SLAM
Building the map
Launch the SLAM node:
roslaunch mdr_2dslam 2dslam.launchNote: the map is built using the front laser's only.
Set the global frame in Rviz to map
Move the robot around either by using the joystick or by teleoperation.
To save the map
Maps are stored in ~/catkin_ws/src/mas_common_robotics/mcr_environments/mcr_default_env_config. An environment, such as brsu-C025 or brsu-C069, is a folder in this directory. Within this folder, the maps, goals and parameters are stored.
To go to the folder where we will save the map you can run:
roscd mcr_default_env_configBy using
lsyou can see several folders corresponding to existing environments.Before running the
map_saver, you need to be located in the environment folder. You can either overwrite an existing map by usingcdor you can create a new one:mkdir [map_name] && cd [map_name]For example:
mkdir new_map && cd new_mapFinally, to save the map, just run:
rosrun map_server map_saverThis will create two files: a
map.pgmandmap.yml.
Finally, to use the map that you just created you need to check which map will be loaded by the navigation stack:
echo $ROBOT_ENVIf you need to change it:
export ROBOT_ENV=[map_name]Note: Usually the .rosc script is used to set the environment, among other variables.
Last updated
Was this helpful?