getting openvins up and running with ros2

notes on getting stuff running

Quickstart

Following the installation instructions for installing OpenVINS with ROS 2 . Following the ROS 2 for installing OpenVINS with ROS 2 . OpenVINS tutorial for running on EuRoC dataset. Running RViz using ROS 2 instead of ROS1. Note that simply running rviz from the command line like for ROS 1 will not work. Instead, do not install anything extra and run

Specifically for the EuRoC example from OpenVINS,

ros2 run rviz2 rviz2 -d /home/vassili/projects/openvins_workspace/catkin_ws_ov/src/open_vins/ov_msckf/launch/display_ros2.rviz

where the global path is used (for now), since relative paths didn’t seem to be able to find the display file. Checking the ROS 2 guide for RViz is handy.
Then, as per the OpenVINS documentation,

ros2 launch ov_msckf subscribe.launch.py config:=euroc_mav
ros2 bag play V1_01_easy.db3

which are to be run in different terminals.

VS Code Intellisense for ROS

To have the IntelliSense working for Python ROS packages, such as launch files, make sure to run VS Code as code from a terminal where the ROS setup has been sourced. Source. Furthermore, even though ROS installs its own versions of Eigen and OpenCV, I found that I had to install them separately to be able to point VS Code’s includePath to their libraries and have IntelliSense work properly.

sudo apt install libeigen3-dev
sudo apt install libopencv-dev

After which the following cpp_properties.json file does the trick,

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**", 
                "/usr/local/include/Eigen/**", 
                "/usr/include/opencv4/**", 
                ""/opt/ros/humble/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c17",
            "cppStandard": "gnu++17",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

There is also the following guide for using VS Code with ROS 2 and Docker.

Evaluation

We now run the EuRoC dataset such that we can do the full algorithm evaluation.

colcon build
source install/setup.bash # from workspace directory
ros2 launch ov_msckf subscribe.launch.py config:=euroc_mav # from workspace directory
ros2 bag play V1_01_easy.db3 # from data bag directory
ros2 launch ov_eval record.launch.py  # from workspace directory

Debugging:

ros2 node info /pose_to_file # check that subscription is actually created