Skip to content

Testing & Telemetry

Albert Wang edited this page May 10, 2025 · 1 revision

Testing & Telemetry

A critical aspect of developing for Driverless is logging and visualizing real-time data from either physical sensors or the simulation. MFE Driverless utilizes a combination of Foxglove and an open WebSocket within our Docker containers to visualize data coming from our ROS2 DDS. The following page describes the procedure required to set this up on your computer, and a routine to boot up the setup quickly for efficient testing.

Prerequisites

  • Foxglove for your OS of choice
  • Docker (Docker Desktop/Docker CLI)
  • MFE-Driverless-V1 cloned in your local environment

How Telemetry Works

Conventionally, ROS2 is developed using Ubuntu/Linux with RViz and OSRF toolkits. However, to remain OS-agnostic, we use Docker containers with a fresh Ubuntu environment such that ROS2 code can run on any OS environment. In each of our Docker containers already includes apt-get install lines that install the necessary WebSocket packages for Foxglove to look into the Docker containers. The Dockerfile will then open a port and the bridging scripts for the socket to open up. Our Docker containers are configured to work on your computer's host network, therefore, any running ROS2 instance in a Docker container will also be running on your OS's local network environment. This allows ROS2's DDS layer to transport information to Foxglove for telemetry. The following diagram visualizes the full process:

Foxglove Flowchart

Setup

Upon launching the development environment, you should have access the internals of the Docker container. You will need two terminal instances, one running a WebSocket which enables Foxglove to inspect data from within the container, and another to run ROS code. If you don't know how to configure and set up the development environment. Refer to the guide here.

To launch a WebSocket with a specific port, execute the command:

# Template 
ros2 launch foxglove_bridge foxglove_bridge_launch.xml port:=<port_number>
# Example
ros2 launch foxglove_bridge foxglove_bridge_launch.xml port:=8765

To build and launch ROS code, use the following script

./build_and_launch.sh

# Example usage
./bulld_and_launch.sh

=== Sourcing ROS 2 base (humble) ===

=== Skip Packages ===
Enter packages to skip (space-separated, or leave empty for none): mfe_simulation 

=== Build Options ===
1) Build workspace
2) Skip build (use existing install)
Enter choice [1/2]: 2
Skipping build step.

=== Sourcing workspace overlay ===

=== Select a launch file to run ===
 2) lidar_cone_detector/lidar_pipeline.launch.py
 1) vision_cone_detector/vision_pipeline.launch.py
Enter launch choice: 1

If you have any questions, look through the rest of the wiki or email your lead!

Clone this wiki locally