校正kinect tf 关系

本文介绍如何解决Kinect在避障过程中误判地面为障碍物的问题。通过重新校准Kinect的tf关系,可以确保Kinect正确识别环境。文章详细步骤包括启动服务、设置Kinect角度及运行校正程序等。

原链接:https://community.bwbot.org/topic/675
开发测试平台:小强机器人

教程10使用kinect避障过程中,我们可能会遇到kinect前端显示有障碍物而实际上没有的情况。这可能是由于kinect的tf关系和默认值差别太大的原因。导致kinect没有正确的识别水平面而把地面当作了障碍物。我们可以重新对kinect tf关系进行校准修复这个问题。

首先启动服务

sudo service startup start

将Kinect放置于空旷的地方,保证kinect前面2m范围内没有障碍物。然后启动kinect驱动程序

roslaunch freenect_launch freenect-xyz.launch

设置kinect角度

rostopic pub /set_tilt_degree std_msgs/Int16 '{data: -19}' -1

运行校正程序

rosrun nav_test kinect2base.py

等待程序运行完成,会有如下输出


FINAL R: [[ 0.         -0.34659864  0.93801353]
 [-1.          0.          0.        ]
 [ 0.         -0.93801353 -0.34659864]]

这个R是经过校正的kinect的tf旋转矩阵。把这个值设置到 /home/xiaoqiang/Documents/ros/src/image_pipeline/depth_image_proc/occupancy_xyz.yaml文件中的 transform rotation matrix。

这样就可以了。

### Kinect2_bridge TF Configuration and Troubleshooting in ROS For proper operation within the Robot Operating System (ROS), configuring the Transform (TF) frames correctly is crucial when using devices like the Kinect v2 sensor with `kinect2_bridge`. When launching `kinect2_bridge`, it's important that parameters related to publishing transform data are set appropriately. To ensure that point cloud data published by the Kinect v2 can be visualized properly in tools such as RVIZ, one must launch `kinect2_bridge` while setting specific flags. For instance, adding a parameter like `publish_tf:=true` ensures that necessary transformations between coordinate systems are broadcasted so that other nodes relying on these transforms function without issues[^5]. In cases where errors occur during the execution of `roslaunch kinect2_bridge kinect2_bridge.launch`, leading to failures in loading nodelets or processes dying unexpectedly, several steps may help diagnose and resolve problems: - Verify installation completeness; missing dependencies might prevent successful initialization. - Ensure compatibility among versions used across different packages involved. - Check system resources since insufficient memory/CPU could lead to crashes especially under high processing demands from depth/image streams[^3]. When encountering difficulties specifically tied to TF configurations after ensuring basic operational integrity through commands similar to those mentioned previously (`rosrun kinect2_bridge ...`) [^4], consider inspecting output logs closely for any hints about misconfigurations regarding frame IDs or parent-child relationships defined within URDF/Xacro files associated with your robot setup. Additionally, running diagnostic checks via `rosrun tf view_frames` followed by reviewing generated PDFs provides insights into existing TF tree structures which aids debugging efforts concerning spatial hierarchies expected versus actual setups realized at runtime. ```bash # Example command sequence demonstrating how to start core services alongside enabling TF publication roscore & roslaunch kinect2_bridge kinect2_bridge.launch publish_tf:=true ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值