Viam C++ SDK current
Loading...
Searching...
No Matches
motor_server.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <viam/api/common/v1/common.pb.h>
7#include <viam/api/component/motor/v1/motor.grpc.pb.h>
8
11#include <viam/sdk/resource/resource_server_base.hpp>
12
13namespace viam {
14namespace sdk {
15namespace impl {
16
21 public viam::component::motor::v1::MotorService::Service {
22 public:
23 using interface_type = Motor;
24 using service_type = component::motor::v1::MotorService;
25 explicit MotorServer(std::shared_ptr<ResourceManager> manager);
26
27 ::grpc::Status SetPower(
28 ::grpc::ServerContext* context,
29 const ::viam::component::motor::v1::SetPowerRequest* request,
30 ::viam::component::motor::v1::SetPowerResponse* response) noexcept override;
31
32 ::grpc::Status GoFor(::grpc::ServerContext* context,
33 const ::viam::component::motor::v1::GoForRequest* request,
34 ::viam::component::motor::v1::GoForResponse* response) noexcept override;
35
36 ::grpc::Status GoTo(::grpc::ServerContext* context,
37 const ::viam::component::motor::v1::GoToRequest* request,
38 ::viam::component::motor::v1::GoToResponse* response) noexcept override;
39
40 ::grpc::Status SetRPM(::grpc::ServerContext* context,
41 const ::viam::component::motor::v1::SetRPMRequest* request,
42 ::viam::component::motor::v1::SetRPMResponse* response) noexcept override;
43
44 ::grpc::Status ResetZeroPosition(
45 ::grpc::ServerContext* context,
46 const ::viam::component::motor::v1::ResetZeroPositionRequest* request,
47 ::viam::component::motor::v1::ResetZeroPositionResponse* response) noexcept override;
48
49 ::grpc::Status GetPosition(
50 ::grpc::ServerContext* context,
51 const ::viam::component::motor::v1::GetPositionRequest* request,
52 ::viam::component::motor::v1::GetPositionResponse* response) noexcept override;
53
54 ::grpc::Status GetProperties(
55 ::grpc::ServerContext* context,
56 const ::viam::component::motor::v1::GetPropertiesRequest* request,
57 ::viam::component::motor::v1::GetPropertiesResponse* response) noexcept override;
58
59 ::grpc::Status Stop(::grpc::ServerContext* context,
60 const ::viam::component::motor::v1::StopRequest* request,
61 ::viam::component::motor::v1::StopResponse* response) noexcept override;
62
63 ::grpc::Status IsPowered(
64 ::grpc::ServerContext* context,
65 const ::viam::component::motor::v1::IsPoweredRequest* request,
66 ::viam::component::motor::v1::IsPoweredResponse* response) noexcept override;
67
68 ::grpc::Status IsMoving(
69 ::grpc::ServerContext* context,
70 const ::viam::component::motor::v1::IsMovingRequest* request,
71 ::viam::component::motor::v1::IsMovingResponse* response) noexcept override;
72
73 ::grpc::Status GetGeometries(
74 ::grpc::ServerContext* context,
75 const ::viam::common::v1::GetGeometriesRequest* request,
76 ::viam::common::v1::GetGeometriesResponse* response) noexcept override;
77
78 ::grpc::Status DoCommand(grpc::ServerContext* context,
79 const viam::common::v1::DoCommandRequest* request,
80 viam::common::v1::DoCommandResponse* response) noexcept override;
81};
82
83} // namespace impl
84} // namespace sdk
85} // namespace viam
A Motor represents physical hardware that controls the rotation of an axle.
Definition motor.hpp:22
Definition resource_server_base.hpp:8
gRPC server implementation of a Motor component.
Definition motor_server.hpp:21
Defines a Motor component.
Defines a general-purpose resource manager.