Viam C++ SDK current
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
viam::sdk::impl::CameraClient Class Reference

gRPC client implementation of a Camera component. More...

#include <camera_client.hpp>

+ Inheritance diagram for viam::sdk::impl::CameraClient:

Public Types

using interface_type = Camera
 
- Public Types inherited from viam::sdk::Camera
using mime_types = std::vector<std::string>
 The supported mime types of the camera— a type alias.
 
using depth_map = xt::xarray<uint16_t>
 

Public Member Functions

 CameraClient (std::string name, std::shared_ptr< grpc::Channel > channel)
 
ProtoStruct do_command (const ProtoStruct &command) override
 Send/receive arbitrary commands to the resource.
 
raw_image get_image (std::string mime_type, const ProtoStruct &extra) override
 Get the next image from the camera as a raw image.
 
image_collection get_images () override
 Get the next images from the camera as a vector of raw images with names and metadata.
 
point_cloud get_point_cloud (std::string mime_type, const ProtoStruct &extra) override
 Get the next point_cloud from the camera.
 
properties get_properties () override
 Get the camera's properties.
 
std::vector< GeometryConfigget_geometries (const ProtoStruct &extra) override
 Returns GeometryConfigs associated with the calling camera.
 
std::vector< GeometryConfigget_geometries ()
 Returns GeometryConfigs associated with the calling camera.
 
virtual std::vector< GeometryConfigget_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.
 
virtual raw_image get_image (std::string mime_type, const ProtoStruct &extra)=0
 Get the next image from the camera as a raw image.
 
point_cloud get_point_cloud (std::string mime_type)
 Get the next point_cloud from the camera.
 
virtual point_cloud get_point_cloud (std::string mime_type, const ProtoStruct &extra)=0
 Get the next point_cloud from the camera.
 
- Public Member Functions inherited from viam::sdk::Camera
raw_image get_image (std::string mime_type)
 Get the next image from the camera as a raw image.
 
point_cloud get_point_cloud (std::string mime_type)
 Get the next point_cloud from the camera.
 
std::vector< GeometryConfigget_geometries ()
 Returns GeometryConfigs associated with the calling camera.
 
API api () const override
 Returns the API associated with a particular resource.
 
- Public Member Functions inherited from viam::sdk::Component
Name get_resource_name () const override
 Returns the Name for a particular resource.
 
- Public Member Functions inherited from viam::sdk::Resource
 Resource (std::string name)
 
virtual std::string name () const
 Return the resource's name.
 

Protected Member Functions

 CameraClient (std::string name, std::unique_ptr< viam::component::camera::v1::CameraService::StubInterface > stub)
 
- Protected Member Functions inherited from viam::sdk::Camera
 Camera (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Component
 Component (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Resource
Name get_resource_name (const std::string &type) const
 

Additional Inherited Members

- Static Public Member Functions inherited from viam::sdk::Camera
static std::vector< unsigned char > encode_depth_map (const Camera::depth_map &m)
 
static Camera::depth_map decode_depth_map (const std::vector< unsigned char > &data)
 
static std::string normalize_mime_type (const std::string &str)
 remove any extra suffix's from the mime type string.
 
- Static Public Attributes inherited from viam::sdk::Camera
static const std::string lazy_suffix
 

Detailed Description

gRPC client implementation of a Camera component.

Member Function Documentation

◆ do_command()

ProtoStruct viam::sdk::impl::CameraClient::do_command ( const ProtoStruct & command)
overridevirtual

Send/receive arbitrary commands to the resource.

Parameters
Commandthe command to execute.
Returns
The result of the executed command.

Implements viam::sdk::Camera.

◆ get_geometries() [1/3]

std::vector< GeometryConfig > viam::sdk::Camera::get_geometries ( )
inline

Returns GeometryConfigs associated with the calling camera.

Returns
The requested GeometryConfigs associated with the component.

◆ get_geometries() [2/3]

std::vector< GeometryConfig > viam::sdk::impl::CameraClient::get_geometries ( const ProtoStruct & extra)
overridevirtual

Returns GeometryConfigs associated with the calling camera.

Parameters
extraAny additional arguments to the method.
Returns
The requested GeometryConfigs associated with the component.

Implements viam::sdk::Camera.

◆ get_geometries() [3/3]

virtual std::vector< GeometryConfig > viam::sdk::Camera::get_geometries ( const ProtoStruct & extra)
virtual

Returns GeometryConfigs associated with the calling camera.

Parameters
extraAny additional arguments to the method.
Returns
The requested GeometryConfigs associated with the component.

Implements viam::sdk::Camera.

◆ get_image() [1/3]

raw_image viam::sdk::Camera::get_image ( std::string mime_type)
inline

Get the next image from the camera as a raw image.

Parameters
mime_typethe desired mime_type of the image (does not guarantee output type).
Returns
The frame as a raw_image.

◆ get_image() [2/3]

raw_image viam::sdk::impl::CameraClient::get_image ( std::string mime_type,
const ProtoStruct & extra )
overridevirtual

Get the next image from the camera as a raw image.

Parameters
mime_typethe desired mime_type of the image (does not guarantee output type).
extraany additional arguments to the method.
Returns
The frame as a raw_image.

Implements viam::sdk::Camera.

◆ get_image() [3/3]

virtual raw_image viam::sdk::Camera::get_image ( std::string mime_type,
const ProtoStruct & extra )
virtual

Get the next image from the camera as a raw image.

Parameters
mime_typethe desired mime_type of the image (does not guarantee output type).
extraany additional arguments to the method.
Returns
The frame as a raw_image.

Implements viam::sdk::Camera.

◆ get_images()

image_collection viam::sdk::impl::CameraClient::get_images ( )
overridevirtual

Get the next images from the camera as a vector of raw images with names and metadata.

Returns
a vector of raw_images and associated response metadata.

Implements viam::sdk::Camera.

◆ get_point_cloud() [1/3]

point_cloud viam::sdk::Camera::get_point_cloud ( std::string mime_type)
inline

Get the next point_cloud from the camera.

Parameters
mime_typethe desired mime_type of the point_cloud (does not guarantee output type).
Returns
The requested point_cloud.

◆ get_point_cloud() [2/3]

point_cloud viam::sdk::impl::CameraClient::get_point_cloud ( std::string mime_type,
const ProtoStruct & extra )
overridevirtual

Get the next point_cloud from the camera.

Parameters
mime_typethe desired mime_type of the point_cloud (does not guarantee output type).
extraany additional arguments to the method.
Returns
The requested point_cloud.

Implements viam::sdk::Camera.

◆ get_point_cloud() [3/3]

virtual point_cloud viam::sdk::Camera::get_point_cloud ( std::string mime_type,
const ProtoStruct & extra )
virtual

Get the next point_cloud from the camera.

Parameters
mime_typethe desired mime_type of the point_cloud (does not guarantee output type).
extraany additional arguments to the method.
Returns
The requested point_cloud.

Implements viam::sdk::Camera.

◆ get_properties()

properties viam::sdk::impl::CameraClient::get_properties ( )
overridevirtual

Get the camera's properties.

Returns
The camera properties.

Implements viam::sdk::Camera.


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