The samples folder is present to show various features and scenarios of the Heex SDK and demonstrated some basic and more advanced functionalities.

Each sample comes equipped with preconfigured settings tailored to its operation. All the necessary details are conveniently outlined in their respective sections, where the usage or introduction of features is explained.

Within the extensive samples folder, we’ll focus on what’s inside the cpp and python subfolders on this documentation page. It’s worth noting that all samples in the cpp subfolder mirror the behavior of their counterparts in the python subfolder. Additionally, every sample follows a naming convention with either a basic prefix (e.g., basicSampleRecorder.cpp) showcasing common usages, or a feature prefix (e.g., featureSampleMonitor_ConfChangedCallback.py) highlighting specific features. Explore the rich functionality encapsulated in these sections!

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

All of these samples have very similar behaviors:

  • 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 (from true to false 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 the setSignalUnit("%") function, but only if it has physical relationships (ie: from km/h to m/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 the IntervalMonitor, 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.

featureSampleMonitors

The featureSampleMonitors are samples that are showing off a specific feature.

featureSampleMonitor_ConfChangedCallback

The featureSampleMonitor_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 the onConfigurationChangedCallback function
  • The rest of the behavior of the sample is the same as the basicSampleMonitor_Boolean

Recorders

basicSampleRecorder

The basicSampleRecorder 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 identifier R-UUID. It stops only on SIGKILL (Ctrl-C).

featureSampleRecorders

The featureSampleRecorders are samples that are showing off a specific feature.

featureSampleRecorder_ConfChangedCallback

The featureSampleRecorder_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.