-
Notifications
You must be signed in to change notification settings - Fork 6
PrimeSense Relay Setup
Setting up a relay for a PrimeSense camera (or any other RGBD camera) is complicated by the presence of both camera topics and pointcloud topics in the same namespace. It's easy to end up with an incorrect configuration, which makes this particular use case an important one to cover in detail.
However, RGBD cameras have a particularly nice property that dramatically simplifies the creation of launch files - really, the only thing you need to configure is the namespace of the camera, since all topic and service names can be directly determined from the namespace. This means we can make a single "template" launch file suitable for all RGBD cameras.
Note - this guide assumes the naming conventions of OpenNI2, which is what we use for the DRC. RGBD cameras using OpenNI will have slightly different topic names.
First, to make things easier to understand, we'll use a number of helper launch files. These launch files are an implementation of the material covered in the previous tutorials, so if you haven't read through them, you should do that first.
- rgbd_image_link_start.launch
<launch>
<arg name="image_name" default="camera" />
<arg name="output" default="screen" />
<arg name="remapped_tf" default="/tf" />
<arg name="node_name" default="$(arg image_name)" />
<node pkg="opportunistic_link" type="request_camera_link_startpoint" name="$(arg node_name)_camera_link_startpoint" output="$(arg output)" >
<param name="camera_topic" type="string" value="$(arg image_name)/rgb/image" />
<param name="data_service" type="string" value="$(arg image_name)/rgb/data" />
<remap from="/tf" to="$(arg remapped_tf)" />
</node>
</launch>
This launch file sets up the startpoint end of the relay for the camera feed (image data + camera_info). Note that the only important arguments are image_name
, the base namespace of the RGBD camera, and node_name
, which is used to prefix the names of the nodes in the relay. In most cases, node_name
defaults to the same value as image_name
; however, if image_name
contains a /
, they you'll need to come up with a different value for node_name
.
- rgbd_image_link_end.launch
<launch>
<arg name="image_name" default="camera" />
<arg name="output" default="screen" />
<arg name="remapped_tf" default="/tf" />
<arg name="default_rate" default="1.0" />
<arg name="quality" default="10" />
<arg name="override_timestamps" default="false" />
<arg name="node_name" default="$(arg image_name)" />
<node pkg="opportunistic_link" type="request_camera_link_endpoint" name="$(arg node_name)_camera_link_endpoint" output="$(arg output)" >
<param name="relay_topic" type="string" value="$(arg image_name)/relay/rgb/image" />
<param name="latched" type="bool" value="true" />
<param name="default_rate" type="double" value="$(arg default_rate)" />
<param name="default_quality" type="int" value="$(arg quality)" />
<param name="quality_ctrl" type="string" value="$(arg image_name)/rgb/quality" />
<param name="rate_ctrl" type="string" value="$(arg image_name)/rgb/rate" />
<param name="data_service" type="string" value="$(arg image_name)/rgb/data" />
<param name="override_timestamps" type="bool" value="$(arg override_timestamps)" />
<remap from="/tf" to="$(arg remapped_tf)" />
</node>
</launch>
This launch file sets up the endpoint end of the relay for the camera feed (image data + camera_info). Note that the only important arguments are image_name
, the base namespace of the RGBD camera, and node_name
, which is used to prefix the names of the nodes in the relay. Additional arguments default_rate
and quality
should be set depending on the data rates available. Faster networks will allow higher values of both. In most cases, node_name
defaults to the same value as image_name
; however, if image_name
contains a /
, they you'll need to come up with a different value for node_name
.
- rgbd_pointcloud_link_start.launch
<launch>
<arg name="pointcloud_name" default="camera" />
<arg name="output" default="screen" />
<arg name="remapped_tf" default="/tf" />
<arg name="node_name" default="$(arg pointcloud_name)" />
<node pkg="opportunistic_link" type="request_pointcloud_link_startpoint" name="$(arg node_name)_pointcloud_link_startpoint" output="$(arg output)" >
<param name="pointcloud_topic" type="string" value="$(arg pointcloud_name)/depth/points_xyz" />
<param name="compression_type" type="string" value="PC30" />
<param name="data_service" type="string" value="$(arg pointcloud_name)/depth/data" />
<remap from="/tf" to="$(arg remapped_tf)" />
</node>
</launch>
This launch file sets up the startpoint end of the relay for the pointcloud feed. Note that the only important arguments are pointcloud_name
, the base namespace of the RGBD camera, and node_name
, which is used to prefix the names of the nodes in the relay. In most cases, node_name
defaults to the same value as image_name
; however, if image_name
contains a /
, they you'll need to come up with a different value for node_name
. The value of filter_size
may also be changed; however, in our experience, 0.02 has been a good value.
- rgbd_pointcloud_link_end.launch
<launch>
<arg name="pointcloud_name" default="camera" />
<arg name="output" default="screen" />
<arg name="remapped_tf" default="/tf" />
<arg name="default_rate" default="1.0" />
<arg name="filter_size" default="0.02" />
<arg name="override_timestamps" default="false" />
<arg name="node_name" default="$(arg pointcloud_name)" />
<node pkg="opportunistic_link" type="request_pointcloud_link_endpoint" name="$(arg node_name)_pointcloud_link_endpoint" output="$(arg output)" >
<param name="relay_topic" type="string" value="$(arg pointcloud_name)/relay/depth/points_xyz" />
<param name="latched" type="bool" value="true" />
<param name="default_rate" type="double" value="$(arg default_rate)" />
<param name="default_filter_size" type="double" value="$(arg filter_size)" />
<param name="filter_ctrl" type="string" value="$(arg pointcloud_name)/depth/quality" />
<param name="rate_ctrl" type="string" value="$(arg pointcloud_name)/depth/rate" />
<param name="data_service" type="string" value="$(arg pointcloud_name)/depth/data" />
<param name="override_timestamps" type="bool" value="$(arg override_timestamps)" />
<remap from="/tf" to="$(arg remapped_tf)" />
</node>
</launch>
This launch file sets up the endpoint end of the relay for the pointcloud feed. Note that the only important arguments are pointcloud_name
, the base namespace of the RGBD camera, and node_name
, which is used to prefix the names of the nodes in the relay. In most cases, node_name
defaults to the same value as image_name
; however, if image_name
contains a /
, they you'll need to come up with a different value for node_name
. Additional argument default_rate
should be set depending on the data rates available. On poor networks, values greater than 1.0 are inadvisable.
Using these 4 helper files, the actual configuration of the relay is surprisingly easy
- rgbd_link_start.launch
<launch>
<arg name="rgbd_name" default="camera" />
<arg name="output" default="screen" />
<arg name="remapped_tf" default="/tf" />
<arg name="node_name" default="$(arg rgbd_name)" />
<include file="$(find hubo_launch)/launch/rgbd_pointcloud_link_start.launch" >
<arg name="pointcloud_name" value="$(arg rgbd_name)" />
<arg name="node_name" value="$(arg node_name)" />
<arg name="output" value="$(arg output)" />
<arg name="remapped_tf" value="$(arg remapped_tf)" />
</include>
<include file="$(find hubo_launch)/launch/rgbd_image_link_start.launch" >
<arg name="image_name" value="$(arg rgbd_name)" />
<arg name="node_name" value="$(arg node_name)" />
<arg name="output" value="$(arg output)" />
<arg name="remapped_tf" value="$(arg remapped_tf)" />
</include>
</launch>
This launch file launches all startpoint nodes. The only arguments are rgbd_name
, the base namespace of the RGBD camera, and node_name
, which is used to prefix the names of the nodes in the relay. In most cases, node_name
defaults to the same value as rgbd_name
; however, if rgbd_name
contains a /
, they you'll need to come up with a different value for node_name
.
- rgbd_link_end.launch
<launch>
<arg name="rgbd_name" default="camera" />
<arg name="camera_rate" default="5.0" />
<arg name="pointcloud_rate" default="1.0" />
<arg name="camera_quality" default="10" />
<arg name="pointcloud_filter" default="0.02" />
<arg name="override_timestamps" default="true" />
<arg name="output" default="screen" />
<arg name="remapped_tf" default="/tf" />
<arg name="node_name" default="$(arg rgbd_name)" />
<include file="$(find hubo_launch)/launch/rgbd_pointcloud_link_end.launch" >
<arg name="pointcloud_name" value="$(arg rgbd_name)" />
<arg name="node_name" value="$(arg node_name)" />
<arg name="default_rate" value="$(arg pointcloud_rate)" />
<arg name="filter_size" value="$(arg pointcloud_filter)" />
<arg name="override_timestamps" value="$(arg override_timestamps)" />
<arg name="output" value="$(arg output)" />
<arg name="remapped_tf" value="$(arg remapped_tf)" />
</include>
<include file="$(find hubo_launch)/launch/rgbd_image_link_end.launch" >
<arg name="image_name" value="$(arg rgbd_name)" />
<arg name="node_name" value="$(arg node_name)" />
<arg name="default_rate" value="$(arg camera_rate)" />
<arg name="quality" value="$(arg camera_quality)" />
<arg name="override_timestamps" value="$(arg override_timestamps)" />
<arg name="output" value="$(arg output)" />
<arg name="remapped_tf" value="$(arg remapped_tf)" />
</include>
</launch>
This launch file launches all endpoint nodes. The only arguments are rgbd_name
, the base namespace of the RGBD camera, and node_name
, which is used to prefix the names of the nodes in the relay. In most cases, node_name
defaults to the same value as rgbd_name
; however, if rgbd_name
contains a /
, they you'll need to come up with a different value for node_name
.
By using this series of launch files, we have reduced the configuration of a RGBD relay from over 20 parameters to four:
-
The base namespace of the RGBD camera
-
The prefix you want to use for naming the nodes of the relay
-
The default rate for camera data in frames/second
-
The default rate for pointcloud data in clouds/second