Viam C++ SDK current
|
A Base
is the platform that the other parts of a mobile robot attach to.
More...
#include "components/base.hpp"
Classes | |
struct | properties |
Information about the physical base. More... | |
Public Member Functions | |
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 cancelled. | |
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 cancelled. | |
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 cancelled. | |
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 cancelled. | |
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. | |
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. | |
virtual void | set_velocity (const Vector3 &linear, const Vector3 &angular, const ProtoStruct &extra)=0 |
Set the linear and angular velocity of a base. | |
virtual bool | is_moving ()=0 |
Reports if the base is in motion. | |
properties | get_properties () |
Returns physical properties of the base (width, turning radius, wheel circumference) | |
virtual properties | get_properties (const ProtoStruct &extra)=0 |
Returns physical properties of the base (width, turning radius, wheel circumference) | |
virtual ProtoStruct | do_command (const ProtoStruct &command)=0 |
Send/receive arbitrary commands to the resource. | |
std::vector< GeometryConfig > | get_geometries () |
Returns GeometryConfig s associated with the calling base. | |
virtual std::vector< GeometryConfig > | get_geometries (const ProtoStruct &extra)=0 |
Returns GeometryConfig s associated with the calling base. | |
API | api () const override |
Returns the API associated with a particular resource. | |
Public Member Functions inherited from viam::sdk::Component | |
Name | get_resource_name () const override |
Returns the Name for a particular resource. | |
Public Member Functions inherited from viam::sdk::Resource | |
Resource (std::string name) | |
virtual std::string | name () const |
Return the resource's name. | |
Public Member Functions inherited from viam::sdk::Stoppable | |
virtual void | stop (const ProtoStruct &extra)=0 |
Stops a resource from running. | |
void | stop () |
Stops a resource from running. | |
Protected Member Functions | |
Base (std::string name) | |
Protected Member Functions inherited from viam::sdk::Component | |
Component (std::string name) | |
Protected Member Functions inherited from viam::sdk::Resource | |
Name | get_resource_name (const std::string &type) const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const properties &v) |
bool | operator== (const properties &lhs, const properties &rhs) |
Additional Inherited Members | |
Static Public Member Functions inherited from viam::sdk::Stoppable | |
static void | stop_if_stoppable (const std::shared_ptr< Resource > &resource, const ProtoStruct &extra) |
Stops a Resource if it is Stoppable. | |
static void | stop_if_stoppable (const std::shared_ptr< Resource > &resource) |
Stops a Resource if it is Stoppable. | |
A Base
is the platform that the other parts of a mobile robot attach to.
This acts as an abstract parent class to be inherited from by any drivers representing specific base implementations. This class cannot be used on its own.
|
overridevirtual |
Returns the API
associated with a particular resource.
Implements viam::sdk::Resource.
|
pure virtual |
Send/receive arbitrary commands to the resource.
Command | the command to execute. |
Implemented in MyBase, and viam::sdk::impl::BaseClient.
|
inline |
Returns GeometryConfig
s associated with the calling base.
GeometryConfig
s associated with the component.
|
pure virtual |
Returns GeometryConfig
s associated with the calling base.
extra | Any additional arguments to the method. |
GeometryConfig
s associated with the component. Implemented in MyBase, viam::sdk::impl::BaseClient, and viam::sdk::impl::BaseClient.
|
pure virtual |
Returns physical properties of the base (width, turning radius, wheel circumference)
extra | Any additional arguments to the method |
Implemented in MyBase, viam::sdk::impl::BaseClient, and viam::sdk::impl::BaseClient.
|
pure virtual |
Reports if the base is in motion.
Implemented in MyBase, and viam::sdk::impl::BaseClient.
|
inline |
Move a robot's base in a straight line by a given distance. This method blocks until completed or cancelled.
distance_mm | Desired travel distance in millimeters |
mm_per_sec | Desired travel velocity in millimeters/second |
|
pure virtual |
Move a robot's base in a straight line by a given distance. This method blocks until completed or cancelled.
distance_mm | Desired travel distance in millimeters |
mm_per_sec | Desired travel velocity in millimeters/second |
extra | Any additional arguments to the method |
Implemented in MyBase, viam::sdk::impl::BaseClient, and viam::sdk::impl::BaseClient.
Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.
linear | Desired linear power percentage (-1 <= % <= 1) for each direction |
angular | Desired angular power percentage (-1 <= % <= 1) for each direction |
|
pure virtual |
Sets the linear and angular power of a base -1 -> 1 in terms of power for each direction.
linear | Desired linear power percentage (-1 <= % <= 1) for each direction |
angular | Desired angular power percentage (-1 <= % <= 1) for each direction |
extra | Any additional arguments to the method |
Implemented in MyBase, viam::sdk::impl::BaseClient, and viam::sdk::impl::BaseClient.
Set the linear and angular velocity of a base.
linear | Desired linear velocity in mm per second for each direction |
angular | Desired angular velocity in degrees per second for each direction |
|
pure virtual |
Set the linear and angular velocity of a base.
linear | Desired linear velocity in mm per second for each direction |
angular | Desired angular velocity in degrees per second for each direction |
extra | Any additional arguments to the method |
Implemented in MyBase, viam::sdk::impl::BaseClient, and viam::sdk::impl::BaseClient.
|
inline |
Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or cancelled.
angle_deg | Desired angle |
degs_per_sec | Desired angular velocity |
|
pure virtual |
Spins a robot's base by an given angle, expressed in degrees. This method blocks until completed or cancelled.
angle_deg | Desired angle |
degs_per_sec | Desired angular velocity |
extra | Any additional arguments to the method |
Implemented in MyBase, viam::sdk::impl::BaseClient, and viam::sdk::impl::BaseClient.