ROS使用ARUCO识别二维码获取位置信息做定位使用

使用ARUCO识别二维码获取位置信息

1、安装软件
cd ~/catkin_ws/src
git clone -b kinetic-devel https://github.com/pal-robotics/aruco_ros
cd …
catkin_make
在编译时遇到一个错误
/home/wgq/catkin_wgq/src/aruco_ros/aruco_ros/src/simple_double.cpp: In function ‘void image_callback(const ImageConstPtr&)’:
/home/wgq/catkin_wgq/src/aruco_ros/aruco_ros/src/simple_double.cpp:161:78: error: ‘CV_FILLED’ was not declared in this scope
v::circle(inImage, cv::Point(u[0], v[0]), 3, cv::Scalar(0, 0, 255), CV_FILLED);
^~~~~~~~~
/home/wgq/catkin_wgq/src/aruco_ros/aruco_ros/src/simple_double.cpp:161:78: note: suggested alternative: ‘__FILE’
v::circle(inImage, cv::Point(u[0], v[0]), 3, cv::Scalar(0, 0, 255), CV_FILLED);
^~~~~~~~~
__FILE
aruco_ros/aruco_ros/CMakeFiles/double.dir/build.make:62: recipe for target ‘aruco_ros/aruco_ros/CMakeFiles/double.dir/src/simple_double.cpp.o’ failed
make[2]: *** [aruco_ros/aruco_ros/CMakeFiles/double.dir/src/simple_double.cpp.o] Error 1
CMakeFiles/Makefile2:2507: recipe for target ‘aruco_ros/aruco_ros/CMakeFiles/double.dir/all’ failed
make[1]: *** [aruco_ros/aruco_ros/CMakeFiles/double.dir/all] Error 2
Makefile:140: recipe for target ‘all’ failed

解决方法:CV_FILLED直接-1

2、测试aruco标签
首先把launch文件里mark的ID和尺寸对应上,相机发布的主题对应上
Mark标签可以到https://chev.me/arucogen/打印
启动usb相机
roslaunch usb_cam usb_cam.launch
启动单标签
roslaunch aruco_ros single.launch
launch文件里相机的主题要对应上
可以用rqt查看,如图识别出正确mark即可
在这里插入图片描述

3、获取位置信息
双目相机标定,已经标定好的usb相机可以直接使用
到工程src文件夹下
git clone https://github.com/ros-perception/image_pipeline.git
编译成功后即可以使用标定包,注意尺寸和点位的对应
rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 right:=/my_stereo/right/image_raw left:=/my_stereo/left/image_raw left_camera:=/my_stereo/left right_camera:=/my_stereo/right
可到以下地址下载标定板
http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration?action=AttachFile&do=view&target=check-108.pdf
在这里插入图片描述

变换标定板位置,在相机视野的上下左右,倾斜水平,直到所有项目都为绿色条
再次运行标签识别
roslaunch aruco_ros single.launch

查看位姿.launch文件里标签ID要对应,
rostopic echo /aruco_single/pose
在这里插入图片描述
在这里插入图片描述

  • 2
    点赞
  • 46
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wgqabc

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值