4#include <viam/sdk/components/component.hpp>
6#include <viam/sdk/config/resource.hpp>
7#include <viam/sdk/resource/resource.hpp>
9using namespace viam::sdk;
20 void stop(
const ProtoStruct& extra)
override;
23 const ProtoStruct& extra)
override;
25 ProtoStruct
do_command(
const ProtoStruct& command)
override;
29 std::vector<GeometryConfig>
get_geometries(
const ProtoStruct& extra)
override;
32 void move_straight(int64_t distance_mm,
double mm_per_sec,
const ProtoStruct& extra)
override {
33 throw std::runtime_error(
"move_straight unimplemented");
35 void spin(
double angle_deg,
double degs_per_sec,
const ProtoStruct& extra)
override {
36 throw std::runtime_error(
"spin unimplemented");
40 const ProtoStruct& extra)
override {
41 throw std::runtime_error(
"set_velocity unimplemented");
45 std::shared_ptr<Motor> left_;
46 std::shared_ptr<Motor> right_;
Defines a Base component.
ProtoStruct get_status() override
Get the status of the base.
Definition impl.hpp:26
void set_power(const Vector3 &linear, const Vector3 &angular, const ProtoStruct &extra) override
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, const ProtoStruct &extra) override
Set the linear and angular velocity of a base.
Definition impl.hpp:38
Base::properties get_properties(const ProtoStruct &extra) override
Returns physical properties of the base (width, turning radius, wheel circumference)
void spin(double angle_deg, double degs_per_sec, const ProtoStruct &extra) override
Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or c...
Definition impl.hpp:35
bool is_moving() override
Reports if the base is in motion.
std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra) override
Returns GeometryConfigs associated with the calling base.
void move_straight(int64_t distance_mm, double mm_per_sec, const ProtoStruct &extra) override
Move a robot's base in a straight line by a given distance. This method blocks until completed or can...
Definition impl.hpp:32
ProtoStruct do_command(const ProtoStruct &command) override
Send/receive arbitrary commands to the resource.
void stop(const ProtoStruct &extra) override
Stops a resource from running.
A Base is the platform that the other parts of a mobile robot attach to.
Definition base.hpp:25
Definition resource.hpp:43
Defines a Motor component.
Information about the physical base.
Definition base.hpp:29
Definition linear_algebra.hpp:25