Product
8 min read

Automate Your Data Analysis with Roboto Actions

Discover how Roboto Actions can automate your robotics data analysis with a guided example.
Written by
Yves Albers
Published
May 6, 2025

Introduction

As robot deployments scale, the volume of log data can quickly become overwhelming. Even a relatively small fleet can produce terabytes of logs every day. In most cases, this data goes unreviewed unless a clear failure occurs. This creates a risky blind spot — latent issues can go undetected and may eventually compromise system reliability or operational safety.

In this post, we show how to automate log analysis using Actions, Triggers and Events in Roboto. We'll walk through a practical example: detecting magnetometer interference in drone logs. This type of interference can cause unstable yaw estimates and impact flights.

By automating this analysis, robotics teams can proactively identify issues and catch regressions after software updates. Whether you're a developer looking to streamline your workflow or an engineering leader focused on system reliability, this post shows how Roboto enables log-driven insights with minimal overhead.

The Case for Automation

Robotics teams typically work with binary log formats like rosbags or parquet files that contain dozens of separate streams of sensor data and algorithm outputs. This data might be generated by hardware components like IMUs, motors, batteries and cameras, or by software components responsible for behaviors like motion planning, navigation and perception. As a result, these logs can be remarkably complex, and are often only decipherable by a small group of domain experts in a company.

As this volume of log data grows, it quickly becomes unfeasible for these experts to manually review it all — especially while they’re busy building new functionality. In our experience, a lack of automated tooling means logs only get reviewed when something breaks. Unfortunately, potential issues in the rest of the logs go unnoticed — leading to missed opportunities for early detection and resolution.

With Roboto Actions, you can run custom analysis code on all logs automatically. This ensures no latent issues get missed and important checks and tribal knowledge don’t get lost. You can also use Actions to detect anomalies, generate and monitor derivative metrics, and create custom reports.

Preparation

To follow along, start by setting up your environment:

You can find the full code for this example on GitHub.

Magnetometer Stability in Drone Flights

In this example, we will create a Roboto Action that checks the stability of a drone’s magnetometer signal. Specifically, we compute the norm of the magnetic field vector (x, y, z) and verify that it stays within an expected range during flight.

A highly variable norm may indicate magnetic interference, which can result in incorrect yaw estimates and unstable flight behavior. If the norm exceeds a defined threshold, we want to create a Roboto Event that highlights the relevant time period. We’ll also tag the file so it gets flagged for further review.

After we’ve made the Action, we’ll create a Trigger to ensure the analysis is run automatically on any new PX4 drone log (.ulg) that gets ingested.

Create a Roboto Action

With the Roboto CLI installed, we can initialize a new Action package with:

roboto actions init


The command will ask which template we want to use, either a (1) Generic Action or a (2) Python Action. Select (2) Python Action.

Select a template
    1 - Roboto Generic Action (A Generic Roboto Action Package)
    2 - Roboto Python Action (A Roboto Action Python Package)
    Choose from [1/2] (1): 2


We’ll give our Python Action a name and populate the other fields accordingly:

  [1/4] project_name: check_magnetometer_norm
  [2/4] author: Yves Albers
  [3/4] description: A Python Action that analyzes magnetometer stability in flights
  [4/4] initialize_git_repo [y/n]: y

Check the Magnetometer Signal

With our package initialized, we can write analysis code in the __main__.py file under src

from roboto import ActionRuntime, Event, EventDisplayOptions
from check_magnetometer_norm.utils import identify_mag_norm_spikes
import numpy as np

runtime = ActionRuntime.from_env()
inputs = runtime.get_input()

for file, path in inputs.files:
    topic = file.get_topic("sensor_mag")
    mag_df = topic.get_data_as_df(["x", "y", "z"])
    mag_norm = np.linalg.norm(mag_df[["x", "y", "z"]].values, axis=1)

    if mag_norm.std() > 0.05 * mag_norm.mean():
        file.put_tags(["mag_unstable", "needs_review"])


Note that we use the topic.get_data_as_df() method from the Roboto SDK to efficiently fetch the magnetometer data (sensor_mag) into a Pandas DataFrame. No data unpacking or parsing required.

We also use the file.put_tags() function to tag the log if it has a magnetometer issue so we can find it again later. Tagging the file also makes it easier to aggregate occurrences later so we can determine how often the issue happens and how widespread it is.

Highlight Important Periods with Events

We can highlight the time periods in the log where the magnetometer was unstable using Roboto Events. Each Event includes a start and end time and can be associated with specific entities like Files and Topics.

We use a sliding window approach to detect spikes and highlight these with the Event.create() function:

    mag_norm_spikes = identify_mag_norm_spikes(mag_df)

    for start_time, end_time in mag_norm_spikes:
        
        Event.create(
            start_time=start_time,
            end_time=end_time,
            name="mag_unstable",
            description="Magnetometer norm spike",
            topic_ids=[topic.topic_id],
            display_options=EventDisplayOptions(color="red")
        )


You can find the code for the identify_mag_norm_spikes() function in the example repo.

Deploy Action to Roboto

Once we’ve finished writing our Python Action, we need to build it and deploy it to Roboto. You can use the helper scripts that were generated when we initialized the package earlier:

./scripts/setup.sh
./scripts/build.sh
./scripts/deploy.sh


Note, the build script requires Docker installed locally.

Run Action in Roboto

With our new Action deployed to Roboto, we can manually invoke it on a log file to test it.

After it finishes, we should see the log file get tagged and confirm the Events were created and associated with the magnetometer data.

Automate Action with a Trigger

In Roboto, Actions can be made to run automatically when new files get uploaded or ingested by creating a Trigger.

In the video below, we show how to create a Trigger that runs our Action on PX4 drone logs (.ulg) once they’ve been ingested. This ensures we can access the magnetometer topic data with the Roboto SDK.

Once the Trigger has been created, we can upload new log files to a Dataset and watch them get ingested and then processed by our check_magnetometer_norm Action.

Conclusion

In this post, we created a Roboto Action to detect unstable magnetometer readings in PX4 drone logs. With just a few lines of code, you can efficiently retrieve log data as Pandas DataFrames, compute metrics, and automatically tag and annotate data when issues are detected.

By configuring a Trigger, we could then run our Action on every new log automatically — no manual intervention required.

Reach out to us if you'd like to learn more or try it yourself!