lidar_camera_calibration icon indicating copy to clipboard operation
lidar_camera_calibration copied to clipboard

Cannot detect aruco markers

Open LiShuaixin opened this issue 6 years ago • 23 comments

Hi, thanks for your sharing. I'm trying to calibrate the velodyne lidar with a Kinect2 camera . But I cannot detect the aruco markers, which makes the program stuck. I tried to run the aruco_mapping node only, and it also dosen't work.

Why the marker cannot be detected? I don't know what's wrong. Please help!!!!!!!!!!!!!!!!!! T T! problem

LiShuaixin avatar Mar 30 '18 17:03 LiShuaixin

Make sure you remap your camera topic to /image_raw, also the size of aruco marker need to be in meters

jediofgever avatar Mar 30 '18 18:03 jediofgever

@jediofgeve thanks for your reply. I checked my launch file and topics, but didn't find the problem. Here is my launch file and rqt_graph of nodes and topics. Could you find what's wrong?
launch_file default

LiShuaixin avatar Mar 31 '18 02:03 LiShuaixin

Here is my .ini file in which my camera intrinsic parameters have been included. All things look fine, but the markers still could not be detected.

`# Prosilica camera intrinsics

[image]

width 1920

height 1080

[prosilica]

camera matrix 1078.7590613742789 0.00000 949.45707686180253 0.00000 1081.0857157086082 529.69624694028789 0.00000 0.00000 1.00000

distortion 0.091093900790104432 -0.14051805018202065 -0.0013933224835513888 -0.0033859633806729498 0.064918028653487753

rectification 1.00000 0.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 1.00000

projection 1078.7590613742789 0.00000 949.45707686180253 0.00000 0.00000 1081.0857157086082 529.69624694028789 0.00000 0.00000 0.00000 1.00000 0.00000

`

LiShuaixin avatar Mar 31 '18 04:03 LiShuaixin

I could not reproduce your issue with both ZED camera and XBOX Kinect. I used your ini file and it successfully detected markers, screenshot from 2018-03-31 13-10-20

maybe rebuilding aruco_mapping package can handle

jediofgever avatar Mar 31 '18 05:03 jediofgever

could you share your launch file with me?

LiShuaixin avatar Mar 31 '18 05:03 LiShuaixin

Yes sure here is my aruco_mapping.launch file contents

<?xml version="1.0"?>

<launch> 
  <!-- <param name="/use_sim_time" value="true"/> -->
  <!-- RVIZ -->
  <!-- <node name="rviz" pkg="rviz" type="rviz" args="-d $(find aruco_mapping)/launch/aruco_config.rviz" /> -->

   <!--   usb_cam node -->
 <!--  <node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen">
    <param name="video_device" value="/dev/video0" />
    <param name="image_width" value="640" />
    <param name="image_height" value="480" />
    <param name="pixel_format" value="mjpeg" />
    <param name="camera_frame_id" value="usb_cam" />
    <param name="io_method" value="mmap"/>
  </node> -->
  
 <!-- <node name="usb_cam" pkg="usb_cam" type="usb_cam_stereo_node" output="screen" >
    <param name="video_device" value="/dev/video1" />
    <param name="image_width" value="2560" />
    <param name="image_height" value="720" />
    <param name="pixel_format" value="yuyv" />
    <param name="camera_frame_id" value="Stereo" />
    <param name="left_camera_name" value="left" />
    <param name="reft_camera_name" value="right" />
    <param name="io_method" value="userptr"/>
    <param name="framerate" value="30" />
 </node>  -->
  <!-- ArUco mapping -->
  <node pkg="aruco_mapping" type="aruco_mapping" name="aruco_mapping" output="screen">
    <remap from="/image_raw" to="/camera/rgb/image_color"/>

    <param name="calibration_file" type="string" value="$(find aruco_mapping)/data/kinect2_right.ini" /> 
    <param name="num_of_markers" type="int" value="2" />
    <param name="marker_size" type="double" value="0.160"/>
    <param name="space_type" type="string" value="plane" />
    <param name="roi_allowed" type="bool" value="false" />
    <!--
    <param name="roi_x" type="int" value="0" /> 
    <param name="roi_y" type="int" value="0" />
    <param name="roi_width" type="int" value="640" /> 
    <param name="roi_height" type="int" value="480" /> 
  -->

  </node>  
 </launch>

jediofgever avatar Mar 31 '18 05:03 jediofgever

Do you have a try with Kinect2? I first launch the kinect2_bridge to publish kinect topics in which 3 different kinds of images with different image size have been published. I choosed the one named /kinect2/hd/image_color_rect whose size is 1920*1080 to remap as /image_raw.

<!-- ArUco mapping -->
 <node pkg="aruco_mapping" type="aruco_mapping" name="aruco_mapping" output="screen">
   <remap from="/image_raw" to="/kinect2/hd/image_color_rect"/>

   <param name="calibration_file" type="string" value="$(find aruco_mapping)/data/kinect2_right.ini" /> 
   <param name="num_of_markers" type="int" value="2" />
   <param name="marker_size" type="double" value="0.50"/>
   <param name="space_type" type="string" value="plane" />
   <param name="roi_allowed" type="bool" value="false" />
   <!--
   <param name="roi_x" type="int" value="0" /> 
   <param name="roi_y" type="int" value="0" />
   <param name="roi_width" type="int" value="640" /> 
   <param name="roi_height" type="int" value="480" /> 
 -->

 </node>  

LiShuaixin avatar Mar 31 '18 05:03 LiShuaixin

can you do a rostopic list while your camera node is running, what else topics do you have ?

The topic I remap is /camera/rgb/image_color

jediofgever avatar Mar 31 '18 05:03 jediofgever

Here is all topics:

/kinect2/bond /kinect2/hd/camera_info /kinect2/hd/image_color /kinect2/hd/image_color/compressed /kinect2/hd/image_color_rect /kinect2/hd/image_color_rect/compressed /kinect2/hd/image_depth_rect /kinect2/hd/image_depth_rect/compressed /kinect2/hd/image_mono /kinect2/hd/image_mono/compressed /kinect2/hd/image_mono_rect /kinect2/hd/image_mono_rect/compressed /kinect2/hd/points /kinect2/qhd/camera_info /kinect2/qhd/image_color /kinect2/qhd/image_color/compressed /kinect2/qhd/image_color_rect /kinect2/qhd/image_color_rect/compressed /kinect2/qhd/image_depth_rect /kinect2/qhd/image_depth_rect/compressed /kinect2/qhd/image_mono /kinect2/qhd/image_mono/compressed /kinect2/qhd/image_mono_rect /kinect2/qhd/image_mono_rect/compressed /kinect2/qhd/points /kinect2/sd/camera_info /kinect2/sd/image_color_rect /kinect2/sd/image_color_rect/compressed /kinect2/sd/image_depth /kinect2/sd/image_depth/compressed /kinect2/sd/image_depth_rect /kinect2/sd/image_depth_rect/compressed /kinect2/sd/image_ir /kinect2/sd/image_ir/compressed /kinect2/sd/image_ir_rect /kinect2/sd/image_ir_rect/compressed /kinect2/sd/points /rosout /rosout_agg

LiShuaixin avatar Mar 31 '18 05:03 LiShuaixin

change /kinect2/hd/image_color_rect to /kinect2/hd/image_color and let us know if that fixes

jediofgever avatar Mar 31 '18 05:03 jediofgever

I have tried all these topics:

/kinect2/hd/image_color
/kinect2/hd/image_color/compressed
/kinect2/hd/image_color_rect
/kinect2/hd/image_color_rect/compressed

But no one could success.

LiShuaixin avatar Mar 31 '18 05:03 LiShuaixin

And here is the problem:

X server found. dri2 connection failed! 
DRM_IOCTL_I915_GEM_APERTURE failed: invalid parameters
Assuming 131072kB available aperture size.
May lead to reduced performance or incorrect rendering.
get chip id failed: -1 [22]
param: 4, val: 0

LiShuaixin avatar Mar 31 '18 05:03 LiShuaixin

This looks like an issue with your cuda installation. I suggest you to reinstall latest CUDA 9.1 as well as latest Nvidia driver (should be 390). you can find how to install CUDA on your machine Here

jediofgever avatar Mar 31 '18 05:03 jediofgever

@jediofgever Thank you for your help. I'll have a try! My nvida driver is the version of 385. Maybe it's too old. But last time when I try to update the graphic driver, my OS broke down. This time I 'll be more careful and when I done that I'll let you know. Thanks again for your help and guidance

LiShuaixin avatar Apr 01 '18 02:04 LiShuaixin

dear @jediofgever, I've installed CUDA under your instruction, but the marker still cannot be detected. I debug the aruco_mapping node, and find that the problem occured after 220 line in aruco_mapping.cpp, which is "Detector.detect(input_image,temp_markers,aruco_calib_params_,marker_size_);" The detect function is the one defined in aruco::MarkerDetector class. What can be the problem occured in this function? If both of the environment for marker detection and the marker itself have some specific requirements?

LiShuaixin avatar Apr 16 '18 08:04 LiShuaixin

I have the same problem with latest master. I cannot detect any Aruco markers (tried with different marker sizes).

dbruggner avatar Apr 18 '18 08:04 dbruggner

@dbruggner Have you tried using aruco detection function in Opencv3? I can detect markers using detectMarkers() function in opencv3, while cannot detect any markers with different marker sizes either.

LiShuaixin avatar Apr 19 '18 01:04 LiShuaixin

@LiShuaixin Have you calibrated lidar+camera successfully with this package, I got the problem that no marker detected too?

panecho avatar Jun 19 '18 09:06 panecho

@LiShuaixin have you been able to detect the markers? I trying the package and also unable to detect anything

tkkhuu avatar Oct 11 '18 19:10 tkkhuu

@jediofgever i am sorry to ask question here.Please forgive me ,is it necessary to install CUDA9.1 before trying to use aruco_ros package?Thank you~

14212094 avatar Apr 09 '19 14:04 14212094

@dbruggner Have you tried using aruco detection function in Opencv3? I can detect markers using detectMarkers() function in opencv3, while cannot detect any markers with different marker sizes either.

Have you been able to detect the markers? I trying the package and also unable to detect anything

ericzzj1989 avatar Oct 17 '19 02:10 ericzzj1989

Hi, @LiShuaixin . Have you been able to detect the markers? I trying the package and also unable to detect anything

ericzzj1989 avatar Oct 17 '19 07:10 ericzzj1989

You MUST have significant white border around each marker. The right one doesn't have any. The left one probably has insufficient border (the bottom side).

adugin avatar Nov 03 '19 12:11 adugin