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

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

#include <encoder_client.hpp>

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

Public Types

using interface_type = Encoder
 
- Public Types inherited from viam::sdk::Encoder
enum class  position_type : uint8_t { unspecified = 0 , ticks_count = 1 , angle_degrees = 2 }
 

Public Member Functions

 EncoderClient (std::string name, std::shared_ptr< grpc::Channel > channel)
 
position get_position (const AttributeMap &extra, position_type position_type) override
 Returns position of the encoder which can either be ticks since last zeroing for an incremental encoder or degrees for an absolute encoder.
 
void reset_position (const AttributeMap &extra) override
 Reset the value of the position.
 
properties get_properties (const AttributeMap &extra) override
 Returns a list of all the position_types that are supported by the encoder.
 
std::vector< GeometryConfigget_geometries (const AttributeMap &extra) override
 Returns GeometryConfigs associated with the calling encoder.
 
AttributeMap do_command (const AttributeMap &command) override
 Send/receive arbitrary commands to the resource.
 
std::vector< GeometryConfigget_geometries ()
 Returns GeometryConfigs associated with the calling encoder.
 
virtual std::vector< GeometryConfigget_geometries (const AttributeMap &extra)=0
 Returns GeometryConfigs associated with the calling encoder.
 
position get_position (position_type position_type=position_type::unspecified)
 Returns position of the encoder which can either be ticks since last zeroing for an incremental encoder or degrees for an absolute encoder.
 
virtual position get_position (const AttributeMap &extra, position_type position_type=position_type::unspecified)=0
 Returns position of the encoder which can either be ticks since last zeroing for an incremental encoder or degrees for an absolute encoder.
 
properties get_properties ()
 Returns a list of all the position_types that are supported by the encoder.
 
virtual properties get_properties (const AttributeMap &extra)=0
 Returns a list of all the position_types that are supported by the encoder.
 
void reset_position ()
 Reset the value of the position.
 
virtual void reset_position (const AttributeMap &extra)=0
 Reset the value of the position.
 
- Public Member Functions inherited from viam::sdk::Encoder
position get_position (position_type position_type=position_type::unspecified)
 Returns position of the encoder which can either be ticks since last zeroing for an incremental encoder or degrees for an absolute encoder.
 
void reset_position ()
 Reset the value of the position.
 
properties get_properties ()
 Returns a list of all the position_types that are supported by the encoder.
 
std::vector< GeometryConfigget_geometries ()
 Returns GeometryConfigs associated with the calling encoder.
 
API api () const override
 Returns the API associated with a particular resource.
 
- Public Member Functions inherited from viam::sdk::Component
viam::common::v1::ResourceName get_resource_name (std::string name) const override
 Returns a ResourceName for a particular resource name.
 
- Public Member Functions inherited from viam::sdk::Resource
 Resource (std::string name)
 
virtual std::string name () const
 Return the resource's name.
 

Additional Inherited Members

- Static Public Member Functions inherited from viam::sdk::Encoder
static position_type from_proto (viam::component::encoder::v1::PositionType proto)
 Creates a position_type struct from its proto representation.
 
static position from_proto (const viam::component::encoder::v1::GetPositionResponse &proto)
 Creates a position struct from its proto representation.
 
static properties from_proto (const viam::component::encoder::v1::GetPropertiesResponse &proto)
 Creates a properties struct from its proto representation.
 
static viam::component::encoder::v1::PositionType to_proto (position_type position_type)
 Converts a position_type struct to its proto representation.
 
static viam::component::encoder::v1::GetPositionResponse to_proto (const position &position)
 Converts a position struct to its proto representation.
 
static viam::component::encoder::v1::GetPropertiesResponse to_proto (const properties &properties)
 Converts a properties struct to its proto representation.
 
- Protected Member Functions inherited from viam::sdk::Encoder
 Encoder (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Component
 Component (std::string name)
 

Detailed Description

gRPC client implementation of a Encoder component.

Member Function Documentation

◆ do_command()

AttributeMap viam::sdk::impl::EncoderClient::do_command ( const AttributeMap & command)
overridevirtual

Send/receive arbitrary commands to the resource.

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

Implements viam::sdk::Encoder.

◆ get_geometries() [1/3]

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

Returns GeometryConfigs associated with the calling encoder.

Returns
The requested GeometryConfigs associated with the component.

◆ get_geometries() [2/3]

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

Returns GeometryConfigs associated with the calling encoder.

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

Implements viam::sdk::Encoder.

◆ get_geometries() [3/3]

virtual std::vector< GeometryConfig > viam::sdk::Encoder::get_geometries ( const AttributeMap & extra)
virtual

Returns GeometryConfigs associated with the calling encoder.

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

Implements viam::sdk::Encoder.

◆ get_position() [1/3]

position viam::sdk::impl::EncoderClient::get_position ( const AttributeMap & extra,
position_type position_type )
overridevirtual

Returns position of the encoder which can either be ticks since last zeroing for an incremental encoder or degrees for an absolute encoder.

Parameters
extraAny additional arguments to the method.
position_typeThe type of position you are requesting. If the driver does not implement the requested type, this call will return an error. If position type is unspecified, the response will return a default according to the driver.

Implements viam::sdk::Encoder.

◆ get_position() [2/3]

virtual position viam::sdk::Encoder::get_position ( const AttributeMap & extra,
position_type position_type = position_type::unspecified )
virtual

Returns position of the encoder which can either be ticks since last zeroing for an incremental encoder or degrees for an absolute encoder.

Parameters
extraAny additional arguments to the method.
position_typeThe type of position you are requesting. If the driver does not implement the requested type, this call will return an error. If position type is unspecified, the response will return a default according to the driver.

Implements viam::sdk::Encoder.

◆ get_position() [3/3]

position viam::sdk::Encoder::get_position ( position_type position_type = position_type::unspecified)
inline

Returns position of the encoder which can either be ticks since last zeroing for an incremental encoder or degrees for an absolute encoder.

Parameters
position_typeThe type of position you are requesting. If the driver does not implement the requested type, this call will return an error. If position type is unspecified, the response will return a default according to the driver.

◆ get_properties() [1/2]

properties viam::sdk::impl::EncoderClient::get_properties ( const AttributeMap & extra)
overridevirtual

Returns a list of all the position_types that are supported by the encoder.

Parameters
extraAny additional arguments to the method.

Implements viam::sdk::Encoder.

◆ get_properties() [2/2]

virtual properties viam::sdk::Encoder::get_properties ( const AttributeMap & extra)
virtual

Returns a list of all the position_types that are supported by the encoder.

Parameters
extraAny additional arguments to the method.

Implements viam::sdk::Encoder.

◆ reset_position() [1/2]

void viam::sdk::impl::EncoderClient::reset_position ( const AttributeMap & extra)
overridevirtual

Reset the value of the position.

Parameters
extraAny additional arguments to the method.

Implements viam::sdk::Encoder.

◆ reset_position() [2/2]

virtual void viam::sdk::Encoder::reset_position ( const AttributeMap & extra)
virtual

Reset the value of the position.

Parameters
extraAny additional arguments to the method.

Implements viam::sdk::Encoder.


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