|
Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
|
Publisher for 2D object detections. More...
#include <auterion_sdk/object_detection/object_detection_provider.hpp>
Public Member Functions | |
| ObjectDetectionProvider (SDK &sdk, const std::string &detections_topic="object_detection/detections_2d", const std::string &enabled_topic="object_detection/detections_2d_enabled") | |
| Construct a new Object Detection Provider object. | |
| virtual | ~ObjectDetectionProvider () |
| Destroy the Object Detection Provider object. | |
| ObjectDetectionProvider (const ObjectDetectionProvider &)=delete | |
| ObjectDetectionProvider & | operator= (const ObjectDetectionProvider &)=delete |
| ObjectDetectionProvider (ObjectDetectionProvider &&)=delete | |
| ObjectDetectionProvider & | operator= (ObjectDetectionProvider &&)=delete |
| void | updateDetections2D (const ImageDetections2D &image_detections) |
| Publishes 2D object detections. | |
| ObjectDetectionEnabledSubscription & | objectDetectionEnabledSubscription () const |
| Get the object detection enabled subscription. | |
| ObjectDetectionProvider & | subscribeObjectDetectionEnabled (ObjectDetectionEnabledCallback callback=nullptr) |
| Subscribe to object detection enabled state changes to control provider operation. | |
Publisher for 2D object detections.
Example usage:
To publish 2D object detections:
To control provider operation based on object detection enabled state:
To check object detection enabled state programmatically and control processing:
| auterion::ObjectDetectionProvider::ObjectDetectionProvider | ( | SDK & | sdk, |
| const std::string & | detections_topic = "object_detection/detections_2d", |
||
| const std::string & | enabled_topic = "object_detection/detections_2d_enabled" |
||
| ) |
Construct a new Object Detection Provider object.
| sdk | The SDK instance to use for creating providers. |
| detections_topic | Topic name for publishing 2D detections. |
| enabled_topic | Topic name for subscribing to detection enabled state. |
| ObjectDetectionEnabledSubscription & auterion::ObjectDetectionProvider::objectDetectionEnabledSubscription | ( | ) | const |
Get the object detection enabled subscription.
|
inline |
Subscribe to object detection enabled state changes to control provider operation.
Providers should use this to start/stop computational work based on whether the object detection is enabled or disabled, avoiding unnecessary resource usage.
| callback | The callback function to be invoked when the object detection enabled state changes. Should implement logic to start/stop processing accordingly. |
| void auterion::ObjectDetectionProvider::updateDetections2D | ( | const ImageDetections2D & | image_detections | ) |
Publishes 2D object detections.
| image_detections | The image detections to publish. |