kinect ros 安装记录

本文档详细介绍了如何将Kinect设备与ROS (Robot Operating System) 系统集成,包括安装必要的软件包、配置环境、查看Kinect数据流等步骤。通过本教程,读者可以学会如何利用ROS工具查看Kinect的RGB图像、深度图像及点云数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

更多资料 参看

http://wiki.western.edu/mcis/index.php/Robotics-sum11/backup/Tutorial

http://www.ros.org/wiki/mit-ros-pkg/KinectDemos/HandDetection

http://www.ros.org/wiki/openni_camera


kinect  ros
basicly follow the rules in 
http://www.ros.org/wiki/openni_kinect
http://www.ros.org/wiki/openni_camera

but most important:
To view in rviz, launch rviz:

rosrun rviz rviz

Set the Fixed Frame (top left of rviz window) to /openni_rgb_optical_frame.

Add a Point Cloud2 display, and set the topic to /camera/rgb/points.

to view the bio image

rosrun image_view image_view image:=/camera/depth/image_raw
rosrun image_view disparity_view image:=/camera/depth/disparity
//http://www.ros.org/wiki/openni_camera_unstable

 

open it  to get the Node [/openni_node1]

 

http://www.ros.org/wiki/openni/Contests/ROS%203D/Teleop%20Kinect%20Cleanup

 

安装 ni

lu@lu-desktop:~$ rosinstall ~/ni /opt/ros/diamondback 'http://www.ros.org/wiki/ni?action=AttachFile&do=get&target=ni.rosinstall'
rosinstall operating on /home/lu/ni from specifications in rosinstall files  /opt/ros/diamondback,http://www.ros.org/wiki/ni?action=AttachFile&do=get&target=ni.rosinstall
processing config_uri /opt/ros/diamondback
//hg clone https://kforge.ros.org/openni/openni_ros

遇到问题 没装git
sudo apt-get install python-setuptools
sudo easy_install -U rosinstall
sudo apt-get install git-core curl

装完之后  结果

rosinstall ~/ni /opt/ros/diamondback 'http://www.ros.org/wiki/ni?action=AttachFile&do=get&target=ni.rosinstall'
rosinstall operating on /home/lu/ni from specifications in rosinstall files  /home/lu/ni/.rosinstall, /opt/ros/diamondback,http://www.ros.org/wiki/ni?action=AttachFile&do=get&target=ni.rosinstall
processing config_uri /opt/ros/diamondback
Installing https://github.com/ros-pkg-git/ni.git master to /home/lu/ni/ni
Already up-to-date.
Bootstrapping ROS build
[ rosmake ] Packages requested are: ['ros']                                     
[ rosmake ] Logging to directory/home/lu/.ros/rosmake/rosmake_output-20110916-170016
[ rosmake ] Expanded args ['ros'] to:
['rosdep', 'rospack', 'rosmake', 'rosemacs', 'rosclean', 'roscreate', 'rosbash', 'rosboost_cfg', 'rosunit', 'roslang', 'rosbuild', 'mk', 'roslib', 'test_roslib', 'test_roscreate', 'test_rospack', 'test_rosmake', 'test_rosdep']
[ rosmake ] Generating Install Script using rosdep then executing. This may take a minute, you will be prompted for permissions. . .
rosdep executing this script:
{{{
set -o errexit
#No Packages to install
}}}
[ rosmake ] rosdep successfully installed all system dependencies               
[rosmake-0] Starting >>> roslib [ make ]                                        
[rosmake-0] Finished <<< roslib ROS_NOBUILD in package roslib                   
[rosmake-0] Starting >>> rosdep [ make ]                                        
[rosmake-0] Finished <<< rosdep ROS_NOBUILD in package rosdep
 No Makefile in package rosdep
[rosmake-1] Starting >>> rosemacs [ make ]                                      
[rosmake-0] Starting >>> rosmake [ make ]                                       
[rosmake-1] Finished <<< rosemacs ROS_NOBUILD in package rosemacs
 No Makefile in package rosemacs
[rosmake-0] Finished <<< rosmake ROS_NOBUILD in package rosmake                 
[rosmake-1] Starting >>> rosclean [ make ]                                      
[rosmake-1] Finished <<< rosclean ROS_NOBUILD in package rosclean               
[rosmake-1] Starting >>> roscreate [ make ]                                     
[rosmake-1] Finished <<< roscreate ROS_NOBUILD in package roscreate             
[rosmake-1] Starting >>> rosbash [ make ]                                       
[rosmake-1] Finished <<< rosbash ROS_NOBUILD in package rosbash
 No Makefile in package rosbash
[rosmake-1] Starting >>> rosboost_cfg [ make ]                                  
[rosmake-1] Finished <<< rosboost_cfg ROS_NOBUILD in package rosboost_cfg
 No Makefile in package rosboost_cfg
[rosmake-1] Starting >>> rosunit [ make ]                                       
[rosmake-1] Finished <<< rosunit ROS_NOBUILD in package rosunit                 
[rosmake-1] Starting >>> rosbuild [ make ]                                      
[rosmake-1] Finished <<< rosbuild ROS_NOBUILD in package rosbuild
 No Makefile in package rosbuild
[rosmake-1] Starting >>> roslang [ make ]                                       
[rosmake-1] Finished <<< roslang ROS_NOBUILD in package roslang
 No Makefile in package roslang
[rosmake-1] Starting >>> mk [ make ]                                            
[rosmake-1] Finished <<< mk ROS_NOBUILD in package mk
 No Makefile in package mk
[rosmake-1] Starting >>> test_roslib [ make ]                                   
[rosmake-1] Finished <<< test_roslib ROS_NOBUILD in package test_roslib         
[rosmake-1] Starting >>> test_roscreate [ make ]                                
[rosmake-1] Finished <<< test_roscreate ROS_NOBUILD in package test_roscreate   
[rosmake-0] Starting >>> test_rospack [ make ]                                  
[rosmake-0] Finished <<< test_rospack ROS_NOBUILD in package test_rospack       
[rosmake-1] Starting >>> test_rosmake [ make ]                                  
[rosmake-1] Finished <<< test_rosmake ROS_NOBUILD in package test_rosmake       
[rosmake-1] Starting >>> test_rosdep [ make ]                                   
[rosmake-1] Finished <<< test_rosdep ROS_NOBUILD in package test_rosdep         
[ rosmake ] Results:                                                            
[ rosmake ] Built 18 packages with 0 failures.                                  
[ rosmake ] Summary output to directory                                         
[ rosmake ] /home/lu/.ros/rosmake/rosmake_output-20110916-170016               

rosinstall update complete.

Now, type 'source /home/lu/ni/setup.bash' to set up your environment.
Add that to the bottom of your ~/.bashrc to set it up every time.

If you are not using bash please see http://www.ros.org/wiki/rosinstall/NonBashShells

 

 

 

 

 

 

details:

Node [/openni_node1]
Publications: 
 * /camera/depth/image [sensor_msgs/Image]
 * /camera/rgb/image_raw [sensor_msgs/Image]
 * /camera/rgb/image_mono/compressed [sensor_msgs/CompressedImage]
 * /camera/rgb/image_mono/compressed/parameter_updates [dynamic_reconfigure/Config]
 * /camera/depth/image/theora [theora_image_transport/Packet]
 * /camera/depth/image_raw/theora [theora_image_transport/Packet]
 * /camera/depth/image_raw/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera/rgb/image_mono/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera/rgb/image_raw/compressed [sensor_msgs/CompressedImage]
 * /camera/rgb/image_mono/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera/rgb/image_mono/theora/parameter_updates [dynamic_reconfigure/Config]
 * /camera/rgb/image_raw/compressed/parameter_updates [dynamic_reconfigure/Config]
 * /camera/depth/image/theora/parameter_updates [dynamic_reconfigure/Config]
 * /openni_node1/parameter_updates [dynamic_reconfigure/Config]
 * /camera/depth/image_raw/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera/rgb/points [sensor_msgs/PointCloud2]
 * /camera/rgb/camera_info [sensor_msgs/CameraInfo]
 * /camera/rgb/image_color/compressed [sensor_msgs/CompressedImage]
 * /camera/rgb/image_color/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera/depth/image/compressed [sensor_msgs/CompressedImage]
 * /camera/depth/image_raw/theora/parameter_updates [dynamic_reconfigure/Config]
 * /camera/depth/image_raw/compressed [sensor_msgs/CompressedImage]
 * /camera/rgb/image_color/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera/depth/camera_info [sensor_msgs/CameraInfo]
 * /camera/rgb/image_color [sensor_msgs/Image]
 * /camera/rgb/image_raw/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /rosout [rosgraph_msgs/Log]
 * /camera/depth/disparity [stereo_msgs/DisparityImage]
 * /camera/depth/image_raw [sensor_msgs/Image]
 * /camera/rgb/image_color/compressed/parameter_updates [dynamic_reconfigure/Config]
 * /camera/depth/image/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera/rgb/image_mono [sensor_msgs/Image]
 * /camera/rgb/image_raw/theora/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera/rgb/image_color/theora/parameter_updates [dynamic_reconfigure/Config]
 * /camera/depth/points [sensor_msgs/PointCloud2]
 * /camera/rgb/image_raw/theora [theora_image_transport/Packet]
 * /camera/rgb/image_raw/theora/parameter_updates [dynamic_reconfigure/Config]
 * /camera/depth/image_raw/compressed/parameter_updates [dynamic_reconfigure/Config]
 * /camera/rgb/image_mono/theora [theora_image_transport/Packet]
 * /camera/rgb/image_color/theora [theora_image_transport/Packet]
 * /camera/depth/image/compressed/parameter_updates [dynamic_reconfigure/Config]
 * /openni_node1/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /camera/depth/image/compressed/parameter_descriptions [dynamic_reconfigure/ConfigDescription]

Subscriptions: None

Services: 
 * /openni_node1/get_loggers
 * /camera/rgb/image_raw/compressed/set_parameters
 * /camera/rgb/image_raw/theora/set_parameters
 * /camera/rgb/image_color/theora/set_parameters
 * /camera/rgb/image_mono/compressed/set_parameters
 * /camera/rgb/image_color/compressed/set_parameters
 * /camera/depth/image_raw/compressed/set_parameters
 * /camera/depth/image/compressed/set_parameters
 * /openni_node1/set_logger_level
 * /openni_node1/set_parameters
 * /openni_node1/unload_nodelet
 * /camera/depth/image/theora/set_parameters
 * /camera/depth/image_raw/theora/set_parameters
 * /openni_node1/list
 * /openni_node1/load_nodelet
 * /camera/rgb/image_mono/theora/set_parameters
Pid: 9765
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS
 * topic: /camera/rgb/image_color
    * to: /image_view_1316159918529090633
    * direction: outbound
    * transport: TCPROS
 * topic: /camera/rgb/points
    * to: /rviz_1316161202975329862
    * direction: outbound
    * transport: TCPROS

 

### 关于 Azure Kinect 的使用教程和案例 #### 1. 安装与配置 对于初次使用者来说,安装并配置 Azure Kinect 开发套件 (DK) 是至关重要的第一步。官方提供了详细的指南来帮助完成这一过程[^1]。 ```bash pip install k4a-python ``` 这段命令展示了如何通过 pip 工具快速安装 Python 封装库 `k4a-python` 来简化开发环境搭建工作[^2]。 #### 2. 实现人体姿态追踪功能 利用 **Azure Kinect Body Tracking SDK** 能够轻松实现实时的人体骨骼节点检测以及动作捕捉等功能。该软件包不仅支持单人也兼容多人的同时跟踪,并提供丰富的 API 接口供开发者调用。 ```cpp // 初始化传感器设备 k4a_device_open(0, &device); bodyTrackingModule->startCamera(device); while (!done) { bodyTrackingModule->update(); } ``` 上述 C++ 代码片段说明了启动相机并与身体追踪模块交互的方法。 #### 3. 结合ROS框架进行数据处理 为了更好地融入机器人操作系统(ROS),微软还特别推出了针对 Azure Kinect DK 设备的支持驱动——**Azure_Kinect_ROS_Driver** 。此驱动允许用户方便地获取来自摄像头的数据流,并将其转换成标准消息格式发布到 ROS 主题中去[^4]。 ```xml <launch> <node pkg="azure_kinect_ros_driver" type="driver" name="kinect"/> </launch> ``` 这是定义了一个简单的 launch 文件用来加载 Azure Kinect ROS 驱动节点的例子。 #### 4. 构建三维点云模型 除了二维图像外,Azure Kinect 还能采集深度信息从而构建精确的三维空间表示形式即所谓的 "point cloud". 用户可以通过调整参数获得不同分辨率下的高质量扫描结果[^3]. ```python import open3d as o3d pcd = o3d.geometry.PointCloud() points = np.array([[0, 0, 0], [1, 0, 0], ...]) colors = np.array([[0, 0, 0], [1, 0, 0], ...]) pcd.points = o3d.utility.Vector3dVector(points) pcd.colors = o3d.utility.Vector3dVector(colors) o3d.visualization.draw_geometries([pcd]) ``` 以上 Open3D 库的应用实例可以展示如何读取并可视化由 Azure Kinect 获取到的点云数据集。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值