Sometimes you would rather analyze a rosbag in MATLAB rather than within the ROS environment. This page describes how to set up the Matlab infrastructure and includes a script example.
The following steps provide the parsing setup:
- Type roboticsAddons and install the Robotics System Toolbox Interface for ROS Custom Messages
- Copy custom package(s) to a standalone folder
- Check messages for redundant variables
- Run rosgenmsg(folderpath) where folderpath is the path to the standalone folder above our custom packages
- Follow directions in Matlab for editing javaclasspath.txt, adding the message to the path, restarting Matlab, and verifying success via rosmsg list
Basic rosbag parsing is as follows:
rosbag(filepath)on the rosbag file of interest
- Select only the topic of interest with
- For straightforward values in a message, run
- For more complicated messages, run
This script parses Rosbags and creates a
.csv file from it given a custom definition. The particular message referenced is an aggregation of multiple messages, hence the recursive structure.