rpng / open_vins

An open source platform for visual-inertial navigation research.
https://docs.openvins.com
GNU General Public License v3.0
2.06k stars 615 forks source link

Setting up D435i for OpenVins #400

Closed Genozen closed 7 months ago

Genozen commented 7 months ago

Hello. First, thank you for maintaining this repo and actively helping out everyone.

I'm a newer learner for using ROS 2 and OpenVins...

I would like to run real-time RealSense D435i Stereo with the OpenVins SLAM. And I have read through most of the issue pages.

I'm still a little confused on how to get OpenVins to subscribe to my camera topics correctly...

This is the subscribe node from msckf:

Terminal 1
ros2 launch ov_msckf subscribe.launch.py

Terminal 2
ros2 node info /ov_msckf/run_subscribe_msckf 
/ov_msckf/run_subscribe_msckf
  Subscribers:
    /cam0/image_raw: sensor_msgs/msg/Image
    /cam1/image_raw: sensor_msgs/msg/Image
    /imu0: sensor_msgs/msg/Imu
    /parameter_events: rcl_interfaces/msg/ParameterEvent

This is the topics from D435i:

ros2 topic list
/camera/camera/color/camera_info
/camera/camera/color/image_raw
/camera/camera/color/metadata
/camera/camera/depth/camera_info
/camera/camera/depth/color/points
/camera/camera/depth/image_rect_raw
/camera/camera/depth/metadata
/camera/camera/extrinsics/depth_to_color
/camera/camera/extrinsics/depth_to_depth

Do I just need to do some sort of remapping in the launch file?

Or I must do the Kalibr tutorial first, which generates a bunch of configs, and this will then be automatically configured in the subscriber launch? Just looking for more step by step details...

Genozen commented 7 months ago

Also, side note:

Just for fun, I tried using the rs_d455 config, but had an error. The rs_t265 launches with no problem.

ros2 launch ov_msckf subscribe.launch.py config:=rs_d455
[INFO] [launch]: All log files can be found below /home/ascent/.ros/log/2023-11-17-22-23-19-318862-ascent-128932
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [run_subscribe_msckf-1]: process started with pid [128933]
[INFO] [rviz2-2]: process started with pid [128935]
[rviz2-2] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[run_subscribe_msckf-1] overriding node verbosity with value from ROS!
[run_subscribe_msckf-1] Setting printing level to: INFO
[ERROR] [run_subscribe_msckf-1]: process has died [pid 128933, exit code -11, cmd '/home/Genozen/Desktop/workspace/install/ov_msckf/lib/ov_msckf/run_subscribe_msckf --ros-args -r __ns:=/ov_msckf --params-file /tmp/launch_params_vndi1kkb --params-file /tmp/launch_params_dn1ne2d0 --params-file /tmp/launch_params_nsfuf5w7 --params-file /tmp/launch_params_uakjeapj --params-file /tmp/launch_params_9lk0ftz9']
goldbattle commented 7 months ago

You need to specify only to use a single camera instead of the default two. The default config is for just running monocular on the RGB camera of the D455.

Hope this issue will help you: https://github.com/rpng/open_vins/issues/388

goldbattle commented 7 months ago

RE; Your original question about the topics, you should be able to use the Kalibr output files direction. You should be able to specify the topic in the camchain.yaml to just be /camera/camera/color/image_raw directly (but you really should be able to directly use the one from Kalibr).

You might try following this walk through video: https://youtu.be/rBT5O5TEOV4?si=h8XTEXlX93-rwEEP&t=2107

Genozen commented 7 months ago

Going through the Kalibr tutorial works! I will probably post an overall setup with ROS2. Thank you

marcoleg commented 2 weeks ago

Hi @Genozen, I'm struggling with OpenVINS with a D435i Realsense on ROS2. After initialisation my camera starts to drift. Could you share your ROS2 setup?