Author: Jordi Pages < firstname.lastname@example.org >
Maintainer: Sara Cooper < email@example.com >
|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.|
Head controlDescription: Example on how to move ARI's head using an action that makes the robot look to a given direction.
Keywords: joint, trajectory controller, rqt_joint_trajectory_controller
Tutorial Level: BEGINNER
Next Tutorial: Play back pre-defined upper body motions
This tutorial shows how to use the head action to move the head of ARU. The action can be used to make the robot head to look at any point expressed in any frame.
First make sure that the tutorials are properly installed along with the ARI simulation, as shown in the Tutorials Installation Section.
Open two consoles and source the public simulation workspace as follows:
$ cd ~/ari_public_ws $ source ./devel/setup.bash
Launching the simulation
In the first console launch for example the following simulation
roslaunch ari_gazebo ari_gazebo.launch public_sim:=true world:=pick_place_cabinet
Gazebo will show up with ARI in front of a cabinet with objects on its shelves.
Running the example of C++ action client
An example of C++ node using a head action client is given in ari_tutorials/ari_look_to_point/src/ari_look_to_point.cpp.
In order to run the node write the following instruction in the second console
rosrun ari_look_to_point ari_look_to_point
the node will subscribe to the following topics:
* /head_front_camera/camera_info * /head_front_camera/image_raw
The first topic contains the instrinsic parameters of the camera and the second one the rgb image from the RGBD camera of ARI's head.
The rgb image will be shown in a window that will show up.
By clicking on any pixel of the image the robot will move its head in order to look at that point. With this we can easily lower or raise the head, look right or leftwards, etc.