Live Resource Selector mission¶
The Live Resource Selector mission demonstrates how to:
Create a service that lists available live resources (such as cameras)
Request video streams dynamically from different receivers (default or skycontroller)
Handle live resource updates through a listener interface
Implement the same logic in C, C++, and Python
This mission queries the available live resources on the drone and allows requesting a video stream from one of them. The selection can be deterministic (e.g., front camera) or random, showcasing how to subscribe to resources dynamically and handle stream notifications.
The source code is available in C, C++ and Python:
Getting started¶
Build, install and run the Live Resource Selector sample mission¶
Please follow the instructions of the README file.
Mission overview¶
The Live Resource Selector sample mission demonstrates how to interact with live resources, especially camera streams, using the Air SDK APIs. The mission works as follows:
At startup, the service initializes a LiveResourceSelector with a listener.
The listener receives callbacks when the list of resources is updated and when a stream notification is triggered.
Periodically, the service queries the list of available live resources and logs their description, type, dynamic flag, and path.
Randomly, one of the available live resources is selected and a stream request is sent for either the default or skycontroller receiver.
Stream notifications are logged, providing information about which camera type is being streamed, who requested it, and the receiver.
How does it work¶
The listener handles two kinds of events:
onLiveResourceList: triggered when a list of resources is available. It contains the description, type, whether the resource is dynamic, and its path.onNotifyStreamCamera: triggered when a stream notification is received for a given camera, including its receiver and requester UID.
During the mission, the service randomly selects one of the available resources and requests its stream dynamically.
C++ Example:
selector.requestStreamCamera(
arsdk::camera::STREAM_RECEIVER_DEFAULT,
arsdk::camera::CAMERA_TYPE_FRONT,
UID);
C Example:
live_resource_selector_request_stream_camera(selector,
STREAM_RECEIVER_DEFAULT, CAMERA_TYPE_FRONT, UID);
Python Example:
selector.request_stream_camera(StreamReceiver.DEFAULT, CameraType.FRONT,
UID)
Note
This mission demonstrates how to interact with available live resources. It does not perform additional image or video processing; the goal is to show how to discover resources and request streams dynamically.