capture_images
Skill class for ai.intrinsic.capture_images skill.
Captures sensor images from the specified camera internally using the camera service.
Prerequisites
This skill does not have any prerequisite.
Usage Example
To retrieve and consume the capture result contained in the returned capture_data, use the following code:
- Python
- C++
from intrinsic.perception.public.proto.v1 import capture_result_pb2
from intrinsic.platform.pubsub.python import pubsub
pub_sub = pubsub.PubSub()
kvstore = pub_sub.KeyValueStore(capture_data.capture_result_location.store)
capture_result = capture_result_pb2.CaptureResult()
kvstore.Get(capture_data.capture_result_location.key).Unpack(capture_result)
#include "intrinsic/perception/public/proto/v1/capture_result.proto.h"
#include "intrinsic/platform/pubsub/pubsub.h"
PubSub pubsub;
INTR_ASSIGN_OR_RETURN(
KeyValueStore kvstore,
pubsub.KeyValueStore(capture_data.capture_result_location().store()));
INTR_ASSIGN_OR_RETURN(
auto capture_result,
kvstore.Get<intrinsic_proto::perception::v1::CaptureResult>(
capture_data.capture_result_location().key(), NamespaceConfig()));
Parameters
capture_result_location
Specifies where to store the capture result. If not provided, defaults to
the capture_results in-memory store (this store currently must not be
altered by users) and a key corresponding to the hash of the camera
identifier. If multiple capture_images skill instances are running with
the same camera, by default each skill call will overwrite the others'
results. By manually providing a key for each skill instance this can be
avoided.
sensor_ids
Specifies the sensor ids to capture images from. If empty, the skill captures images from all sensors.
post_processing_by_sensor_id
A map from sensor id to post processing options such as undistortion, cropping, and resizing. If empty, all images will be undistorted by default (if the respective sensor configs contain distortion parameters or the camera distortion is factory-calibrated).
timeout
Maximum duration to wait for capturing images from the associated camera. If not provided, defaults to 5s.
camera_settings_to_append
Camera settings to append to the camera settings coming from the camera config for skill execution.
camera_settings_to_wait_for
Capturing will be repeated until the specified conditional camera
settings are met. You may need to increase the
timeout, if you expect to wait for a long time. If
empty, the skill will execute exactly one capture call.
camera_settings_to_return
Camera settings to be returned in the result.
log_debug_data
Whether to log the captured images.
Capabilities
camera
Resource with capability CameraConfig
Returns
capture_data
The capture data returned by the skill, containing the capture result location and the camera pose. This can be connected to other skills, which can retrieve the capture result using the key value store. See the usage example for more details.
camera_settings
Camera settings specified by
camera_settings_to_return.
Error Code
The skill does not have error codes yet