HKUST-Aerial-Robotics / VINS-Mono

A Robust and Versatile Monocular Visual-Inertial State Estimator
GNU General Public License v3.0
4.99k stars 2.1k forks source link

Using true depth with VINS-Mono #215

Open yukti-nxg opened 6 years ago

yukti-nxg commented 6 years ago

I have an RGBD camera (Intel Realsense d435). VINS-Mono works well with this camera and a synced IMU, but in case of track lost I observed errors in scale-estimation. I guess this can be resolved using the synced depth images from the sensor. I tried a few hacks but it did not work. Can you give me a few tips as to what changes I should make in the code? Thanks.

mzahana commented 6 years ago

@yukti-nxg Hi. I have D435 as well, but I am not sure how to sync the depth and IMU and use it with VINS MONO. Can you please give some hints? Thanks.

RigerLee commented 6 years ago

I recommend message_filters for sync. Substitute ros::Subscriber sub_img = n.subscribe(IMAGE_TOPIC, 100, img_callback); in feature_tracker_node by message_filters::Subscriber<sensor_msgs::Image> color_sub(n, IMAGE_TOPIC, 1); message_filters::Subscriber<sensor_msgs::Image> depth_sub(n, DEPTH_TOPIC, 1); message_filters::TimeSynchronizer<sensor_msgs::Image, sensor_msgs::Image> sync(color_sub, depth_sub, 100); sync.registerCallback(boost::bind(&img_callback, _1, _2)); (I modified img_callback for depth transmission.) And then you could do futher modification.

jackyfriend commented 5 years ago

@yukti-nxg Hi, I use Realsense D435 too, I'm wandering how to add a synced IMU with d435's color image, could you give me some advices? Thank you!