Unable to detect AprilTag using ROS on Raspberry Pi
Hi,
I'm running ROS indigo on a Raspberry Pi with IMX219 Raspberry Pi Camera V2. Yet I can’t seem to detect the AprilTag. The raw images and camera info are being published by raspicam_node. The code of the launch file for raspicam_node is:
<launch>
<node pkg="raspicam" type="raspicam_raw_node" name="raspicam_node" respawn="true" ns="camera" output="screen">
<param name="quality" type="double" value="10.0"/>
<param name="framerate" type="double" value="50.0"/>
<param name="width" type="double" value="320.0" />
<param name="height" type="double" value="240.0" />
</node>
<!--node pkg="image_proc" type="image_proc" name="image_proc" respawn="true" ns="/camera"/-->
</launch>
The raw images and camera info are then subscribed by apriltag_detector. The code of the launch file for apriltag_detector is:
<?xml version="1.0" encoding="ISO-8859-15"?>
<launch>
<node pkg="apriltags_ros" type="apriltag_detector_node" name="apriltag_detector" output="screen" ns="camera">
<remap from="image_rect" to="image_raw" />
<remap from="camera_info" to="camera_info" />
<!-- Select the tag family: 16h5, 25h7, 25h9, 36h9, or 36h11(default) -->
<param name="tag_family" type="str" value="36h11" />
<!-- Enable projected optical measurements for more accurate tag transformations -->
<!-- This exists for backwards compatability and should be left true for new setups -->
<param name="projected_optics" type="bool" value="true" />
<!-- Enter your AprilTag information below. Add all tag IDs that will be used, with their sizes -->
<rosparam param="tag_descriptions">[
{id: 0, size: 0.08, frame_name: tag_0},
{id: 1, size: 0.08, frame_name: tag_1},
{id: 2, size: 0.08, frame_name: tag_2},
{id: 3, size: 0.08, frame_name: tag_3},
{id: 4, size: 0.08, frame_name: tag_4},
{id: 5, size: 0.08, frame_name: tag_5},
{id: 6, size: 0.08, frame_name: tag_6},
{id: 7, size: 0.08, frame_name: tag_7},
{id: 8, size: 0.08, frame_name: tag_8},
{id: 9, size: 0.08, frame_name: tag_9},
{id: 10, size: 0.08, frame_name: tag_10},
{id: 11, size: 0.08, frame_name: tag_11},
{id: 12, size: 0.08, frame_name: tag_12},
{id: 13, size: 0.08, frame_name: tag_13},
{id: 14, size: 0.08, frame_name: tag_14},
{id: 15, size: 0.08, frame_name: tag_15},
]
</rosparam>
</node>
</launch>
I have tried the following measures to debug this issue, but with no luck:
- Adjust the camera focal length to make sure the images are reasonably focused.
- Recalibrate the camera using
rosrun camera_calibration cameracalibrator.py
- Feed an original tag image directely to the apriltag_detector node.
Any idea what should I do to debug this issue? I am new to ROS, so any help would be greatly appreciated.