turtlebot(hydro)学习笔记六:添加多个Kinect
来源:互联网 发布:给力什么意思网络用语 编辑:程序博客网 时间:2024/06/02 09:23
最近研究在ros下怎么连接2台或者多台kinect 国内资料很少 翻墙找了点东西 原文在这 http://answers.ros.org/question/96071/accessing-multiple-kinects-in-ros-hydro/
我把大概意思说下 (我的环境是Ubuntu12.04 ros版本 groovy )
首先写一个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 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>
<!-- Openning Rviz forvisualization-->
<node name="rviz"pkg="rviz" type="rviz"/>
<!-- Launching first kinect-->
<include file="$(findopenni_launch)/launch/openni.launch">
<arg name="device_id" value="$(arg camera1_id)"/>
<arg name="camera" value="$(arg camera1_name)"/>
<arg name="depth_registration" value="$(argdepth_registration)" />
</include>
<!-- Launching second kinect-->
<include file="$(findopenni_launch)/launch/openni.launch">
<arg name="device_id" value="$(arg camera2_id)"/>
<arg name="camera" value="$(arg camera2_name)"/>
<arg name="depth_registration" value="$(argdepth_registration)" />
</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="$(argdepth_registration)" />
</include>
</launch>
可以看出上述是定义了3台kinect 至少可以运行两台kinect 但是特别注意 kinect要插在不同的usb bus(是usb bus 不是 usb port)上我是在机箱前面插一个 机箱后面插一个如果在一个共同的usb bus 可能会出现不会识别或者数据传输受阻
将以上代码文件复制到一个txt里将名字改为test.launch (test也可以改为其他名字) 然后将test.launch 复制到/opt/ros/groovy/share/openi_launch/launch/下面
然后打开一个终端输入roslaunchopenni_launch openni.launch camera:=kinect_1 device_id:=#1表示启动第一个kinect
可能会出现几个以try toadvise…..开头的error 这些错误可以忽略没什么影响
然后再打开一个终端输入roslaunch openni_launchopenni.launch camera:=kinect_2 device_id:=#2 表示启动第二个kinect
然后在打开一个终端输入rosrun image_view image_viewimage:=/kinect_1/rgb/image_color然后会出现第一台kinect 的rbg图像
在打开一个输入rosrun image_view disparity_view image:=/kinect_1/depth/disparity 会出现第一台kinect的深度图
只是将以前运行一台kinect的语句rosrun image_view image_viewimage:=/camera/rgb/image_color的camera改为kinect_1而已
看第二台kinect的图像只要将语句中的kinect_1改为kinect_2就行
另外古月大神的ros专栏很不错 是学习ros的很好的资料
- turtlebot(hydro)学习笔记六:添加多个Kinect
- turtlebot(hydro)学习笔记七:ASUS Xtion pro live替换kinect
- turtlebot(hydro)学习笔记三:Android手机控制turtlebot
- turtlebot(hydro)学习笔记五:Joystick控制turtlebot运动
- turtlebot(hydro)学习笔记四:turtlebot上hokuyo UTM-30LX激光扫描仪的添加及导航
- turtlebot(hydro)学习笔记二:桌面pc机键盘远程控制turtlebot
- turtlebot(hydro)学习笔记一:两台PC机间通信
- Kinect学习笔记六CoordinateMapping上
- TurtleBot+ kinect+ ROS
- Turtlebot入门-测试Kinect
- Linux 学习笔记(六)添加用户
- sunburnt 学习笔记(六)添加文档
- ROS进阶学习笔记(11)- Turtlebot Navigation and SLAM
- Kinect开发学习笔记之(六)带游戏者ID的深度数据的提取
- Kinect开发学习笔记之(六)带游戏者ID的深度数据的提取
- C# kinect V2学习笔记(六)简单的2维换衣系统
- Kinect开发学习笔记之(六)带游戏者ID的深度数据的提取
- Kinect开发学习笔记之(六)带游戏者ID的深度数据的提取
- akka构建简单分布式应用
- Python--字符串
- python中pip的使用和安装
- 程序员的量化交易之路(30)--Cointrader之ConfigUtil(17)
- Android RecyclerView 和CardView的用法
- turtlebot(hydro)学习笔记六:添加多个Kinect
- string 去掉某个字符
- 加边
- 国外程序员爱用苹果Mac电脑的10大理由
- Android Studio怎么用?Android Studio使用教程图文详解以及快捷键
- Qt笔记-3-LineEdit中使用正则表达
- 设计模式之PHP项目应用——单例模式设计Memcache和Redis操作类
- LeetCode——Maximum Depth of Binary Tree
- 如何才能找到最优秀开发者?