April Tags Activity
Camera Calibration
# Start the camera node (exact command depends on your hardware) ros2 run usb_cam usb_cam_node_exe --ros-args -p framerate:=30.0 # Run the camera calibration ros2 run camera_calibration cameracalibrator --size 8x6 --square 0.108 --ros-args -r image:=/image_raw # Do the calibration, it gets saved to /tmp/calibrationdata.tar.gz # Extract the calibration data cd /tmp mkdir calib mv /tmp/calibrationdata.tar.gz /tmp/calib cd /tmp/calib tar xf calibrationdata.tar.gz # Kill the usb_cam node and restart, this time loading the calibration ros2 run usb_cam usb_cam_node_exe --ros-args -p framerate:=30.0 -p camera_info_url:=file:///tmp/calib/ost.yaml # Start the image proc pipeline ros2 launch image_proc image_proc.launch.py # Note that this is made up of components ros2 component list # compare the rectified and non-rectified image ros2 run rqt_image_view rqt_image_view
April Tags
- Install the apriltag_ros package
- This package will automatically install the apriltag package
apriltag
is a ROS-independent library andapriltag_ros
provides a ROS API for it
- Need to print April tags, with a specified size
- https://github.com/AprilRobotics/apriltag-imgs
- Scale the image and print
- Create the
tags.yaml
file describing the april tags (see instructions in in the apriltag_ros git repository. - Run
ros2 run apriltag_ros apriltag_node --ros-args --params-file ./file.yaml
- Remap
image
andcamera_info
topics as needed file.yaml
should be the name of the file containing the configuration
- Remap
Rviz
- Run
rviz2
- Add the rectified image and a
tf
tree - Put tag in the frame, then change fixed frame to default cam
- You can now add a Camera rather than an image
- Have fun!