aruco_ros 在相机图像中显示的坐标轴姿态与TF发布的姿态不一致 解决方法

aruco_ros 在相机图像中显示的坐标轴姿态与TF发布的姿态不一致 解决方法

运行环境

系统版本: Ubuntu 16.04
ROS版本: Kinetic

问题描述

在进行手眼标定过程中,为了快速便捷的获取标定板的位姿,考虑采用aruco_ros

使用下面的指令可以快速安装ROS版本的aruco

sudo apt install ros-kinetic-aruco*

运行aruco_ros,结果如图所示

在这里插入图片描述

左边为aruco显示的Marker实时位姿,右侧为在rviz中显示TF发布的Marker位姿。

从图中可以看出,两者都可以显示准确的position,但是左侧相机图像显示的坐标轴 orientation 与ROS TF反馈的数据不一致。

理想情况下,Marker的Z轴应当是指向纸面外部, 按图中Marker放置的位置,Marker的Z轴应当与相机坐标系的Z轴平行且反向,但是,在rviz显示的结果为,Marker指向纸面外部的是Y轴,与左侧相机图像显示的不一致。

虽然直接使用这个位姿进行手眼标定 并不会影响标定结果。但是考虑到后面需要使用Marker进行位姿验证,希望可以让arcuo_ros 显示的坐标轴 与TF发布的姿态能够一致。

解决方案

根据官方大佬给出的解释,给出下面的解决方案

首先,卸载掉之前安装的 aruco_ros

sudo apt remove ros-kinetic-aruco*

然后,在Github下载arcuo_ros 源代码

https://github.com/pal-robotics/aruco_ros/tree/kinetic-devel

将源代码包放到一个ROS的工作空间下,定位到下面的路径

…/aruco_ros/src/

打开文件aruco_ros_utils.cpp,按照下图修改代码
在这里插入图片描述

即,将源代码中的旋转矩阵修改为单位矩阵,然后使用 catkin_make 重新编译

再次运行,可以看到aruco在相机图像中显示的坐标轴位姿已经与TF发布的位姿一致
在这里插入图片描述

### aruco_ros2 ROS 2 Package Installation, Configuration, and Usage For installing the `aruco_ros2` package within a ROS 2 environment, one should follow similar procedures as outlined for setting up other packages but specifically targeting repositories or sources that contain `aruco_ros2`. The general process involves creating an appropriate workspace, cloning necessary repositories into it, ensuring dependencies are met via tools like `rosdep`, building with `colcon`, and sourcing setup files to configure the environment correctly. To begin with, establishing a dedicated ROS 2 workspace is essential: ```bash source /opt/ros/$ROS_DISTRO/setup.bash mkdir -p ~/uros_ws/src && cd ~/uros_ws/ ``` Cloning the repository containing `aruco_ros2` would be required next. Since direct information about its location isn't provided here, typically such operations involve identifying where the desired software resides—often on GitHub or another code hosting service—and using Git commands accordingly: ```bash git clone <repository_url> src/aruco_ros2 ``` Updating dependency lists and resolving them follows thereafter: ```bash rosdep update && rosdep install --from-paths src --ignore-src -r -y ``` Building all packages inside the created workspace can then proceed by invoking Colcon—a tool designed especially for handling multiple-package projects efficiently in ROS 2 environments[^4]: ```bash colcon build --packages-up-to aruco_ros2 ``` After successful compilation, configuring shell sessions so they recognize newly built components becomes important through sourcing generated scripts: ```bash source install/local_setup.bash ``` Regarding specific configurations related to ArUco markers detection tasks, these might include adjusting parameters either directly from command line arguments when launching nodes or modifying launch files alongside any relevant configuration files (`yaml`) used by those nodes. Additionally, custom message types could potentially need definition if interfacing between different parts of systems requires specialized data structures beyond standard ones offered out-of-the-box by ROS 2. In terms of utilizing `aruco_ros2`, once properly set up according to steps mentioned earlier, running example applications included within the package documentation serves well both as learning material and practical utility demonstration purposes. Users may also explore writing their own node(s), subscribing/publishing topics pertinent to marker detections while leveraging functionalities exposed by this library. --related questions-- 1. How does one identify official or community-supported repositories hosting the `aruco_ros2` package? 2. What modifications must occur in CMakeLists.txt for integrating dynamic reconfiguration options associated with `aruco_ros2` settings? 3. Can you provide examples demonstrating how to adjust parameter values dynamically during runtime for better performance tuning of ArUco marker detection processes? 4. Are there alternative methods besides using `colcon` for managing multi-package workspaces effectively in ROS 2 setups?
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值