ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Is it possible to use more than one kinect with ROS?

asked 2011-05-13 06:25:15 -0600

freebody gravatar image

Hi, I'm currently using kinect with ROS diamondback and openni_kinect (ubuntu stable package). When I connect two kinect sensors to my laptop, only one kinect can publish topics. Is there any driver that enable multiple kinects?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2011-05-13 07:58:13 -0600

mjcarroll gravatar image

updated 2011-05-25 10:14:11 -0600

It should just be a matter of editing the openni_node.launch file that comes with the installation. There are examples of how to choose an openni_camera with different types of enumeration. Here is the launch file in Mercurial: https://kforge.ros.org/openni/openni_ros/file/6794bbd92d89/openni_camera/launch/openni_node.launch

Just copy the node section for the Kinect and add the enumeration of the second device.

<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="device_id" value="#1"/> <!-- this line uses first enumerated device -->
    <rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml" />
    <param name="rgb_frame_id" value="/openni_rgb_optical_frame1" />
    <param name="depth_frame_id" value="/openni_depth_optical_frame1" />
    <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="device_id" value="#2"/> <!-- this line uses second enumerated device -->
    <rosparam command="load" file="$(find openni_camera)/info/openni_params.yaml" />
    <param name="rgb_frame_id" value="/openni_rgb_optical_frame2" />
    <param name="depth_frame_id" value="/openni_depth_optical_frame2" />
    <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>

You will also want to update your kinect_frames launch file for the pair of kinects. I would suggest pursuing a URDF file and joint_state_publisher, as the static transforms can become mind-numbing after a while.

edit flag offensive delete link more

Comments

I'm not positive that this will work, but it should be close. You can also look into the <remap> tag in the launch file, it may be easier.
mjcarroll gravatar image mjcarroll  ( 2011-05-25 10:14:47 -0600 )edit
-1

answered 2011-05-23 09:55:24 -0600

kang gravatar image

Hi,

I tried to modify the openni_node.launch but did not work. Is there any other things need to be considered? pls post link if there is code available for this.

Best.

edit flag offensive delete link more

Comments

Could you be more specific?
KoenBuys gravatar image KoenBuys  ( 2011-05-27 03:39:27 -0600 )edit

Question Tools

Stats

Asked: 2011-05-13 06:25:15 -0600

Seen: 1,417 times

Last updated: May 25 '11