两台kinect同时运行

ubuntu14.04,indigo,kinect xbox,联想笔记本

运行环境:kinect V1,ubuntu14.04,ROS indigo,台式机(具备2个以上USB BUS,不是PORT)

lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 04f2:b541 Chicony Electronics Co., Ltd
Bus 001 Device 003: ID 8087:0a2a Intel Corp.
Bus 001 Device 010: ID 045e:02ae Microsoft Corp. Xbox NUI Camera
Bus 001 Device 008: ID 045e:02b0 Microsoft Corp. Xbox NUI Motor
Bus 001 Device 009: ID 045e:02ad Microsoft Corp. Xbox NUI Audio
Bus 001 Device 007: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 002: ID 17ef:6050 Lenovo
Bus 001 Device 014: ID 045e:02ae Microsoft Corp. Xbox NUI Camera
Bus 001 Device 012: ID 045e:02b0 Microsoft Corp. Xbox NUI Motor
Bus 001 Device 013: ID 045e:02ad Microsoft Corp. Xbox NUI Audio
Bus 001 Device 011: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

locate freenect.launch 得到文件位置,因为我的电脑用openni.launch检测不到kinect,未解决。

/opt/ros/indigo/share/freenect_launch/launch/freenect.launch

cd /opt/ros/indigo/share/freenect_launch/launch/

首先,需要自己写一个launch文件,doublekinect_test.launch(文件名自定):

sudo gedit doublekinect_test.launch

文件内容如下:

<launch>
<!-- Parameters possible to change-->
<arg name="camera1_id" default="#1" /><!--here you can change 1@0 by the serial number -->
<arg name="camera2_id" default="#2" /><!--here you can change 2@0 by the  number -->
<!--arg name="camera1_id" default="B00366600710131B" /--><!--here you can change 1@0 by the serial number -->
<!--arg name="camera2_id" default="B00364210621048B" /--><!--here you can change 2@0 by the serial number -->
<!--arg name="camera3_id" default="#3" /--><!--here you can change 3@0 by the serial number -->
<arg name="depth_registration" default="true"/>

<!-- Default parameters-->
<arg name="camera1_name" default="kinect1" />
<arg name="camera2_name" default="kinect2" />
<!--arg name="camera3_name" default="kinect3" /-->

<!-- Putting the time back to realtime-->
<rosparam>
/use_sim_time : false
</rosparam>

<!-- Launching first kinect-->
<include file="$(find freenect_launch)/launch/freenect.launch">
<arg name="device_id" value="$(arg camera1_id)"/>
<arg name="camera" value="$(arg camera1_name)"/>
<arg name="depth_registration" value="$(arg depth_registration)" />

<node name="rviz" pkg="rviz" type="rviz"/>
</include>

<!-- Launching second kinect-->
<include file="$(find freenect_launch)/launch/freenect.launch">
<arg name="device_id" value="$(arg camera2_id)"/>
<arg name="camera" value="$(arg camera2_name)"/>
<arg name="depth_registration" value="$(arg depth_registration)" />

<node name="rviz" pkg="rviz" type="rviz"/>
</include>

<!-- Launching third kinect-->
<!--include file="$(find openni_launch)/launch/openni.launch"-->
<!--arg name="device_id" value="$(arg camera3_id)"/-->
<!--arg name="camera" value="$(arg camera3_name)"/-->
<!--arg name="depth_registration" value="$(arg depth_registration)" /-->
<!--/include-->

</launch>

保存

只要电脑配置有多个USB BUS,就可以接3个甚至更多个kinect。


打开终端,运行:

  1. roslaunch freenect_launchdoublekinect_test.launch  

如果报错:sudo dmesg -c

再打开一个终端,运行:

  1. rosrun image_view image_view image:=/kinect1/rgb/image_color  
rosrun image_view disparity_view image:=/kinect_1/depth/disparity 会出现第一台kinect的深度图
再打开一个终端,运行:
  1. rosrun image_view image_view image:=/kinect2/rgb/image_color 

参考链接:

http://www.aichengxu.com/view/37264
http://answers.ros.org/question/96071/accessing-multiple-kinects-in-ros-hydro/

http://blog.youkuaiyun.com/zqxf123456789/article/details/52530189


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值