11#include <boost/endian/conversion.hpp>
13#if defined(__has_include) && (__has_include(<xtensor/containers/xarray.hpp>))
14#include <xtensor/containers/xarray.hpp>
16#include <xtensor/xarray.hpp>
19#include <viam/sdk/common/proto_value.hpp>
20#include <viam/sdk/common/utils.hpp>
21#include <viam/sdk/config/resource.hpp>
22#include <viam/sdk/resource/resource_api.hpp>
50 std::vector<double> parameters;
79 std::string mime_type;
80 std::vector<unsigned char> pc;
83 const static std::string lazy_suffix;
89 std::string mime_type;
90 std::vector<unsigned char> bytes;
91 std::string source_name;
97 std::vector<raw_image> images;
145 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
151 return get_image(std::move(mime_type), {});
187 virtual std::vector<GeometryConfig>
get_geometries(
const ProtoStruct& extra) = 0;
Definition resource_api.hpp:21
A Camera represents any physical hardware that can capture frames.
Definition camera.hpp:33
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:150
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:180
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:168
std::vector< std::string > mime_types
The supported mime types of the camera— a type alias.
Definition camera.hpp:54
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:46
The distortion parameters of the camera.
Definition camera.hpp:48
a collection of images that were collected from a camera all at the same time.
Definition camera.hpp:96
The points and mime type of a point cloud.
Definition camera.hpp:78
The camera's supported features and settings.
Definition camera.hpp:58
bool supports_pcd
Indicates whether the camera has a valid implementation of get_point_cloud.
Definition camera.hpp:60
float frame_rate
Contains the camera's frame rate.
Definition camera.hpp:72
Camera::mime_types mime_types
Contains the mime types the camera supports.
Definition camera.hpp:69
the raw bytes, mime type of an image, and name of the source that produced it.
Definition camera.hpp:88