AprilTag Camera_Info Synchronization
Hi, I'm trying to get some AprilTag detections going and have two semi-related issues. I have a video stream coming from a camera in UYVY format that I'm trying to do detection on. When I try to run the continuous detection node I get the following error:
NODES / apriltag_ros_continuous_node (apriltag_ros/apriltag_ros_continuous_node)
ROS_MASTER_URI=http://localhost:11311
process[apriltag_ros_continuous_node-1]: started with pid [23411] OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /build/opencv-XDqSFW/opencv-3.2.0+dfsg/modules/imgproc/src/color.cpp, line 9748 terminate called after throwing an instance of 'cv::Exception' what(): /build/opencv-XDqSFW/opencv-3.2.0+dfsg/modules/imgproc/src/color.cpp:9748: error: (-215) scn == 3 || scn == 4 in function cvtColor
[apriltag_ros_continuous_node-1] process has died [pid 23411, exit code -6, cmd /home/matt/AprilTag_Test/devel/lib/apriltag_ros/apriltag_ros_continuous_node image_rect:=/basler_camera/image_raw camera_info:=/basler_camera/camera_info __name:=apriltag_ros_continuous_node __log:=/home/matt/.ros/log/49ee0aa4-e117-11ec-ae5d-5ca6e636641b/apriltag_ros_continuous_node-1.log]. log file: /home/matt/.ros/log/49ee0aa4-e117-11ec-ae5d-5ca6e636641b/apriltag_ros_continuous_node-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete done
Looking around this seems to be an error message OpenCV throws when it gets a malformatted image. I'm able to confirm that the image is read properly by ROS with both rqt_image_view and image_proc so I don't think that's the issue. I'm wondering if it might just be that AprilTag doesn't support UYVY? I went to convert it to RGB by piping it through image_proc to see if it could get it to work. The image conversion succeeds, but the AprilTag node then throws a warning about the camera_info and image messages being unsynchronized and I don't get any detections. The tag_detections_image comes out blank and I get nothing on any of the tag_detections topics when doing a rostopic echo
NODES / apriltag_ros_continuous_node (apriltag_ros/apriltag_ros_continuous_node)
ROS_MASTER_URI=http://localhost:11311
process[apriltag_ros_continuous_node-1]: started with pid [24442] Image messages received: 148 CameraInfo messages received: 269 Synchronized pairs: 0 Image messages received: 151 CameraInfo messages received: 271 Synchronized pairs: 0
Does anybody know if the AprilTag node 100% requires that the image and camera_info messages be synchronized and will it not do tag detection otherwise? One could easily need to do some intermediate image processing, say like rectification with an existing node that may not want to resync and republish the camera_info topic. Are there any workarounds to get them in sync, aside from making a repeater node?
As a misc point, I have not yet calibrated the camera and so I'm just supplying a made up focal length with the image size for now but that should only affect the pose estimation, not the ability to detect tags I would think? I tested running the single detector node and got successful tag detections so I don't think that's the issue.
If it matters I'm on the Jetson Nano running Melodic + Jetpack 4.6.1 / Ubuntu 18.04