This is a Source plugin for MADS.
This plugin allows to replay in MADS a CSV log file. It reads a CSV file and produces a JSON message for each line.
The CSV header line is interpreted as a list of keypaths. For example, if a column is /IMU/0/accel/x (notice the mandatory leading slash), the corresponding value gets into the JSON object {"IMU": [{"accel": {"x": 123.456}}]}.
An alternative keypaths syntax uses slashes as separators. For example, /IMU/0/accel/x can also be written as IMU[0].accel.x. Note that this sytax is less efficient and mostly supported for compatibility reasons.
A MADS message is emitted for each line, at a frequency set by the agent period (from command line -p or from INI file)
This plugin has been updated for MADS v2
Currently, the supported platforms are:
- Linux
- MacOS
- Windows
Linux and MacOS:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build -j4
sudo cmake --install buildWindows:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build --config Release
cmake --install build --config ReleaseThe plugin supports the following settings in the INI file:
[replay]
csv_file = "path/to/file.csv"
loop = true # once the end of file has been reached, start again from beginningAll settings are optional; if omitted, the default values are used.