apriltag介绍:
实验平台:realsenseD435和apriltag码
官网:AprilTagThe APRIL Robotics Laboratory at the University of Michigan investigates Autonomy, Perception, Robotics, Interfaces, and Learning, and is part of the Computer Science and Engineering department. It is led by Associate Professor Edwin Olson.https://april.eecs.umich.edu/software/apriltag.html
Apriltag的样子如下图所示,
apriltag的识别过程如下图所示:
通过点阵获得二维码的内部编码形式,确定二维码的族和id
ros包安装和编译:
mkdir catkin_demo/src
cd catkin_demo/src
git clone https://github.com/rocos-sia/apriltagAndrealsense.git
cd ..
catkin build
ros包解释和功能介绍:
其中apriltag2_ros就是我们的apriltag_ros只是后续更新了版本
其中apriltag2_ros就是我们的apriltag_ros只是后续更新了版本
apriltag_ros所用的话题:/camera/image_rect,/camera/camera_info:
话题接收消息类型为:/sensor_msgs/Image,该消息包含了从相机采集到的图像数据。
/camera/camera_info:话题接收消息类型为:/sensor_msgs/CameraInfo ,该消息包含了相机的内参矩阵K和其他的一些标定参数。
apriltag_ros所导出的话题:
/tag_detections:话题发布类型:apriltag_ros/AprilTagDetectionArray(自定义消息类型)
包含(识别得到的世界坐标系和相机坐标系的变换参数)
/tf:话题发布类型:tf2_msgs/TFMessage:世界坐标系和相机坐标系的变换矩阵的变换参数
/tag_detections_image:话题发布类型:sensor_msgs/Image
包含相机识别码的输出图像,如果图像没有码该信息和/camera/image_rect一致。所以无论是Realsense还是海康,只需要给该ROS包喂sensor_msgs/Image和/sensor_msgs/CameraInfo即可。
话题的对应:可以改相机或者直接个更改该ROS包
码的参数设置:
tag.yaml
该yaml文件主要是确定码的参数和id
standalone_tags: [ {id: 1 , size: 0.14} ]
Id 为1 大小为14cm
settings.yaml
确定apriltag码的家族和算法解析参数
tag_family: 'tag36h11' # options: tagStandard52h13, tagStandard41h12, tag36h11, tag25h9, tag16h5, tagCustom48h12, tagCircle21h7, tagCircle49h12
tag_threads: 2 # default: 2
tag_decimate: 1.0 # default: 1.0
tag_blur: 0.0 # default: 0.0
tag_refine_edges: 1 # default: 1
tag_debug: 0 # default: 0
max_hamming_dist: 2 # default: 2 (Tunable parameter with 2 being a good choice - values >=3 consume large amounts of memory. Choose the largest value possible.)
# Other parameters
publish_tf: true # default: false
transport_hint: "raw" # default: raw, see http://wiki.ros.org/image_transpo
启动运行该包:
source ./devel/setup.bash
roslaunch apriltag_ros continuous_detection.launch
常用测试图像的指令
rqt_image_viewer