|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
Moving the headDescription: Moving the head using the Pan-Tilt system
Tutorial Level: BEGINNER
Next Tutorial: Moving the torso
Controlling the Pan and Tilt Joints
For this demonstration we will launch the Armadillo robot in Gazebo:
$ roslaunch robotican_armadillo armadillo.launch gazebo:=true
Now, Lets run the pan-tilt API example node by typing:
$ rosrun robotican_demos pan_tilt_api
This will generate and send a random goal to the pan_tilt_trajectory_controller/command topic.
You can also specify desired joints goals by adding them as arguments to the node (first argument is pan angle and the second is tilt angle):
$ rosrun robotican_demos pan_tilt_api 0.4 -0.9
Play with the angles and watch the pan-tilt system move in the Gazebo window.
Note: Positive values will make the system turn left and down.
The code is available at pan_tilt_api.cpp.
Controlling the head using the PointHead controller
For details on the controller please see the PR2 Moving the Head Tutorial.
To run the demo after launching the robot run:
$ rosrun robotican_demos point_head