ROVIO

This is a guide to get started with ROVIO. This particular guide will focus on using ROVIO with Intel Realsense D435i.

Warning

This article is still in an experimental and live stage, further information or corrections will be added as and when verified to be true.

1. Prerequisites

  • Docker (follow Step 1 from the Kalibr guide and verify it is working)

2. Building the Docker image

a. Clone the required repositories

We need to clone the ROVIO and Kindr repositories locally first, so we can build it inside the container later.

mkdir -p ~/isro_ws/src
cd ~/isro_ws/src
git clone --recursive https://github.com/SlyPredator/isro_rovio
cd isro_rovio

b. Build the Docker container

Tip

Please adjust -j6 in the Dockerfile, based on your echo $(nproc) output. For example, if it is 8, set it to 5 or 6, if it is 20, set it to 12 or 16.

This will help your system to not crash while building the binaries.

Build the container:

docker compose up -d

This will build the Docker container with:

  • A local bind mount of your isro_rovio folder to catkin_ws/src/isro_rovio inside the container

  • Intel Realsense SDK for ROS1

  • ROVIO binaries built for ROS1

This may take a while to complete, so be patient.

If the command fails with an error, if you see 403 Forbidden in the error trace, add the following line after the second RUN command in the Dockerfile:

RUN echo 'Acquire::http::User-Agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0";' > /etc/apt/apt.conf.d/99useragent

Now run docker compose up -d again, this should fix your issue.

3. Running the container

Firstly run xhost +local:docker to grant screen display permissions to Docker.

Also connect your Intel Realsense camera to a USB port on your system, make sure it is a USB 3.2 port, verify with lsusb -t where you should see an entry under Bus 1 or 2 with several 5000Ms. This verifies that the camera is connected to a high-speed port and can transfer data without latency.

Make sure you’re still inside the isro_ws/src/isro_rovio directory. Run docker start -ai isro_rovio to start the container.

Open up few other terminals and type docker exec -it isro_rovio bash to open multiple terminals inside the container.

Note

No need to run docker start -ai isro_rovio multiple times, if one terminal has started it, the other terminals can use docker exec -it isro_rovio bash to start a new terminal inside the already running container.

Verify Intel Realsense is detected inside the container

Run this command to verify the Realsense camera: realsense-viewer Once it loads up, toggle to the 2D section (button is on top right) and toggle the 3 buttons one by one on the left side to verify each of the modules are working.

Once that is done, source the install files:

source devel/setup.bash 

4. Running ROVIO

Starting up the publishers for camera and IMU

Once all of the above checks are done, we can now proceed to use ROVIO itself.

Use the below tabs to navigate between your choice of sensors:

Realsense Camera publisher

roslaunch realsense2_camera rs_camera.launch \
    enable_color:=true \
    enable_depth:=true

Pixhawk IMU via MAVROS

roslaunch mavros px4.launch fcu_url:=/dev/ttyACM0:115200

Then in a separate terminal, run rosservice call /mavros/set_stream_rate 0 200 1 to set the IMU publishing rate at 200 Hz (or whatever you set the 200 argument to).

Verify the same with rostopic hz /mavros/imu/data_raw to see if the IMU stream is indeed at your desired rate.

Realsense Camera and IMU publisher

roslaunch realsense2_camera rs_camera.launch \
    unite_imu_method:=copy \
    enable_gyro:=true \
    enable_accel:=true \
    enable_color:=true \
    enable_depth:=true
    enable_sync:=true

Running the ROVIO node

Finally, if all of the above have been done correctly, we should now be able get estimated poses from ROVIO. The below command starts up the ROVIO node:

roslaunch rovio rovio_node.launch

You should now see a (yellow) Scene GUI window open up showing you the pose updates from the camera. Verify the /rovio/odometry topic is indeed publishing.

Visualising the odometry from ROVIO as a path

From the /rovio/odometry topic, we can now visualise how our perception unit moves synchronously in the 3D space in RViz. We will be generating a /my_path topic by mapping the odometry from the world frame to the imu frame.

Run the below command to publish the topic:

roslaunch rovio_tools rovio_path.launch

This now creates a topic called /my_path which you can verify publishes at 10 Hz by running rostopic hz /my_path.

Note

In case you want to change the topic name, use the argument out_topic:='new_topic_name' along with the above roslaunch command. Example: You want your new topic name to be my_own_rovio_path. So then the command would be:

roslaunch rovio_tools rovio_path.launch out_topic:='my_own_rovio_path'

While that script is running, open up RViz in a separate terminal and:

  • Change the Fixed Frame topic to world

  • Add a display called Path and it should be reading from the topic that you have created above, in this case, /my_path

Now you should be able to move your perception unit around and see the line materialize in the RViz display corresponding to how you’re moving it in the real world with perhaps very minimal drift.