6#include <grpcpp/channel.h>
8#include <viam/api/component/servo/v1/servo.grpc.pb.h>
11#include <viam/sdk/config/resource.hpp>
25 void move(uint32_t angle_deg,
const ProtoStruct& extra)
override;
27 void stop(
const ProtoStruct& extra)
override;
29 std::vector<GeometryConfig>
get_geometries(
const ProtoStruct& extra)
override;
30 ProtoStruct
do_command(
const ProtoStruct& command)
override;
37 using StubType = viam::component::servo::v1::ServoService::StubInterface;
38 std::unique_ptr<StubType> stub_;
39 std::shared_ptr<grpc::Channel> channel_;
virtual std::string name() const
Return the resource's name.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling servo.
Definition servo.hpp:61
void move(uint32_t angle_deg)
Move the servo to the provided angle.
Definition servo.hpp:31
position get_position()
Get the current angle (degrees) of the servo.
Definition servo.hpp:42
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
gRPC client implementation of a Servo component.
Definition servo_client.hpp:21
position get_position(const ProtoStruct &extra) override
Reports the position of the robot's servo relative to its zero position.
bool is_moving() override
Reports if a component is in motion.
void move(uint32_t angle_deg, const ProtoStruct &extra) override
Move the servo to the provided angle.
std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra) override
Returns GeometryConfigs associated with the calling servo.
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.
gRPC client implementation for a robot.
Defines a Servo component.
Current position of the motor relative to its home.