Using Stereo Vision With Gazebo

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Using Stereo Vision With Gazebo

Jim Rothrock
I am trying to use RTAB-Map ROS with a stereo camera pair simulated in Gazebo. I'm passing --uinfo to the rtabmap node, and the node keeps printing these error messages:

[ERROR] (2020-05-09 12:25:44.055) Memory.cpp:4015::createSignature() Camera calibration not valid, calibrate your camera!
[ERROR] (2020-05-09 12:25:44.055) Memory.cpp:788::update() Failed to create a signature...

I created calibration YAML files for both cameras, and $HOME/.rtabmap/rtabmap.ini contains a reference to the right one, but I still get the errors.
Reply | Threaded
Open this post in threaded view
|

Re: Using Stereo Vision With Gazebo

matlabbe
Administrator
Can you show both calibration files? Note that rtabmap_ros doesn't use parameters in ~/.rtabmap/rtabmap.ini, this file is used by the standalone version. Can you show the left and right camera_info topics published by Gazebo?
Reply | Threaded
Open this post in threaded view
|

Re: Using Stereo Vision With Gazebo

Jim Rothrock
calib_left.yaml:

%YAML:1.0
---
camera_name: calib_left
image_width: 640
image_height: 480
camera_matrix:
   rows: 3
   cols: 3
   data: [ 3.8136250000000001e+02, 0., 3.2050000000000000e+02, 0.,
       3.8136250000000001e+02, 2.4050000000000000e+02, 0., 0., 1. ]

calib_right.yaml:

%YAML:1.0
---
camera_name: calib_right
image_width: 640
image_height: 480
camera_matrix:
   rows: 3
   cols: 3
   data: [ 3.8136250000000001e+02, 0., 3.2050000000000000e+02, 0.,
       3.8136250000000001e+02, 2.4050000000000000e+02, 0., 0., 1. ]
projection_matrix:
   rows: 3
   cols: 4
   data: [ 3.8136250000000001e+02, 0., 3.2050000000000000e+02,
       -1.5729372584999999e+02, 0., 3.8136250000000001e+02,
       2.4050000000000000e+02, 0., 0., 0., 1., 0. ]

Left camera info:

header:
  seq: 16
  stamp:
    secs: 40
    nsecs: 110000000
  frame_id: "scout_1_tf/left_camera_optical"
height: 480
width: 640
distortion_model: "plumb_bob"
D: [0.0, 0.0, 0.0, 0.0, 0.0]
K: [381.36246688113556, 0.0, 320.5, 0.0, 381.36246688113556, 240.5, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [381.36246688113556, 0.0, 320.5, -157.29401728003162, 0.0, 381.36246688113556, 240.5, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 0
binning_y: 0
roi:
  x_offset: 0
  y_offset: 0
  height: 0
  width: 0
  do_rectify: False

Right camera_info:

header:
  seq: 20
  stamp:
    secs: 98
    nsecs: 760000000
  frame_id: "scout_1_tf/right_camera_optical"
height: 480
width: 640
distortion_model: "plumb_bob"
D: [0.0, 0.0, 0.0, 0.0, 0.0]
K: [381.36246688113556, 0.0, 320.5, 0.0, 381.36246688113556, 240.5, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [381.36246688113556, 0.0, 320.5, -157.29401728003162, 0.0, 381.36246688113556, 240.5, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 0
binning_y: 0
roi:
  x_offset: 0
  y_offset: 0
  height: 0
  width: 0
  do_rectify: False
Reply | Threaded
Open this post in threaded view
|

Re: Using Stereo Vision With Gazebo

Jim Rothrock
In reply to this post by matlabbe
> Note that rtabmap_ros doesn't use parameters in ~/.rtabmap/rtabmap.ini,

How do I tell the rtabmap node where to look for camera calibration files?
Reply | Threaded
Open this post in threaded view
|

Re: Using Stereo Vision With Gazebo

matlabbe
Administrator
rtabmap node subscribes to to camera info.

The error is coming from here:
if(!data.depthOrRightRaw().empty() &&
   data.cameraModels().size() == 0 &&
   !data.stereoCameraModel().isValidForProjection() &&
   !pose.isNull())
{
   UERROR("Camera calibration not valid, calibrate your camera!");
   return 0;
}
In your left camera_info, P(0,3) should be 0, not -157.29401728003162


Reply | Threaded
Open this post in threaded view
|

Re: Using Stereo Vision With Gazebo

Jim Rothrock
Thank you!