ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
1

ros-kinetic-opencv3 and apriltags regression?

asked 2017-12-20 05:40:48 -0500

Sietse gravatar image

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].
edit retag flag offensive close merge delete

Comments

I have the same problem . Any idea?

pinxian gravatar imagepinxian ( 2017-12-24 23:55:13 -0500 )edit

I'm having a similar issue. Has anyone found a solution?

dpoiesz gravatar imagedpoiesz ( 2018-01-16 11:05:58 -0500 )edit

I am facing the same issue.

ashwinvk94 gravatar imageashwinvk94 ( 2018-01-19 05:47:33 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
3

answered 2018-01-22 10:18:15 -0500

Orhan gravatar image

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)

edit flag offensive delete link more

Comments

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?

Sietse gravatar imageSietse ( 2018-01-25 07:03:17 -0500 )edit

I pushed changes from my other private repository, everything works fine there. github.com/cosmicog/apriltags_ros (branch: kinetic-devel)

Orhan gravatar imageOrhan ( 2018-01-25 07:39:26 -0500 )edit

It works when using this repository!

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

Sietse gravatar imageSietse ( 2018-01-25 13:54:39 -0500 )edit
1

Note that the version mentioned in the ros-wiki still has to be corrected.

Sietse gravatar imageSietse ( 2018-01-25 16:15:33 -0500 )edit

Eureka! Matx33f -> Matx33d just works ^_^

Cesare gravatar imageCesare ( 2018-02-05 11:13:24 -0500 )edit

why I cannot find the Matx33d above?

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

Alex Beh gravatar imageAlex Beh ( 2018-02-13 02:37:18 -0500 )edit

See my first comment. Use the version from Orhan or patch the version mentioned in the ros-wiki.

Sietse gravatar imageSietse ( 2018-02-13 02:58:21 -0500 )edit
1

I am really new to ROS. so just git clone it to my /catkin_ws/src and run catkin_make @ /catkin_ws ?

Alex Beh gravatar imageAlex Beh ( 2018-02-13 03:19:15 -0500 )edit
2

answered 2018-02-13 03:02:13 -0500

Nick S gravatar image

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2017-12-20 05:40:48 -0500

Seen: 984 times

Last updated: Feb 13