8#include <viam/sdk/common/linear_algebra.hpp>
9#include <viam/sdk/common/proto_value.hpp>
10#include <viam/sdk/common/utils.hpp>
11#include <viam/sdk/config/resource.hpp>
12#include <viam/sdk/spatialmath/orientation.hpp>
35 double o_x, o_y, o_z, theta;
46 bool linear_velocity_supported;
47 bool angular_velocity_supported;
48 bool orientation_supported;
49 bool position_supported;
50 bool compass_heading_supported;
51 bool linear_acceleration_supported;
56 inline Vector3 get_linear_velocity() {
57 return get_linear_velocity({});
60 virtual Vector3 get_linear_velocity(
const ProtoStruct& extra) = 0;
62 inline Vector3 get_angular_velocity() {
63 return get_angular_velocity({});
66 virtual Vector3 get_angular_velocity(
const ProtoStruct& extra) = 0;
68 inline compassheading get_compass_heading() {
69 return get_compass_heading({});
72 virtual compassheading get_compass_heading(
const ProtoStruct& extra) = 0;
74 inline orientation get_orientation() {
75 return get_orientation({});
78 virtual orientation get_orientation(
const ProtoStruct& extra) = 0;
81 return get_position({});
84 virtual position get_position(
const ProtoStruct& extra) = 0;
86 inline properties get_properties() {
87 return get_properties({});
90 virtual properties get_properties(
const ProtoStruct& extra) = 0;
92 inline std::unordered_map<std::string, float> get_accuracy() {
93 return get_accuracy({});
96 virtual std::unordered_map<std::string, float> get_accuracy(
const ProtoStruct& extra) = 0;
98 inline Vector3 get_linear_acceleration() {
99 return get_linear_acceleration({});
102 virtual Vector3 get_linear_acceleration(
const ProtoStruct& extra) = 0;
107 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
118 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
Definition movement_sensor.hpp:24
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.
virtual std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra)=0
Returns GeometryConfigs associated with the calling movementsensor.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling movementsensor.
Definition movement_sensor.hpp:111
virtual std::string name() const
Return the resource's name.
Definition linear_algebra.hpp:15
Current position of the motor relative to its home.
Definition resource_api.hpp:50
Definition movement_sensor.hpp:27
double value
A number from 0-359 where 0 is North, 90 is East, 180 is South, and 270 is West.
Definition movement_sensor.hpp:29
Struct version of viam::common::v1::Orientation.
Definition movement_sensor.hpp:34
Definition movement_sensor.hpp:39
Definition movement_sensor.hpp:45
Definition geometry.hpp:80