Sending poses to PR2 in gazebo using action designators

This step-by-step explanation shows how to get the PR2 gazebo simulation up and running and how to execute simple translation/rotation commands using high level components (i.e. action designators).

  1. From the shell, start roscore:
    roscore
  2. Start pr2_gazebo:
    roslaunch pr2_gazebo pr2_empty_world.launch
  3. Start additional components for (fake) localization:
    roslaunch pr2_nav_pcontroller nav_pcontroller.launch
    1. IMPORTANT: Set the parameter (under <rosparam>) for “global_frame” as follows in the launch file:
      global_frame: odom_combined

      For this, it might be better to just copy the launch file and change this in your local version.

    2. Remark: On the “real” robot, this would be:
      roslaunch ias_pr2_2dnav pr2_2dnav.launch

      which should launch all the necessary parts.

  4. Start emacs and run the SLIME REPL for ROS:
    M-x slime-ros
  5. From within emacs, load the PR2 navigation process module:
    ,ros-load-system pr2-navigation-process-module
  6. Switch to the nav process module package:
    ,!p
    pr2-navigation-process-module
  7. Run the ROS node:
    (startup-ros)
  8. “Fake” the localization (since no mapping server is present):
    (setf designators-ros:*fixed-frame* "odom_combined")
  9. Initialize the nav process module: <code>(init-pr2-navigation-process-module)</code> Nope, this is done automatically during the loading of this system.
  10. Send a navigation action to position (x, y) with rotation (qz):
    (call-nav-action *navp-client*
                          (make-designator
                            'desig-props:location
                            `((desig-props:pose ,(tf:make-pose-stamped
                                                    "/base_footprint"
                                                    0.0
                                                    (tf:make-3d-vector x y 0)
                                                    (tf:make-quaternion 0 0 qz 1))))))
  11. Watch it move in gazebo ;)!