Viam C++ SDK current
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
viam::sdk::Sensor Class Referenceabstract

#include "components/sensor.hpp"

+ Inheritance diagram for viam::sdk::Sensor:

Public Member Functions

API api () const override
 Returns the API associated with a particular resource.
 
virtual ProtoStruct do_command (const ProtoStruct &command)=0
 Send/receive arbitrary commands to the resource.
 
std::vector< GeometryConfigget_geometries ()
 Returns GeometryConfigs associated with the calling sensor.
 
virtual std::vector< GeometryConfigget_geometries (const ProtoStruct &extra)=0
 Returns GeometryConfigs associated with the calling sensor.
 
ProtoStruct get_readings ()
 Returns the measurements/data specific to this sensor.
 
virtual ProtoStruct get_readings (const ProtoStruct &extra)=0
 Returns the measurements/data specific to this sensor.
 
- 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.
 

Protected Member Functions

 Sensor (std::string name)
 
- Protected Member Functions inherited from viam::sdk::Component
 Component (std::string name)
 

Detailed Description

This acts as an abstract base class to be inherited from by any drivers representing specific sensor implementations. This class cannot be used on its own.

Member Function Documentation

◆ api()

API viam::sdk::Sensor::api ( ) const
overridevirtual

Returns the API associated with a particular resource.

Implements viam::sdk::Resource.

◆ do_command()

virtual ProtoStruct viam::sdk::Sensor::do_command ( const ProtoStruct & command)
pure virtual

Send/receive arbitrary commands to the resource.

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

Implemented in viam::sdk::impl::SensorClient.

◆ get_geometries() [1/2]

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

Returns GeometryConfigs associated with the calling sensor.

Returns
The requested GeometryConfigs associated with the component.

◆ get_geometries() [2/2]

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

Returns GeometryConfigs associated with the calling sensor.

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

Implemented in viam::sdk::impl::SensorClient, and viam::sdk::impl::SensorClient.

◆ get_readings() [1/2]

ProtoStruct viam::sdk::Sensor::get_readings ( )
inline

Returns the measurements/data specific to this sensor.

Returns
The requested measurements/data specific to this sensor.

◆ get_readings() [2/2]

virtual ProtoStruct viam::sdk::Sensor::get_readings ( const ProtoStruct & extra)
pure virtual

Returns the measurements/data specific to this sensor.

Parameters
extraAny additional arguments to the method.
Returns
The requested measurements/data specific to this sensor.

Implemented in viam::sdk::impl::SensorClient, and viam::sdk::impl::SensorClient.


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