Tip
Repository for this module: https://github.com/SmartArmStack/sas_datalogger
More information about SmartArmStack is available at https://smartarmstack.github.io/.
mkdir -p ~/sas_datalogger/docker/sas_datalogger_example
cd ~/sas_datalogger/docker/sas_datalogger_example
curl -OL curl -OL https://raw.githubusercontent.com/SmartArmStack/sas_datalogger/refs/heads/jazzy/docker/sas_datalogger_example/compose.yml
docker compose upImportant
To stop, press Ctrl + C. Do not forget to remove the containers:
docker compose down -vThe saved .mat file will be located at ~/sas_datalogger/docker/sas_datalogger_example/logs.
This package provides a datalogger server and suitable client APIs in C++ and
Python. Each node is launched through its own launch file, which loads
parameters from config/config.yaml (pass a different file with
config_file:=/path/to/config.yaml).
| Property | Value |
|---|---|
| Executable | sas_datalogger_node.py |
| ROS node name | sas_datalogger (set by the name launch argument of sas_datalogger_launch.py) |
| Description | Main datalogger node. Subscribes to /sas_datalogger/log and stores received values in memory. When the node is shut down it saves the collected data to a MATLAB-compatible .mat file (via scipy.io.savemat). |
The server declares no ROS parameters — it subscribes to the fixed topic /sas_datalogger/log.
ros2 launch sas_datalogger sas_datalogger_launch.py| Property | Value |
|---|---|
| Executable | sas_datalogger_gui_node.py |
| ROS node name | sas_datalogger_gui_node (set by the name launch argument of sas_datalogger_gui_launch.py) |
| Description | A Qt-based GUI that reads the datalogger's internal dictionary and creates execution-time plots for numeric values. |
| Parameter | Type | Mandatory / Optional | Default | Purpose |
|---|---|---|---|---|
whitelist |
string array | Optional | [' '] |
List of values to plot. The single-space entry [' '] is the package convention for "plot all values" (the node maps it to None) |
ros2 launch sas_datalogger sas_datalogger_gui_launch.pyTo plot only specific values:
ros2 launch sas_datalogger sas_datalogger_gui_launch.py config_file:=/path/to/config.yaml| Property | Value |
|---|---|
| Executable | sas_datalogger_client_example |
| ROS node name | sas_datalogger_client_example (set by the name launch argument of sas_datalogger_client_cpp_example_launch.py) |
| Description | C++ example client. Publishes matrices, vectors, scalars and strings to the datalogger topic. |
The C++ example client declares no ROS parameters.
ros2 launch sas_datalogger sas_datalogger_client_cpp_example_launch.py| Property | Value |
|---|---|
| Executable | sas_datalogger_client_example_py.py |
| ROS node name | sas_datalogger_client_example_py_rclpy (fixed in the script; the script creates two nodes, so no name launch argument is set) |
| Description | Python example client. Publishes matrices, vectors, scalars and strings to the datalogger topic. |
| Parameter | Type | Mandatory / Optional | Default | Purpose |
|---|---|---|---|---|
execution_times |
integer | Optional | 5 |
How many times the example logs the sample values |
ros2 launch sas_datalogger sas_datalogger_client_python_example_launch.pyNote
The Python example client executable creates two nodes (an rclcpp node and
an rclpy node). The execution_times parameter is declared on the rclpy node,
whose fixed code name is sas_datalogger_client_example_py_rclpy; the
corresponding block in config/config.yaml is keyed by that name.