This is a Sink plugin for MADS.
This plugin visualizes on Rerun a 3D model of a machine tool, updating axes positions according to the received commands. It is just a viewer and does not provide any dinamics simulation. Foor that, head to https://gitbub.com/mads-net/FMU_agent.
Required MADS version: 2.0.0.
Currently, the supported platforms are:
- Linux
- MacOS
- Windows
The easiest way to install the Rerun viewer is via pip:
python3 -mvenv .venv
source .venv/bin/activate # or, on Windows: .venv\script\activate.ps1
pip install rerun-sdk==0.31.4Note that on Windows, you shall use a PowerShell terminal
Type rerun and be sure that a Rerun windows opens. You might then close it.
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build -j4cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build --config ReleaseOnce compiled, provided that you have a running broker and the settings contain a [machinetool] section, you may run the plugin from the same termninal in which you have activated the Python venv:
mads sink build/machinetool.pluginDownload a release from GitHub, unzip it, then open a shell in the unzipped folder and create a Python venv as above described, including installing the Rerun-SDK.
Provided that you have a running broker and the settings contain a [machinetool] section, proceed as follows:
cd <unzipped folder>
python -mvenv .venv
.\.venv\script\activate.ps1
pip install rerun-sdk
mads sink lib/machinetool.plugincd <unzipped folder>
xattr -dr com.apple.quarantine .
python -mvenv .venv
source .venv/bin/activate
pip install rerun-sdk
mads sink lib/machinetool.pluginThen launch the agent from same shell.
NOTE: the plugin expects to find the solid models for machine tool components in the
modelsfolder right in the current working directory, so you must launch the plugin from the project root (if compiled) of from the root of the downloaded folder (if downloades a zipped release).
The plugin moves the three axes and adjusts the tool size according to the following JSON structure:
{
"timecode": <elapsed seconds from last midnight>,
"input": {"position": [<3 elements>]},
"output": {
"position": [<3 elements>],
"speed": <value>
},
"tool": {
"length": <scalar>,
"diameter": <scalar>,
"z_offset": <scalar>
},
"metrics": {
<map of custom key-values>
}
}The timecode field is required and is used as Rerun's time abscissa. It must be
the elapsed seconds from the last midnight, rounded to the producer's 5 ms
resolution.
Only ["output"]["position"] is used to move the axes. The remainig data are simply logged (and possibly plotted) by Rerun.
The plugin supports the following settings in the INI file:
[machinetool]
sub_topic = ["fmu_machine_tool"]
initial_position = [0, 0, 200]
tool = {length = 100, diameter = 20, z_offset = 50}All settings are optional; if omitted, the default values are used.