8#include <viam/sdk/common/proto_value.hpp>
9#include <viam/sdk/common/utils.hpp>
10#include <viam/sdk/config/resource.hpp>
24 enum class position_type : uint8_t {
43 bool ticks_count_supported;
44 bool angle_degrees_supported;
63 position_type position_type = position_type::unspecified) = 0;
86 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
97 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
Definition component.hpp:10
An encoder is a device that is hooked up to motors to report a position.
Definition encoder.hpp:21
API api() const override
Returns the API associated with a particular resource.
properties get_properties()
Returns a list of all the position_types that are supported by the encoder.
Definition encoder.hpp:75
virtual void reset_position(const ProtoStruct &extra)=0
Reset the value of the position.
virtual std::vector< GeometryConfig > get_geometries(const ProtoStruct &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 encod...
Definition encoder.hpp:52
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
virtual properties get_properties(const ProtoStruct &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.
Definition encoder.hpp:66
virtual position get_position(const ProtoStruct &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 encod...
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling encoder.
Definition encoder.hpp:90
virtual std::string name() const
Return the resource's name.
Definition resource_api.hpp:50
reported position.
Definition encoder.hpp:35
Encodes the supported modes of this encoder.
Definition encoder.hpp:42