ankitdhall / lidar_camera_calibration

ROS package to find a rigid-body transformation between a LiDAR and a camera for "LiDAR-Camera Calibration using 3D-3D Point correspondences"
http://arxiv.org/abs/1705.09785
GNU General Public License v3.0
1.49k stars 460 forks source link

Cannot detect aruco markers #41

Open LiShuaixin opened 6 years ago

LiShuaixin commented 6 years ago

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

jediofgever commented 6 years ago

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

LiShuaixin commented 6 years ago

@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 commented 6 years ago

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

`

jediofgever commented 6 years ago

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

LiShuaixin commented 6 years ago

could you share your launch file with me?

jediofgever commented 6 years ago

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>
LiShuaixin commented 6 years ago

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>  
jediofgever commented 6 years ago

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

The topic I remap is /camera/rgb/image_color

LiShuaixin commented 6 years ago

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

jediofgever commented 6 years ago

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

LiShuaixin commented 6 years ago

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 commented 6 years ago

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
jediofgever commented 6 years ago

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

LiShuaixin commented 6 years ago

@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 commented 6 years ago

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_calibparams,markersize);" 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?

dbruggner commented 6 years ago

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

LiShuaixin commented 6 years ago

@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.

panecho commented 6 years ago

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

tkkhuu commented 5 years ago

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

14212094 commented 5 years ago

@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~

ericzzj1989 commented 4 years ago

@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 commented 4 years ago

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

adugin commented 4 years ago

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).