6#include <grpcpp/channel.h>
8#include <viam/api/component/base/v1/base.grpc.pb.h>
10#include <viam/sdk/common/linear_algebra.hpp>
11#include <viam/sdk/common/proto_value.hpp>
14#include <viam/sdk/config/resource.hpp>
27 BaseClient(std::string
name, std::shared_ptr<grpc::Channel> channel);
28 void move_straight(int64_t distance_mm,
double mm_per_sec,
const ProtoStruct& extra)
override;
29 void spin(
double angle_deg,
double degs_per_sec,
const ProtoStruct& extra)
override;
32 const ProtoStruct& extra)
override;
35 const ProtoStruct& extra)
override;
36 void stop(
const ProtoStruct& extra)
override;
37 std::vector<GeometryConfig>
get_geometries(
const ProtoStruct& extra)
override;
40 ProtoStruct
do_command(
const ProtoStruct& command)
override;
60 using StubType = viam::component::base::v1::BaseService::StubInterface;
61 std::unique_ptr<StubType> stub_;
62 std::shared_ptr<grpc::Channel> channel_;
Defines a Base component.
Implements a gRPC server for the Base component.
A Base is the platform that the other parts of a mobile robot attach to.
Definition base.hpp:25
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
properties get_properties()
Returns physical properties of the base (width, turning radius, wheel circumference)
Definition base.hpp:105
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
void set_velocity(const Vector3 &linear, const Vector3 &angular)
Set the linear and angular velocity of a base.
Definition base.hpp:89
virtual std::string name() const
Return the resource's name.
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
Definition linear_algebra.hpp:15
gRPC client implementation of a Base component.
Definition base_client.hpp:24
void stop(const ProtoStruct &extra) override
Stops a resource from running.
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.
properties get_properties(const ProtoStruct &extra) override
Returns physical properties of the base (width, turning radius, wheel circumference)
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.
ProtoStruct do_command(const ProtoStruct &command) override
Send/receive arbitrary commands to the resource.
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...
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...
void set_velocity(const Vector3 &linear, const Vector3 &angular, const ProtoStruct &extra) override
Set the linear and angular velocity of a base.
gRPC client implementation for a robot.
Information about the physical base.
Definition base.hpp:29