CERTH setup supports three Xtion sensors two in the arms (xtion1 and xtion2 for r1 and r2 respectively) and one on the column (xtion3).
Loading the drivers¶
Currently only xtion2 and xtion3 are used. We use openni2 driver to access the cameras. To access one or both of the cameras you should first load the appropriate drivers:
roslaunch camera_helpers xtion2.launch roslaunch camera_helpers xtion3.launch
To correctly load the driver the USB ports for each camera should be configured. This should be normally performed once or at least each time you reboot the PCs where the cameras are
installed. We have created a script to do this automatically:
rosrun certh_launch update_devs.sh
The script will create a "devices.launch" file that will contain the correct USB address for each device. This is included by "xtion?.launch" files.
The script relies on a "devices.cfg" file located "certh_launch/config" folder. This provides an association between specific device id parameter, device/vendor id and machine hostname where the
device is attached:
/xtion1/driver/device_id 1d27:0601 /xtion2/driver/device_id 1d27:0600 clopema@clopema2 /xtion3/driver/device_id 1d27:0600
The first column is the ROS parameter that will be set. The second column is the device/vendor ID of the device and the third column is the username/hostname of the machine the device is attached.
Evidently one cannot differentiate devices with the same device id on the same machine.
The packages using the drivers assume registration of color and depth images. By default hardware registration is enabled but software registration is also possible if the the RGB, IR sensors have been properly calibrated. The image acquisition code
will subscribe to the following topics:
For OpenNI2 driver.
/<camera_id>/rgb/image_rect_color /<camera_id>/depth_registered/hw_registered/image_rect_raw or /<camera_id>/depth_registered/sw_registered/image_rect_raw /<camera_id>/depth_registered/camera_info
For OpenNI driver.
/<camera_id>/rgb/image_rect_color /<camera_id>/depth_registered/image_rect_raw /<camera_id>/depth_registered/camera_info
We use services to grab images e.g.
roslaunch camera_helpers xtion3service.launch
The launch file reads the parameter /<camera_id>/driver_version. Set this to 1 to use the OpenNI driver topics or 2 to use OpenNI 2 driver topics.
You may test this by:
rosservice call /xtion3/openni_service/connect true rosservice call /xtion3/openni_service/grab rosservice call /xtion3/openni_service/connect false
The above launch files will use the calibration information provided in the calibration folder.
The optical frame of the rgb camera with respect to the appropriate parrent frame will be also published in "<camera_id>_rgb_optical_frame" based on hand-eye calibration.
See CERTH Calibration Stack for details about CERTH calibration software.
If the OpenNI driver fails to start (it happens in one of our machines) you need to compile an older version of the driver.
cd ~/hydro_ws/src/ git clone https://github.com/ros-drivers/openni_camera.git cd openni_camera git checkout rollback_usb_hydro cd ~/hydro_ws/ catkin_make