RH_ptu

Maintainer: Gerardo Aragon-Camarasa

1. Overview

This package interfaces the Pan-Tilt Units (PTUs) hardware with ROS. The PTU control is based on proprietary code, therefore, source code of the control library is not included in this package.

2. Nodes

2.1 RH_ptu_node

Main node of this package and interface to the PTU hardware.

2.1.1 Subscribed Topics

Main topic that contains position and velocity information in order to move the PTU units.

2.1.2 Published Topics

Topic that contains the acquisition command and camera synchronization parameters.

Topic that publishes the current status of the PTU. This topic has the same time stamp as /RH/cmd/acquire.

2.1.3 Services

Gets the current state of the PTU units in radians.

Service that commands the PTU units to move to the desired position.

2.1.4 Parameters

  • /PTU/port (string)

Serial or USB port where the PTU control units are connected (e.g. "/dev/ttyUSB0").

  • /PTU/pan_left_home (double)
  • /PTU/tilt_left_home (double)
  • /PTU/pan_right_home (double)
  • /PTU/tilt_right_home (double)

User-defined home position of the PTUs. By default, these are set as zeros, indicating the factory home position of the PTUs.

  • /PTU/pan_left_res (double)
  • /PTU/tilt_left_res (double)
  • /PTU/pan_right_res (double)
  • /PTU/tilt_right_res (double)

Resolution of the pan and tilt units.

  • /CAM/capturemode (float)

This controls the capturing mode of the cameras. "0" indicates full resolution mode (16 MP) whereas "1", preview mode (VGA resolution). If it is not set, "RHcam_left" node sets it to the mode given in the message "/RH/cmd/acquire".

2.1.5 tf joints

  • left_to_pan
  • left_to_tilt
  • right_to_pan
  • right_to_tilt

Link names as defined in the XACRO script of the robot head located at the RH_ptu package. This are the revolute joints that, according to the XACRO script, need to be updated.

2.2 RH_ptu_sim

Node that simulates RH_ptu_node. The same functionality of RH_ptu_node is implemented. As this node does not have any physical connection to the PTU hardware, it relies on an input XML file that contains the PTU positions to be simulated. The input XML file should look as below:

<?xml version="1.0"?>
<opencv_storage>
<Settings>
    <PTU_angles type_id="opencv-matrix">
      <rows>5</rows>
      <cols>4</cols>
      <dt>f</dt>
      <data>
        -1.35526314e-01 -5.46817303e-01 7.53921270e-02 -5.20789027e-01
        -5.76660000e-02 -5.43900311e-01 1.53252438e-01 -5.17872095e-01
        -7.60652646e-02 -6.06053948e-01 1.34853169e-01 -5.80025733e-01
        -1.73222378e-01 -5.41880906e-01 3.76960635e-02 -5.15852630e-01
        -1.39116421e-01 -4.82644230e-01 7.18020201e-02 -4.56615984e-01</data></PTU_angles>
</Settings>
</opencv_storage>

The above contains five different positions streuctured as a 5 by 4 matrix. Columns 1 and 2 denote the pan and tilt of unit 1 whereas, 3 and 4, the pan and tilt of unit 2.

2.2.1 Subscribed Topics

Main topic that contains position and velocity information in order to move the PTU units.

2.2.2 Published Topics

Topic that contains the acquisition command and camera synchronization parameters.

Topic that publishes the current status of the PTU. This topic has the same time stamp as /RH/cmd/acquire.

2.2.3 Services

Gets the current state of the PTU units in radians.

Service that commands the PTU units to move to the desired position.

2.2.4 Parameters

  • /PTU/port (string)

Serial or USB port where the PTU control units are connected (e.g. "/dev/ttyUSB0").

  • /PTU/pan_left_home (double)
  • /PTU/tilt_left_home (double)
  • /PTU/pan_right_home (double)
  • /PTU/tilt_right_home (double)

User-defined home position of the PTUs. By default, these are set as zeros, indicating the factory home position of the PTUs.

  • /PTU/pan_left_res (double)
  • /PTU/tilt_left_res (double)
  • /PTU/pan_right_res (double)
  • /PTU/tilt_right_res (double)

Resolution of the pan and tilt units.

  • /CAM/capturemode (float)

This controls the capturing mode of the cameras. "0" indicates full resolution mode (16 MP) whereas "1", preview mode (VGA resolution). If it is not set, "RHcam_left" node sets it to the mode given in the message "/RH/cmd/acquire".

2.2.5 tf joints

  • left_to_pan
  • left_to_tilt
  • right_to_pan
  • right_to_tilt

Link names as defined in the XACRO script of the robot head located at the RH_ptu package. This are the revolute joints that, according to the XACRO script, need to be updated.

2.3 RH_ptu_test

This node tests the functionality of the PTUs. It samples each unit from -90 to 90 degrees in pan and -40 to 40 degrees in tilt every 2 seconds.

2.3.1 Subscribed Topics

Topic that publishes the current status of the PTU. This topic has the same time stamp as /RH/cmd/acquire.

2.3.2 Published Topics

Main topic that contains position and velocity information in order to move the PTU units.

2.3.3 Parameters

  • /PTU/pan_left_res (double)
  • /PTU/tilt_left_res (double)
  • /PTU/pan_right_res (double)
  • /PTU/tilt_right_res (double)

Resolution of the pan and tilt units.

2.3.4 tf joints

  • left_to_pan
  • left_to_tilt
  • right_to_pan
  • right_to_tilt

Link names as defined in the XACRO script of the robot head located at the RH_ptu package. This are the revolute joints that, according to the XACRO script, need to be updated.

3. URDF description

The CloPeMa robot head transformation tree is defined as one single XACRO script. The XACRO script "../RH_ptu/description/robot_head.xacro" is not integrated with the dual arm robot whereas "../RH_ptu/description/robot_head_clopema.xacro" is integrated. The file "../RH_ptu/description/main.xacro" provides an example on the integration using the CloPeMa description XACRO scripts. The image below shows the CloPeMa transformation tree.

4. Launch files

4.1 RH_ptu_test.launch

Loads RH_ptu_node and RH_ptu_test in order to test the PTUs.

4.2 RH_ptu_urdf.launch

This tests the URDF model of the CloPeMa robot head using ros joint_state_publisher and robot_state_publisher. This is visualise in rviz. This launch file also displays a window containing 4 sliders that enables the user to modify the position of the robot head.

4.3 RH_ptu_urdf_sim.launch

Essentially as RH_ptu_urdf.launch but instead of using joint_state_publisher to publish robot states, it is used RH_ptu_sim.

xacro_robothead.png (47.8 KB) Gerardo Aragon, 09/11/2013 15:02