Auterion App SDK
Auterion SDK is a library that can be used by AuterionOS apps to communicate with the system.
auterion::ObjectDetectionClient Class Reference

Provides access to 2D object detections from the system. More...

#include <auterion_sdk/object_detection/object_detection_client.hpp>

Public Member Functions

 ObjectDetectionClient (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 Client object. More...
 
virtual ~ObjectDetectionClient ()
 Destroy the Object Detection Client object.
 
 ObjectDetectionClient (const ObjectDetectionClient &)=delete
 
ObjectDetectionClientoperator= (const ObjectDetectionClient &)=delete
 
 ObjectDetectionClient (ObjectDetectionClient &&)=delete
 
ObjectDetectionClientoperator= (ObjectDetectionClient &&)=delete
 
Detections2DSubscriptiondetections2D () const
 Get the detections2D subscription. More...
 
ObjectDetectionClientsubscribeDetections2D (Detections2DCallback callback=nullptr)
 Subscribe to 2D object detections. More...
 
void enableObjectDetection ()
 Publishes a message to enable the object detection service. The publisher will receive this message and enable the object detection service.
 
void disableObjectDetection ()
 Publishes a message to disable the object detection service. The publisher will receive this message and disable the object detection service.
 

Detailed Description

Provides access to 2D object detections from the system.

Example usage:

To register a custom callback on the 2D detections:

auterion::ObjectDetectionClient object_detection_client{sdk};
// Subscribe to detection updates
object_detection_client.subscribeDetections2D([](const ImageDetections2D& detections) {
std::cout << "Received " << detections.detections.size() << " detections" << std::endl;
});
Provides access to 2D object detections from the system.
Definition: object_detection_client.hpp:142
SDK execution class. All callbacks are called on the same thread.
Definition: auterion.hpp:47

To query the latest known 2D detections:

auterion::ObjectDetectionClient object_detection_client{sdk};
// Activate subscription process without registering a callback
object_detection_client.subscribeDetections2D();
// Retrieve latest detections
auterion::ImageDetections2D detections = object_detection_client.detections2D().last();
Contains 2D detections for a specific image.
Definition: image_detections_2d.hpp:44

To control the object detection service:

auterion::ObjectDetectionClient object_detection_client{sdk};
// Enable the object detection service
object_detection_client.enableObjectDetection();
// Later, disable the service when no longer needed
object_detection_client.disableObjectDetection();

Constructor & Destructor Documentation

◆ ObjectDetectionClient()

auterion::ObjectDetectionClient::ObjectDetectionClient ( 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 Client object.

Parameters
sdkThe SDK instance to use for creating clients.
detections_topicTopic name for subscribing to 2D detections.
enabled_topicTopic name for publishing detection enabled state.

Member Function Documentation

◆ detections2D()

Detections2DSubscription& auterion::ObjectDetectionClient::detections2D ( ) const

Get the detections2D subscription.

Returns
Reference to the detections2D subscription.

◆ subscribeDetections2D()

ObjectDetectionClient& auterion::ObjectDetectionClient::subscribeDetections2D ( Detections2DCallback  callback = nullptr)
inline

Subscribe to 2D object detections.

Parameters
callbackThe callback function to be invoked when new detections are received.
Returns
Reference to this object for method chaining.

The documentation for this class was generated from the following file: