8#include <viam/api/component/base/v1/base.pb.h>
10#include <viam/sdk/common/linear_algebra.hpp>
11#include <viam/sdk/common/proto_type.hpp>
12#include <viam/sdk/common/utils.hpp>
13#include <viam/sdk/config/resource.hpp>
14#include <viam/sdk/resource/stoppable.hpp>
33 double turning_radius_meters;
34 double wheel_circumference_meters;
36 static properties from_proto(
const component::base::v1::GetPropertiesResponse&
proto);
56 const AttributeMap& extra) = 0;
88 const AttributeMap& extra) = 0;
103 const AttributeMap& extra) = 0;
131 virtual std::vector<GeometryConfig>
get_geometries(
const AttributeMap& 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:27
virtual void set_velocity(const Vector3 &linear, const Vector3 &angular, const AttributeMap &extra)=0
Set the linear and angular velocity of a base.
virtual bool is_moving()=0
Reports if the base is in motion.
virtual void set_power(const Vector3 &linear, const Vector3 &angular, const AttributeMap &extra)=0
Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.
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:77
virtual void move_straight(int64_t distance_mm, double mm_per_sec, const AttributeMap &extra)=0
Move a robot's base in a straight line by a given distance. This method blocks until completed or can...
virtual std::vector< GeometryConfig > get_geometries(const AttributeMap &extra)=0
Returns GeometryConfigs associated with the calling base.
virtual properties get_properties(const AttributeMap &extra)=0
Returns physical properties of the base (width, turning radius, wheel circumference)
properties get_properties()
Returns physical properties of the base (width, turning radius, wheel circumference)
Definition base.hpp:109
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling base.
Definition base.hpp:124
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:45
virtual AttributeMap do_command(const AttributeMap &command)=0
Send/receive arbitrary commands to the resource.
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:62
void set_velocity(const Vector3 &linear, const Vector3 &angular)
Set the linear and angular velocity of a base.
Definition base.hpp:93
virtual void spin(double angle_deg, double degs_per_sec, const AttributeMap &extra)=0
Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or c...
API api() const override
Returns the API associated with a particular resource.
Definition client_helper.hpp:16
Definition component.hpp:14
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:31