Viam C++ SDK current
Loading...
Searching...
No Matches
encoder_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/encoder/v1/encoder.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::encoder::v1::EncoderService::Service {
22 public:
23 using interface_type = Encoder;
24 using service_type = component::encoder::v1::EncoderService;
25 explicit EncoderServer(std::shared_ptr<ResourceManager> manager);
26
27 ::grpc::Status GetPosition(
28 ::grpc::ServerContext* context,
29 const ::viam::component::encoder::v1::GetPositionRequest* request,
30 ::viam::component::encoder::v1::GetPositionResponse* response) noexcept override;
31
32 ::grpc::Status ResetPosition(
33 ::grpc::ServerContext* context,
34 const ::viam::component::encoder::v1::ResetPositionRequest* request,
35 ::viam::component::encoder::v1::ResetPositionResponse* response) noexcept override;
36
37 ::grpc::Status GetProperties(
38 ::grpc::ServerContext* context,
39 const ::viam::component::encoder::v1::GetPropertiesRequest* request,
40 ::viam::component::encoder::v1::GetPropertiesResponse* response) noexcept override;
41
42 ::grpc::Status GetGeometries(
43 ::grpc::ServerContext* context,
44 const ::viam::common::v1::GetGeometriesRequest* request,
45 ::viam::common::v1::GetGeometriesResponse* response) noexcept override;
46
47 ::grpc::Status DoCommand(grpc::ServerContext* context,
48 const viam::common::v1::DoCommandRequest* request,
49 viam::common::v1::DoCommandResponse* response) noexcept override;
50};
51
52} // namespace impl
53} // namespace sdk
54} // namespace viam
An encoder is a device that is hooked up to motors to report a position.
Definition encoder.hpp:21
Definition resource_server_base.hpp:8
gRPC server implementation of a Encoder component.
Definition encoder_server.hpp:21
Defines a Encoder component.
Defines a general-purpose resource manager.