0
$\begingroup$

Rosanswers logo

The node /apriltag_detector will launch with no errors or warnings. I ssh into a Raspberry Pi and view the camera image with the package web_video_ server via the topic /tag_detection_image. Once I place an apriltag in view of the camera the apriltag_detector node crashes and gives this error:

OpenCV Error: Assertion failed (mtype == type0 || (((((mtype) & ((512 - 1) << 3)) >> 3) + 1) == 1 && ((1 << type0) & fixedDepthMask) != 0)) in create, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/core/src/matrix.cpp, line 2542 terminate called after throwing an instance of 'cv::Exception' what(): /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/core/src/matrix.cpp:2542: error: (-215) mtype == type0 || (((((mtype) & ((512 - 1) << 3)) >> 3)

    1. == 1 && ((1 << type0) & fixedDepthMask) != 0) in function create

[apriltag_detector-1] process has died [pid 2075, exit code -6, cmd /home/pi/catkin_ws/devel/lib/apriltags_ros/apriltag_detector_node image_rect:=usb_cam/image_raw camera_info:=usb_cam/camera_info __name:=apriltag_detector __log:=/home/pi/.ros/log/943615a2-fb0c-11e7-91d7-b827eb550879/apriltag_detector-1.log]. log file: /home/pi/.ros/log/943615a2-fb0c-11e7-91d7-b827eb550879/apriltag_detector-1*.log all processes on machine have died, roslaunch will exit shutting down processing monitor... ... shutting down processing monitor complete done

This node used to work before complications with calibrating the camera. I resolved the calibration problem and the camera is calibrated. Initially I thought I may have messed something up trying to fix the calibration problem but am now led to believe it may have happened after an update/upgrade.

My attempts to downgrade openCV3 using sudo apt-get failed. I thought of commenting out the line of code causing the error but the error list a temporary directory that no longer exists. Any thoughts or advice would be appreciated. Thank you in advance.


Originally posted by dpoiesz on ROS Answers with karma: 43 on 2018-01-16

Post score: 3


Original comments

Comment by deksprime on 2018-01-22:
We are also having the exact same problem. It works with the opencv-3.2 but not with the 3.3.1 thus we've deduced that it is due to the opencv update on ros but no solution yet

Comment by dpoiesz on 2018-01-27:
@deksprime, were you able to revert back to opencv-3.2? My attempts failed because the source was not available, could you share how you downgraded?

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Hello,

if you are using this repo http://wiki.ros.org/apriltags_ros, the pull request https://github.com/RIVeR-Lab/apriltags_ros/pull/30 solved our problem but it is still not merged with master thus what you need to do is to change the code piece located inside getRelativeTransform method in TagDetection.cc file

from

  cv::Matx33f cameraMatrix(
                       fx, 0, px,
                       0, fy, py,
                       0,  0,  1);

to

  cv::Matx33d cameraMatrix(
                       fx, 0, px,
                       0, fy, py,
                       0,  0,  1);

Hope it helps


Originally posted by cagatay with karma: 1850 on 2018-01-22

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by dpoiesz on 2018-01-22:
Thanks, can't wait to try it. I will let you know how it goes.

Comment by dpoiesz on 2018-01-27:
@cagatay, I changed the f to a d in TagDetections.cc but still get the same error. Did I miss a step?

Comment by dpoiesz on 2018-01-27:
Nevermind, I forgot to rebuild the workspace. Thank you very much for helping me!

$\endgroup$
0
$\begingroup$

I got the same error, I'm using this repo: https://github.com/AprilRobotics/apriltag_ros.git

When I'm trying to run some of the tutotials of ros wiki(bundle calibration) from ros tutorials http://wiki.ros.org/apriltag_ros/Tutorials/Bundle%20calibration

I got this error when I'm trying to execute this command roslaunch apriltags_ros continuous_detection.launch

Error: [apriltag_ros_continuous_node-1] process has died [pid 20944, exit code -8, cmd /root/apriltags_ws/devel/lib/apriltag_ros/apriltag_ros_continuous_node image_rect:=/camera_rect/image_rect camera_info:=/camera_rect/camera_info __name:=apriltag_ros_continuous_node __log:=/root/.ros/log/84fda9f8-4e4c-11ee-bba3-dc41a915791c/apriltag_ros_continuous_node-1.log]. log file: /root/.ros/log/84fda9f8-4e4c-11ee-bba3-dc41a915791c/apriltag_ros_continuous_node-1*.log

I'm using ros-melodic and also I checked the problem mentioned about the matrix and it is with d.

Someone has this error?

$\endgroup$
2
  • $\begingroup$ Please ask a new question linked to this old one instead of asking in the "answer". Add as much context as possible, it will help with the eventual solution. $\endgroup$
    – ljaniec
    Commented Sep 8, 2023 at 16:17
  • $\begingroup$ This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review $\endgroup$
    – cst0
    Commented Sep 8, 2023 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.