
As @Dornhege mentioned, you can use the PR2 in simulation, but being a complex robot, simulation might be rather slow and it can be hard to get a good overview. You might also want to have a look at the simulated turtlebot provided via the turtlebot_gazebo package, which provides a good example of a simpler robot, which still demonstrates a lot of concepts.
You can directly launch the simulated turtlebot with the command
roslaunch turtlebot_gazebo turtlebot_empty_world.launch
once you have the package (and all dependencies) installed.
Another good starting point could be the erratic_robot stack, but I believe turtlebot is better documented and more widely used now.
You might also want to have a look at these related questions: 1, 2.
Originally posted by Stefan Kohlbrecher with karma: 24361 on 2012-02-19
This answer was ACCEPTED on the original site
Post score: 3
Original comments
Comment by cassander on 2012-02-19:
How is it possible to simulate a complex robot like the PR2, which has many different sensors and actuators? Is each and every sensor and actuator simulated independently? I know it is slow and the simulation might not be accurate but it is the next best thing compared to actually owning the robot.
Comment by Stefan Kohlbrecher on 2012-02-19:
Try running "roslaunch pr2_gazebo pr2_wg_world.launch", this launches the PR2 in the Willow Garage world. Sensors and actuators are simulated independently and the robot model is defined using the URDF format (you can look that up on the ROS wiki).
Comment by cassander on 2012-02-20:
When you say the sensors and actuators are simulated independently, you mean to say that I can write code to send data or receive data from and to the virtual sensors and actuators? Ofcourse, in this case, I suppose the sensors will produce data about the virtual world.I will try the command. Thanks
Comment by Stefan Kohlbrecher on 2012-02-20:
Yes, ideally the simulated components have the same ROS API in simulation or real hardware and it's transparent to the user what is actually used. I recommend a look at the URDF tutorials: http://www.ros.org/wiki/urdf/Tutorials, especially the "gazebo extensions" section.