Monitors
basicSampleMonitors
In our samples, we have created a basic sample for each of the custom ‘configurable-by-value’ monitors that can be implemented:basicSampleMonitor_Boolean
basicSampleMonitor_Interval
basicSampleMonitor_String
basicSampleMonitor_Threshold
basicSampleMonitor_Zone
- Create the instance of the monitor
- The call of
awaitReady()
which will set the Agent in a waiting state, and passes once the connection with the core has been properly done. - A loop that supplies different values (depending on the monitor type), which will then trigger the monitor’s event or not. The event triggering is defined at the creation of the monitor itself on the web platform:
- For the
BooleanMonitor
, a random boolean value is set, the monitor triggers the event when there is a change of state (fromtrue
tofalse
or the other way around, depending on the definition pf the monitor) - For the
IntervalMonitor
, a random humidity level between 0 and 100 % is set. The unit of the interval can be modified with thesetSignalUnit("%")
function, but only if it has physical relationships (ie: fromkm/h
tom/s
). Once the level is within a certain range (range defined during the creation of the monitor), the event is triggered. - For the
StringMonitor
, we provide several different strings, and if the given string is equal to the one set at creation time of the monitor, the event is triggered - For the
ThresholdMonitor
, the behavior is the same as theIntervalMonitor
, with the difference that instead of reaching an interval to trigger the event, we have a threshold, and the event is triggered when we are below, equal or above this threshold (this being defined during the creation of the Monitor) - For the
ZoneMonitor
, we provide different position values to the monitor, and if a position is within the Zone that was defined during the creation of the monitor, then the event is triggered.
- For the
featureSampleMonitors
ThefeatureSampleMonitors
are samples that are showing off a specific feature.
featureSampleMonitor_ConfChangedCallback
ThefeatureSampleMonitor_ConfChangedCallback
demonstrates how to create a Configurable-by-Value Monitor that overloads the onConfigurationChangedCallback function in order to access or run specific code during an agent’s reconfiguration. In our sample, we print our the Value Configurations and the Constant Values whenever there is a reconfiguration (also at initial configuration).
- The sample uses a
BooleanMonitor
, but any Agent can be used to overload theonConfigurationChangedCallback
function - The rest of the behavior of the sample is the same as the
basicSampleMonitor_Boolean
Recorders
basicSampleRecorder
ThebasicSampleRecorder
demonstrates how to create a Recorder that provides the ContextValue position
and generates an event recording part in the form of a file that contains the timestamp of the event. The file is created for the event and demonstrate how to use some information contained in the event query.
- When run, the recorder gets initialized, connects to Core with
R-UUID
, exposes the Context Values and Event Recording Part generation to the Core for identifierR-UUID
. It stops only on SIGKILL (Ctrl-C).
featureSampleRecorders
ThefeatureSampleRecorders
are samples that are showing off a specific feature.
featureSampleRecorder_ConfChangedCallback
ThefeatureSampleRecorder_ConfChangedCallback
demonstrates how to create a Configurable-by-Value Recorder that overloads the onConfigurationChangedCallback function in order to access or run specific code during an agent’s reconfiguration. In our sample, we print our the Value Configurations and the Constant Values whenever there is a reconfiguration (also at initial configuration).
The rest of the behavior is very similar to the basicSampleRecorder
Specific Middleware samples
Explore ready-to-use sample code located in the samples folder. Feel free to modify the UUID or use the provided code as a starting point for your implementation.1. ROS1
This project is the example of the recommended SDK usage for a ROS1 package that implements Monitors and Recorders.It implements logics of monitoring and recording that interface with ROS1 middleware. See more details at samples/ROS1 in your working directory.
2. ROS2
This project is the example of the recommended SDK usage for a ROS2 package that implements Monitors and Recorders.It implements logics of monitoring and recording that interface with ROS2 middleware. See more details at samples/ROS2 in your working directory.
3. ApexAI
This project is the example of the recommended SDK usage for a ApexAI package that implements Monitors and Recorders.It implements logics of monitoring and recording that interface with ApexAI middleware. See more details at samples/ApexAI in your working directory.