4#include <viam/sdk/components/component.hpp>
6#include <viam/sdk/config/resource.hpp>
7#include <viam/sdk/resource/reconfigurable.hpp>
8#include <viam/sdk/resource/resource.hpp>
10using namespace viam::sdk;
24 void stop(
const ProtoStruct& extra)
override;
27 const ProtoStruct& extra)
override;
29 ProtoStruct
do_command(
const ProtoStruct& command)
override;
30 std::vector<GeometryConfig>
get_geometries(
const ProtoStruct& extra)
override;
33 void move_straight(int64_t distance_mm,
double mm_per_sec,
const ProtoStruct& extra)
override {
34 throw std::runtime_error(
"move_straight unimplemented");
36 void spin(
double angle_deg,
double degs_per_sec,
const ProtoStruct& extra)
override {
37 throw std::runtime_error(
"spin unimplemented");
41 const ProtoStruct& extra)
override {
42 throw std::runtime_error(
"set_velocity unimplemented");
46 std::shared_ptr<Motor> left_;
47 std::shared_ptr<Motor> right_;
Defines a Base component.
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 reconfigure(const Dependencies &deps, const ResourceConfig &cfg) override
Reconfigures a resource.
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:39
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:36
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:33
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 reconfigurable.hpp:9
Definition resource.hpp:23
Definition linear_algebra.hpp:15
Defines a Motor component.
Information about the physical base.
Definition base.hpp:29