ROS simulations with Stage.

36 views
Skip to first unread message

Gav

unread,
Apr 25, 2013, 8:07:42 PM4/25/13
to sydne...@googlegroups.com
Hi All,

I've got some cool news. You might remember that I said turtlebot simulations weren't available in the current version of ROS. Well, it still isn't but there's another package called 'stage' that does excellent 2D simulations which is useful.

If I'd realised 'stage' worked I would definitely have used that in our workshop for the map making section. 

This is a great way to test out mapping and running the various ROS components (rviz, rostopic, etc) without needing a physical robot. 

Hope this helps,
Gavin 

Ok, here are some rough steps: 
(This assumes your ROS_MASTER_URI is set to the local machine)

1) Open a terminal and run 'roscore' to get the master running. 

2) Run stage and load a saved world. 
  • Open a new terminal and type 'roscd stage' then 'cd worlds'
  • rosrun stage stageros willow-erratic.world 
This will get a robot in a simulated world up and running, and provide a fake laser scan. It'll also listen on /cmd_vel and move the simulated robot accordingly. 


3) Bring up RVIZ and add the following things:
  • 'map' display on topic '/map'  (this won't show up till gmapping runs)
  • Laser scan on '/base_scan'
  • 'Teleop' widget to drive the robot, pointing at /cmd_vel. (This might not be in the install by default. If not you'll have to check out the turtlebot_teleop package, and keyboard. And remap the output topic to point correctly. I'll leave this as an exercise to the reader)

4) Run Gmapping to perform SLAM on the data. 

rosrun gmapping slam_gmapping scan:=base_scan
You should now be able to see a map forming in RVIZ as you drive it around. 

Inline images 1

Screen Shot 2013-04-26 at 10.06.24 AM.png

Gav

unread,
Apr 25, 2013, 8:20:52 PM4/25/13
to sydne...@googlegroups.com
Actually, this seems to be more nicely written version of what I just did:


Screen Shot 2013-04-26 at 10.06.24 AM.png

Adrian Apps

unread,
Apr 26, 2013, 3:19:49 AM4/26/13
to sydne...@googlegroups.com
Thanks Gav, will give this a go when I get home!
Reply all
Reply to author
Forward
0 new messages