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

Can turtlebot_simulator be loaded with a PGM map?

asked 2014-11-17 12:56:15 -0500

BlitherPants gravatar image


I have a Turtlebot 2 on ROS Hydro, and I am working on an algorithm for smart autonomous navigation through a known map. I have a map of the building I wanted to test in PGM form, obtained from running Gmapping. In real life, I would take this map, boot up my 'bot, load AMCL for localization within my PGM map, and then start my navigation algorithm.

I'd like to also be able to do this in the simulation world, i.e., start the simulator, load my map into Gazebo, start AMCL with the same map, and start my algorithm and watch the simulated robot drive around.

Currently I cannot find any way to load the PGM into Gazebo or convert it into a .world file. Is this something that's already available or would I need to write a custom program to create a world file where each black pixel is an obstacle?

Thanks in advance!

edit retag flag offensive close merge delete


Yeah I was curious about this. It would be really nice feature to test sensors and robot logics in simulation.

jihoonl gravatar image jihoonl  ( 2014-11-19 00:01:03 -0500 )edit

So you don't think this option is yet available?

BlitherPants gravatar image BlitherPants  ( 2014-11-19 08:58:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-19 09:15:41 -0500

David Lu gravatar image

I would recommend checking out stage_ros which can read in PGMs.

It's also possible Stage's more modern cousin STDR can, but I haven't investigated the package at all.

edit flag offensive delete link more


Is turtlebot_stage only available on Indigo? I have a Hydro installation and can't seem to find it...

BlitherPants gravatar image BlitherPants  ( 2014-11-19 09:41:38 -0500 )edit

Should be on hydro.

David Lu gravatar image David Lu  ( 2014-11-19 09:51:20 -0500 )edit

I can roscd to stage_ros but not turtlebot_stage, and I can't find the appropriate package using apt-get

BlitherPants gravatar image BlitherPants  ( 2014-11-19 10:23:23 -0500 )edit

There are no released package in hydro. But you should be able to checkout turtlebot_simulator hydro-devel branch which includes turtlebot_stage.

jihoonl gravatar image jihoonl  ( 2014-11-19 23:15:56 -0500 )edit

Thanks @jihoonl! I'll check that out.

BlitherPants gravatar image BlitherPants  ( 2014-11-21 08:51:44 -0500 )edit

Question Tools

1 follower


Asked: 2014-11-17 12:56:15 -0500

Seen: 1,300 times

Last updated: Nov 19 '14