[Documentation] [TitleIndex] [WordIndex

!

(!) 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 head

Description: Moving the head using the Pan-Tilt system

Tutorial Level: BEGINNER

Next Tutorial: Moving the torso

Controlling the Pan and Tilt Joints

The Pan-Tilt system can be controlled using its position_controllers/JointTrajectoryController. You can send trajectory_msgs::JointTrajectory to the pan_tilt_trajectory_controller/command topic.

For this demonstration we will launch the Armadillo robot in Gazebo:

$ roslaunch armadillo2 armadillo2.launch gazebo:=true

Now, Lets move the pan and tilt by typing:

$ rosservice call /services/pan_tilt_mover "pan: 0.2            
tilt: 0.1"

This will move the head to the position of 0.2 radians to the left and 0.1 radians down.

You can also specify desired joints goals by publishing the desired angles to the pan_tilt_trajectory_controller/command topic.

Play with the angles and watch the pan-tilt system move in the Gazebo window.

Note: 1. Positive values will make the system turn left and down. 2. The limits of the head's angles are π/6 up, 50π/180 down and π/4 to each side.

==


2019-10-19 12:31