For the most part, the simulator should present you the same ROS interface as the physical robot; for example, the instructions here for getting the state and sending commands are the same for a physical robot.
Key differences between simulation and reality
The main differences to be aware of between the simulated and real world are:
- You don't have to roslaunch the real world.
When running in the simulator, the /use_sim_time ROS parameter must be set to true. When running in the real world, it must be false.
On the robot, the pr2_etherCAT node encapsulates the PR2 mechanism control stack, and there are several sensor nodes connected, e.g., to the cameras. In Gazebo, mechanism controller node is encapsulated by gazebo_controller_manager plugin, and various components are also implemented as plugins that run within the simulator. To see how to make this change, compare pr2.launch in the pr2_gazebo package with pr2.launch in the pr2_bringup package.
There isn't a perfect match between the physics of the simulator and real world, so there may be specific parameters of nodes that vary between the two. There are also several things that are just not simulated (e.g. the motors, sounds). Nodes corresponding to these can be found in files such as pr2.launch in pr2_bringup.
The specific launch files we use at Willow make use of a ROBOT environment variable to determine which computers to run nodes on. When using the simulator, set this to "sim". Simulator defaults everything to localhost.