6#include <grpcpp/channel.h>
8#include <viam/api/component/servo/v1/servo.grpc.pb.h>
12#include <viam/sdk/config/resource.hpp>
26 void move(uint32_t angle_deg,
const AttributeMap& extra)
override;
28 void stop(
const AttributeMap& extra)
override;
30 std::vector<GeometryConfig>
get_geometries(
const AttributeMap& extra)
override;
31 AttributeMap
do_command(
const AttributeMap& command)
override;
38 using StubType = viam::component::servo::v1::ServoService::StubInterface;
39 std::unique_ptr<StubType> stub_;
40 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:66
void move(uint32_t angle_deg)
Move the servo to the provided angle.
Definition servo.hpp:36
position get_position()
Get the current angle (degrees) of the servo.
Definition servo.hpp:47
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
gRPC client implementation of a Servo component.
Definition servo_client.hpp:22
void move(uint32_t angle_deg, const AttributeMap &extra) override
Move the servo to the provided angle.
void stop(const AttributeMap &extra) override
Stops a resource from running.
bool is_moving() override
Reports if a component is in motion.
AttributeMap do_command(const AttributeMap &command) override
Send/receive arbitrary commands to the resource.
position get_position(const AttributeMap &extra) override
Reports the position of the robot's servo relative to its zero position.
std::vector< GeometryConfig > get_geometries(const AttributeMap &extra) override
Returns GeometryConfigs associated with the calling servo.
gRPC client implementation for a robot.
Defines a Servo component.
Implements a gRPC server for the Servo component.
Current position of the motor relative to its home.