Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Openvslam + ROS + stereo #515

Open
kevkid opened this issue Jan 15, 2021 · 5 comments
Open

Openvslam + ROS + stereo #515

kevkid opened this issue Jan 15, 2021 · 5 comments

Comments

@kevkid
Copy link

kevkid commented Jan 15, 2021

Is there a way for me to use openvslam for a sets of image pairs as if it were a stereo camera? For example if I have a left image and a right image, can I use these two images as a stereo image and run openvslam on it? Would I be able to do this with the ros wrapper?

@dimaxano
Copy link

Generally, yes, you can do SLAM on stereo images with openvslam (images should be prerectified and undistorted or you need intrinsic and extrinsic camera system parameters to do that). But it is currently not implemented in ROS wrapper, but you can do it yourself following this example

@mirellameelo
Copy link

Hi. The SLAM system uses a stereo pair of images to estimate depth, and then, map. To estimate it, a triangulation step is necessary, which requires the images to be rectified. So, are your cameras horizontally aligned with each other? Are the baseline (the distance between the lens) constant? Is the resolution the same for both images? Do they have the same opening angle? If it not, then you have to "prepare" your images before use them as input to Openvslam system.

@kevkid
Copy link
Author

kevkid commented Jan 18, 2021

Hi. The SLAM system uses a stereo pair of images to estimate depth, and then, map. To estimate it, a triangulation step is necessary, which requires the images to be rectified. So, are your cameras horizontally aligned with each other? Are the baseline (the distance between the lens) constant? Is the resolution the same for both images? Do they have the same opening angle? If it not, then you have to "prepare" your images before use them as input to Openvslam system.

All excellent questions. I will be taking the necessary steps to preprocess them. But it looks like the ros wrapper does not have stereo implemented :(

@kevkid
Copy link
Author

kevkid commented Jan 18, 2021

Generally, yes, you can do SLAM on stereo images with openvslam (images should be prerectified and undistorted or you need intrinsic and extrinsic camera system parameters to do that). But it is currently not implemented in ROS wrapper, but you can do it yourself following this example

Thank you, I will give this a try!

@mirellameelo
Copy link

mirellameelo commented Jan 18, 2021

@kevkid
Basically what I had to do in order to use my stereo camera was to add a new condition for the stereo setup, such as:
https://github.com/mirellameelo/rtabmap_openvslam/blob/7be49f95229691bc4e0d44057dd2da8d5276f231/ros/2/src/openvslam/src/run_slam.cc#L382

Subscribe not one, but the two images (I'm considering they are synchronized), such as:
https://github.com/mirellameelo/rtabmap_openvslam/blob/7be49f95229691bc4e0d44057dd2da8d5276f231/ros/2/src/openvslam/src/run_slam.cc#L256

And call "feed_stereo_frame" instead of "feed_monocular_frame", such as:
https://github.com/mirellameelo/rtabmap_openvslam/blob/7be49f95229691bc4e0d44057dd2da8d5276f231/ros/2/src/openvslam/src/run_slam.cc#L158

EDIT: the code above was used for another purpose, I used it in here as an example to suggest a flow, but I'd recommend you to extend these steps from the base code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants