Multiple Kinect
Hi! I am trying to use two kinects, one to perform human tracking and object recognition, and one to navigate (using pointcloud to laserscan).
I modified the openni_node.launch with two nodes and I adjusted the kinect_frames.launch. Both kinect publish the rgb image, but just one (apparently randomly) publishes the pointcloud.
Here are the files I modified
openni_node.launch
<launch>
<arg name="debug" default="false"/>
<arg if="$(arg debug)" name="launch_prefix" value="xterm -rv -e gdb -ex run -args"/>
<arg unless="$(arg debug)" name="launch_prefix" value=""/>
<node pkg="openni_camera" type="openni_node" name="openni_node1" output="screen" launch-prefix="$(arg launch_prefix)">
<!--param name="topic" value="first" /-->
<!--param name="device_id" value="2@3" --> <!-- this line uses device on usb bus 2 and addres 3 -->
<param name="device_id" value="A00366A12990044A"/> <!-- this line uses device with given serial number -->
<!--param name="device_id" value="#1" /-->
<rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml" />
<param name="rgb_frame_id" value="/openni_rgb_optical_frame" />
<param name="depth_frame_id" value="/openni_depth_optical_frame" />
<param name="use_indices" value="false" />
<param name="depth_registration" value="true" />
<param name="image_mode" value="2" />
<param name="depth_mode" value="2" />
<param name="debayering" value="2" />
<param name="depth_time_offset" value="0" />
<param name="image_time_offset" value="0" />
</node>
<node pkg="openni_camera" type="openni_node" name="openni_node2" output="screen" launch-prefix="$(arg launch_prefix)">
<!--param name="topic" value="first" /-->
<param name="device_id" value="A00363A00048052A"/>
<rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml" />
<remap from="camera" to="camera_2"/>
<param name="rgb_frame_id" value="/openni_rgb_optical_frame_2" />
<param name="depth_frame_id" value="/openni_depth_optical_frame_2" />
<param name="use_indices" value="false" />
<param name="depth_registration" value="true" />
<param name="image_mode" value="2" />
<param name="depth_mode" value="2" />
<param name="debayering" value="2" />
<param name="depth_time_offset" value="0" />
<param name="image_time_offset" value="0" />
</node>
<include file="$(find openni_camera)/launch/kinect_frames.launch"/>
</launch>
kinect_frames.launch
<launch>
<!-- <node pkg="tf" type="static_transform_publisher" name="base_link_to_openni" args="-0.04 0 0 1.57 -1.57 0 /base_link /openni_camera 100" /> -->
<node pkg="tf" type="static_transform_publisher" name="kinect_fake_laser" args="-0.155 -0.14 0.19 -1.57 0 0 /base_link /base_laser 100" />
<node pkg="tf" type="static_transform_publisher" name="kinect_base_link" args="0.02 0 0 -3.14 0 0 /openni_camera /openni_depth_frame 100" />
<node pkg="tf" type="static_transform_publisher" name="kinect_base_link1" args="0.04 0 0 -3.14 0 0 /openni_camera /openni_rgb_frame 100" />
<node pkg="tf" type="static_transform_publisher" name="kinect_base_link2" args="0 0 0 3.14 0 0 /openni_depth_frame /openni_depth_optical_frame 100" />
<node pkg="tf" type="static_transform_publisher" name="kinect_base_link3" args="0 0 0 3.14 0 0 /openni_rgb_frame /openni_rgb_optical_frame 100" />
<node pkg="tf" type="static_transform_publisher" name="kinect_base_link0_2" args="-0.155 -0.14 0.19 3.14 0 -1.57 /base_link /openni_camera_2 100" />
<node pkg="tf" type="static_transform_publisher" name="kinect_base_link_2" args="0.02 0 0 -3.14 0 0 /openni_camera_2 /openni_depth_frame_2 100" />
<node pkg="tf" type="static_transform_publisher" name="kinect_base_link1_2" args="0.04 0 0 -3.14 0 0 /openni_camera_2 /openni_rgb_frame_2 100" />
<node pkg="tf" type="static_transform_publisher" name="kinect_base_link2_2" args="0 0 0 3.14 0 0 /openni_depth_frame_2 /openni_depth_optical_frame_2 100" />
<node pkg="tf" type="static_transform_publisher" name="kinect_base_link3_2" args="0 0 0 3.14 0 0 /openni_rgb_frame_2 /openni_rgb_optical_frame_2 100" />
</launch>
Thank ...