I don't really have an idea for a simple application right now, but here is how you can set up a simulation environment that is "almost" like a real robot.
Instead of stage, you should also have a look at Gazebo (especially if you want to experiment with camera images). If you want to keep it simple, I would recommend looking at the Turtlebot; it is very well-supported in Gazebo, so it's almost like working with a real robot, and less daunting than the PR2.
You can use the turtlebot_empty_world.launch
launch file from the turtlebot_gazebo package, or use the following modified launch file to give you a more interesting world:
<launch>
<param name="/use_sim_time" value="true" />
<node name="gazebo" pkg="gazebo" type="gazebo" args="-u $(find gazebo_worlds)/worlds/wg_collada.world" respawn="false" output="screen"/>
<include file="$(find turtlebot_gazebo)/launch/robot.launch"/>
</launch>
This gives you a fake laser scan(*) on the /scan
topic ("fake" because it's computed from the Kinect data), camera data on the subtopics of /camera/
, and position information via the /odom
topic and via the tf transform from odom_combined
to base_link
.
(*) be aware of this bug, though.
Edit: Okay, so what about this simple application: Write a behavior that makes the robot randomly explore its environment while avoiding to run into obstacles. You would have to subscribe to the scan
topic for obstacle detection and publish messages to the cmd_vel
topic to make the robot move.
Originally posted by Martin Günther with karma: 11816 on 2011-10-04
This answer was ACCEPTED on the original site
Post score: 4
Original comments
Comment by Martin Günther on 2011-10-11:
Yes, the scenario I described is of course possible with stage, but I have no experience with that. If you have a specific question about setting up stage, it's probably best to ask a new question about that.
Comment by jlo on 2011-10-10:
What about doing this with stage? Is it possible? (even if I wouldn't be able to experiment with camera capabilities) The reason being that currently my workstation its not powerful enough (once I tried with the pr2 model and it stutters really really badly).
Comment by Pi Robot on 2011-10-06:
Yeah, I've used that trick in the past but in this case, no such directory gets created. Even "roslaunch gazebo_worlds empty_world.launch" generates the same error so I have submitted a ticket (https://code.ros.org/trac/ros-pkg/ticket/5195).
Comment by Martin Günther on 2011-10-06:
When Gazebo refuses to start, I usually do a rm -rf /tmp/gazebo-*
and try again. Does Gazebo work for you with other launch files? If this doesn't help, it's probably best to submit a ticket or ask a new question here, so that the Gazebo gurus become aware of it.
Comment by Pi Robot on 2011-10-06:
Hi Martin--I wanted to try your suggestion myself but when launching the above file I get the following error when running the latest Electric debian packages under Ubuntu 10.04: "loading model xml from ros parameter gazebo: /tmp/buildd/ros-electric-visualization-common-1.6.2/debian/ros-electric-visualization-common/opt/ros/electric/stacks/visualization_common/ogre/build/ogre_src_v1-7-3/RenderSystems/GL/src/OgreGLSupport.cpp:56: virtual void Ogre::GLSupport::initialiseExtensions(): Assertion `pcVer && "Problems getting GL version string using glGetString"' failed.
[gazebo-1] process has died [pid 30131, exit code -6]." Any thoughts for a fix or should I submit a ticket?