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/resource/stoppable.hpp>
31 double turning_radius_meters;
32 double wheel_circumference_meters;
34 friend std::ostream& operator<<(std::ostream& os,
const properties& v);
52 const ProtoStruct& extra) = 0;
58 inline void spin(
double angle_deg,
double degs_per_sec) {
59 return spin(angle_deg, degs_per_sec, {});
67 virtual void spin(
double angle_deg,
double degs_per_sec,
const ProtoStruct& extra) = 0;
84 const ProtoStruct& extra) = 0;
99 const ProtoStruct& extra) = 0;
116 virtual ProtoStruct
do_command(
const ProtoStruct& command) = 0;
127 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
A Base is the platform that the other parts of a mobile robot attach to.
Definition base.hpp:25
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
virtual bool is_moving()=0
Reports if the base is in motion.
virtual void spin(double angle_deg, double degs_per_sec, const ProtoStruct &extra)=0
Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or c...
virtual std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra)=0
Returns GeometryConfigs associated with the calling base.
void set_power(const Vector3 &linear, const Vector3 &angular)
Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.
Definition base.hpp:73
virtual void move_straight(int64_t distance_mm, double mm_per_sec, const ProtoStruct &extra)=0
Move a robot's base in a straight line by a given distance. This method blocks until completed or can...
virtual void set_velocity(const Vector3 &linear, const Vector3 &angular, const ProtoStruct &extra)=0
Set the linear and angular velocity of a base.
properties get_properties()
Returns physical properties of the base (width, turning radius, wheel circumference)
Definition base.hpp:105
virtual properties get_properties(const ProtoStruct &extra)=0
Returns physical properties of the base (width, turning radius, wheel circumference)
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling base.
Definition base.hpp:120
void move_straight(int64_t distance_mm, double mm_per_sec)
Move a robot's base in a straight line by a given distance. This method blocks until completed or can...
Definition base.hpp:41
void spin(double angle_deg, double degs_per_sec)
Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or c...
Definition base.hpp:58
virtual void set_power(const Vector3 &linear, const Vector3 &angular, const ProtoStruct &extra)=0
Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.
void set_velocity(const Vector3 &linear, const Vector3 &angular)
Set the linear and angular velocity of a base.
Definition base.hpp:89
API api() const override
Returns the API associated with a particular resource.
Definition component.hpp:10
virtual std::string name() const
Return the resource's name.
Definition stoppable.hpp:8
Definition linear_algebra.hpp:15
Definition resource_api.hpp:50
Information about the physical base.
Definition base.hpp:29