0
$\begingroup$

Rosanswers logo

Hello list,

Using apriltags (link text) worked fine until the last update of kinetic (around 12 december). Now there is a crash in opencv when doing "roslaunch apriltags usb_cam_apriltags.launch" as soon as a tag is being recognized. It seems that removing the assertion solves the problem. See the output below.

What can I do? Is there e.g. an easy way to replace the opencv3 code from ros-kinetic-opencv3 by using a (patched) version in /usr/local/bin so that ROS will use that?

Thanks in advance, Sietse

 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

[apriltags-1] process has died [pid 11062, exit code -6, cmd /home/p100213/ROS/ws2/devel/lib/apriltags/apriltags ~image:=/usb_cam/image_raw ~camera_info:=/usb_cam/camera_info ~marker_array:=/apriltags/marker_array ~detections:=/apriltags/detections __name:=apriltags __log:=/home/p100213/.ros/log/09d71dee-e56c-11e7-852c-002481150e15/apriltags-1.log].

Originally posted by Sietse on ROS Answers with karma: 168 on 2017-12-20

Post score: 1


Original comments

Comment by pinxian on 2017-12-25:
I have the same problem . Any idea?

Comment by dpoiesz on 2018-01-16:
I'm having a similar issue. Has anyone found a solution?

Comment by ashwinvk94 on 2018-01-19:
I am facing the same issue.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

In apriltags_ros/apriltags/src/TagDetection.cc change line 95, cv::Matx33f ... to :

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

(Just f to d)


Originally posted by Orhan with karma: 856 on 2018-01-22

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by Sietse on 2018-01-25:
First: the version of apriltags_ros I used was a different one. I now switched to the "regular" and patched it as above.

The error does not occur anymore, and tags are detected, with correct id-number. But position/orientation is not given. Always all zero's apart from w. Still anything wrong?

Comment by Orhan on 2018-01-25:
I pushed changes from my other private repository, everything works fine there. github.com/cosmicog/apriltags_ros (branch: kinetic-devel)

Comment by Sietse on 2018-01-25:
It works when using this repository!

I tested it on my home machine using Lunar. Will later test some more on kinetic.

Comment by Sietse on 2018-01-25:
Note that the version mentioned in the ros-wiki still has to be corrected.

Comment by Cesare on 2018-02-05:
Eureka! Matx33f -> Matx33d just works ^_^

Comment by Alex Beh on 2018-02-13:
why I cannot find the Matx33d above?

I download the package from https://github.com/xenobot-dev/apriltags_ros .

Comment by Sietse on 2018-02-13:
See my first comment. Use the version from Orhan or patch the version mentioned in the ros-wiki.

Comment by Alex Beh on 2018-02-13:
I am really new to ROS. so just git clone it to my /catkin_ws/src and run catkin_make @ /catkin_ws ?

Comment by Sietse on 2018-02-13:
Basically, yes.

Comment by gvdhoorn on 2018-02-13:
@Alex Beh: please see #q252478.

There is a little more to it.

Comment by Alex Beh on 2018-02-13:
I have successfully install the version from Orhan and rosrun it. But why the problem still come out? Is it because I didn't do calibration of my usb_cam?

Comment by Alex Beh on 2018-02-13:
I think the code executed for Orhan's package in terminal is different from my previous package.

I only know two commands to be executed in terminal, any other commands needed? Terminal 1: roscore Terminal 2: roslaunch apriltagsros example.launch /usbcam_tag.launch Terminal 3: Terminal 4:

$\endgroup$
0
$\begingroup$

Rosanswers logo

Alternatively, a newer version of apriltags is available for kinetic (http://wiki.ros.org/apriltags2_ros).


Originally posted by Nick S with karma: 21 on 2018-02-13

This answer was NOT ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

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