First time here? Check out the FAQ!


ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
3

Is it possible to use a pre-built map ?

asked Jan 8 '15

Bacab gravatar image

updated Jan 12 '15

Hi everyone,

I apologize in advance if my question is either inaccurate, stupid, or inappropriate.

Please consider me as a newbie in ROS related subject. I have quickly been through the navigation tutorial and if I correctly understand the logic behind the navigation stack it is possible for it to use an external map (static_map seems to be the correct name). Since my robot will evolve in a rather static environment I would like to provide it with a manually pre-built map of this environment. 1. Is it possible ?

  1. If it is indeed possible how can I do it ? (see below) Answered The specifications of the map file are here: http://wiki.ros.org/map_server

I thank you in advance for your answers and your advice.

EDIT 2: Link to the map we built with the corresponding yml file. https://github.com/Bacab/SARGAS/blob/... https://github.com/Bacab/SARGAS/blob/...

Preview: (hide)

3 Answers

Sort by » oldest newest most voted
2

answered Jan 12 '15

forinkzan gravatar image

I think i can't really understand what are you mean , Do you want : (1) load a 2D pre-built map to ROS map server and use this map to test robot navigation package? or (2) Simulate a 3D environment and let robot use this simulator environment to build a map then using to navigation stack .

if the situation (1) : follow @Andromeda 's answer , and i think the "arbotix" simulator and "rbx1" package which you can find in http://wiki.ros.org will help you . (2) : can't find any tutorial already exist , but you can try to use gazebo_world_edit & ros_plugin , some tutorial link: http://gazebosim.org/tutorials ,hope it will useful ~

Preview: (hide)

Comments

Thank you. Your first assumption is correct (ie:"(1) load a 2D pre-built map to ROS map server and use this map to test robot navigation package."). However it is not for tests, the final robot will use it for navigation.

Bacab gravatar image Bacab  ( Jan 12 '15 )edit

I think may be you should use a launch file to load your map (.yaml & .pgm) to your ros map_server package then use it in navigation stack . but I am not sure , hope it can help you ~

forinkzan gravatar image forinkzan  ( Jan 13 '15 )edit
1

answered Jan 10 '15

Andromeda gravatar image

updated Jan 10 '15

I'm not really sure, if I understood your question, but I share with you what I did, perhaps it helps. I've created a pgm file using Gimp

A1_map.pgm

with a good pixel definition. And then I created a yaml file with the resolution, width, height, etc...

A1_map.yaml:

image: A1_map.pgm
resolution: 0.01
origin: [-10, -10, 0]
occupied_thresh: 0.65
free_thresh: 0.196 # Taken from the Willow Garage map in the turtlebot_navigation package
negate: 0
width:  20
height: 20

where for height and width you put the desired dimension expressed in meters. So opening the map with RViz one side of the map corresponds to 20 cells of RViz (if 1 cell has a dimension of 1 meter)

Both files are copied into the main folder of my package under

maps/

Preview: (hide)

Comments

I've managed to do the same. I teleoperated my robot on a simulated Gazebo World to build a map of the environment using the GMapping package, and then saved it using the (map_saver tool) from the map_server package. The problem is to load that map to navigate on it

Sergio MP gravatar image Sergio MP  ( Jan 12 '15 )edit

@Sergio MP It's a surprise for me to find your comment , as you say you can using gazebo environment to build a map ? you already done that ? I also want to do it , but don't know how to do - - | could you help me ? thank you very much ~

forinkzan gravatar image forinkzan  ( Jan 13 '15 )edit

@forinkzan Sure. What I did was to create a .world file with the workspace where I want my robot to navigate. Then, make sure to include a Hokuyo 2D laserscan or Kinect in your robot's URDF with their respective Gazebo plugin included. Spawm your robot into the Gazebo world, configure and execute

Sergio MP gravatar image Sergio MP  ( Jan 13 '15 )edit

the gmapping node to build the map, and drive it around using your keyboard with the key_teleop.py node. Finally, if you want to save the map that gmapping just created, you can use the map_server. Cheers!

Sergio MP gravatar image Sergio MP  ( Jan 13 '15 )edit

thanks very much ~ how can i drive the robot ? with a diff_drive plugin & set odom frame ? I don't know why i can't add plugin to my robot urdf file , it's always fail = =... , are there some tutorials?

forinkzan gravatar image forinkzan  ( Jan 14 '15 )edit

Jum, I see. You should check the Husky description package for reference. Cheers!

Sergio MP gravatar image Sergio MP  ( Jan 14 '15 )edit

@Sergio MP Finally i can build map in gazebo ~ , thank you very much , now i prepare to navigation in it ~

forinkzan gravatar image forinkzan  ( Jan 21 '15 )edit

@Sergio MP Can you load map and navigation on it now ? in gazebo ?

forinkzan gravatar image forinkzan  ( Jan 28 '15 )edit
0

answered Jan 11 '15

Bacab gravatar image

updated Jan 12 '15

Thank you for your answer.

Yes I have finally found the specifications of the yaml file.

According to your experience the navigation stack can work with a map not generated by sensors, am I correct ?

EDIT: I'm trying to explain my question

I'm only considering a 2D map that will be used by the robot for guidance purpose. I don't care about visualization or simulation. The documentation states that a map like that is built by the map server thanks to the data of the LIDAR to provide global route planing. I want to know if I can built this map while the robot is offline using the blueprints of the batiment the robot will have to navigate into.

If the answer is yes I can use a map like that then the only sensors I need are odometric wheels so the robot knows where it is on the map.

Preview: (hide)

Comments

I'm not sure what you mean, but...yes...you can move for visualization's purposes your robot on a map with a overlapping grid. I mean....don't aspect to draw a 3D image with gimp and use it as a 3D map generated by the sensors. They are different things. Hope I understood you correctly.

Andromeda gravatar image Andromeda  ( Jan 11 '15 )edit

Question Tools

4 followers

Stats

Asked: Jan 8 '15

Seen: 7,238 times

Last updated: Jan 12 '15