11#include <boost/endian/conversion.hpp>
12#include <xtensor/xarray.hpp>
14#include <viam/sdk/common/proto_value.hpp>
15#include <viam/sdk/common/utils.hpp>
16#include <viam/sdk/config/resource.hpp>
17#include <viam/sdk/resource/resource_api.hpp>
45 std::vector<double> parameters;
74 std::string mime_type;
75 std::vector<unsigned char> pc;
78 const static std::string lazy_suffix;
84 std::string mime_type;
85 std::vector<unsigned char> bytes;
86 std::string source_name;
92 std::vector<raw_image> images;
140 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
146 return get_image(std::move(mime_type), {});
182 virtual std::vector<GeometryConfig>
get_geometries(
const ProtoStruct& extra) = 0;
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
A Camera represents any physical hardware that can capture frames.
Definition camera.hpp:28
virtual std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra)=0
Returns GeometryConfigs associated with the calling camera.
raw_image get_image(std::string mime_type)
Get the next image from the camera as a raw image.
Definition camera.hpp:145
static Camera::depth_map decode_depth_map(const std::vector< unsigned char > &data)
virtual image_collection get_images()=0
Get the next images from the camera as a vector of raw images with names and metadata.
API api() const override
Returns the API associated with a particular resource.
virtual properties get_properties()=0
Get the camera's properties.
virtual point_cloud get_point_cloud(std::string mime_type, const ProtoStruct &extra)=0
Get the next point_cloud from the camera.
virtual raw_image get_image(std::string mime_type, const ProtoStruct &extra)=0
Get the next image from the camera as a raw image.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling camera.
Definition camera.hpp:175
static std::vector< unsigned char > encode_depth_map(const Camera::depth_map &m)
point_cloud get_point_cloud(std::string mime_type)
Get the next point_cloud from the camera.
Definition camera.hpp:163
std::vector< std::string > mime_types
The supported mime types of the camera— a type alias.
Definition camera.hpp:49
static std::string normalize_mime_type(const std::string &str)
remove any extra suffix's from the mime type string.
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
Definition component.hpp:10
virtual std::string name() const
Return the resource's name.
Represents the dimensions and depth values of a depth map.
Definition resource_api.hpp:50
The distortion parameters of the camera.
Definition camera.hpp:43
a collection of images that were collected from a camera all at the same time.
Definition camera.hpp:91
The points and mime type of a point cloud.
Definition camera.hpp:73
The camera's supported features and settings.
Definition camera.hpp:53
bool supports_pcd
Indicates whether the camera has a valid implementation of get_point_cloud.
Definition camera.hpp:55
float frame_rate
Contains the camera's frame rate.
Definition camera.hpp:67
Camera::mime_types mime_types
Contains the mime types the camera supports.
Definition camera.hpp:64
the raw bytes, mime type of an image, and name of the source that produced it.
Definition camera.hpp:83