arpg / vicalib

Visual-Inertial Calibration Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CALIBRATION NOT WORKING using REALSENSE2 DRIVER

leocorp96 opened this issue · comments

Hello I have been trying for a while now to get the pose and orientation of my realsense cameras (d415) from VICALIB but to no avail.

I have tried with both SMALL and MEDIUM sized patterns and still nothing. It just keeps outputting the detection matrix alongside a text saying pattern not found.

Please advice on what else I can try to get this to work. It's kinda URGENT!!
Thanks.

When you say you've tried both small and medium patterns, do you mean you've printed and used both small and medium, or you've used the -grid_preset argument with both small and medium? (Also, note that the names are case sensitive, -grid_preset=SMALL won't do anything.) There's also a letter size grid.

@JStech
Yes I meant I have printed and tried both patterns.
And yes I only wrote the names in caps to highlight a point.

Now then, any solutions you can suggest ??

What platform(s) are you using? (Although it's supposed to be fixed, there's been an issue with generating targets on one platform and then looking for them on another: arpg/Calibu#51)

I'm running on Ubuntu 16.04

Hmm, the only other thing I can think of is that the target should occupy a significant portion of the image, and not be viewed at too sharp of an angle (so keep it within ~60 degrees of the normal).

Someone else from the lab might have more ideas, but I'm guessing they're not up yet. It's only 7am here in Colorado.

Hello @crheckman , @JStech :
So I finally got VICALIB to compute and output the "camera.xml", after re-starting and re-printing new patterns (turns out I might have had a scaled pattern).

But I am faced with another issue regarding the "poses". I would be glad if someone can help me interpret the values in the <T_wc></T_wc> tag.

I am working with ROS and would like to input the computed orientations and/ or translation in my URDF file so as to better align my POINTCLOUDS.

Thank you.

This sounds like the RDF convention issue that @1988kramer fixed in fix/T_sc. I forget the exact manual fix, but it requires permuting the rows (or columns?) of the rotation matrix part of the transformation. Alternatively, you could switch to the fix/T_sc branch and run the calibration again.

@JStech I will do that and post my findings afterwards. Thanks

Hello @crheckman , @JStech :
After checking out the fix/T_sc: I keep getting a segmentation fault error when running the calibration. However the "camera.xml" gets generated but still has the <T_wc></T_wc>. Nothing seems to be different. It also turns out that passing the [size] parameter to my driver has absolutely no effect whatsoever.
This is the command I am using for 2 realsense cameras (d415)
vicalib -grid_preset small -cam convert://realsense2:[size=1280x720,rgb=1,ir=0,depth=1]

I guess I misunderstood your question. The T_wc transformation is the IMU-to-camera transform (the camera's pose in the IMU frame). If you use the --save_poses flag, vicalib will output the sequence of poses (world-to-IMU) it calculates during the calibration.

Your camera URI should have another // at the end. Besides that, I'll add that I've run into issues with the realsense2 driver in HAL recently, and so I run it through ROS and use the ros driver to read the appropriate ROS topics.

@JStech, running vicalib using a rostopic is something I would like to try out also. Can you share the terminal command on how you are doing this?

Regarding the T_wc transformation, if you have per chance ever used these parameters, could you show me how?. The issue is I have two cameras side by side at a distance and I would like a way to interpret the T_wc transformation to Euler angles so I can pass them into my URDF file and hopefully have my pointclouds well aligned?

The permutation operation you mentioned in your earlier post, can you maybe share some light on that?
Thanks.

Here's the HAL URIs for reading sensors through ROS: -cam ros:[topics=/camera/infra1/image_rect_raw,sizes=640x480]// -imu ros_imu:[topic=/imu_raw]//. (If you want multiple camera topics, join them with +.)

I use the T_wc in our visual-inertial odometry, where it just gets copied into the configuration. It sounds like you're trying to get the camera-to-camera transform. It's been a while since I did a stereo calibration, but I think vicalib will output two transforms (both called T_wc?). Without an IMU, one will be the identity, so the other will be the camera-to-camera transform. These are 4x3 matrices that transform homogenous points in one frame into non-homogenous points in the other. (Or, just think of them as a 3x3 rotation matrix with a 3x1 translation appended on the right). You can extract Euler angles from the rotation matrix in the normal way.

At this point, I believe the software is working correctly. I'm closing this issue.

I use realsense2 in HAL still rather than ROS, so I think that still works...

As for the URI, the size command should be sent through convert ideally, not the realsense2 driver.

@crheckman I believe an example URI (passing the size through convert) will go a long way...
Thanks.