Viam C++ SDK current
Loading...
Searching...
No Matches
base_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/base/v1/base.grpc.pb.h>
8#include <viam/api/component/base/v1/base.pb.h>
9
12#include <viam/sdk/resource/resource_server_base.hpp>
13
14namespace viam {
15namespace sdk {
16namespace impl {
17
21class BaseServer : public ResourceServer, public viam::component::base::v1::BaseService::Service {
22 public:
23 using interface_type = Base;
24 using service_type = component::base::v1::BaseService;
25 explicit BaseServer(std::shared_ptr<ResourceManager> manager);
26
27 ::grpc::Status MoveStraight(
28 ::grpc::ServerContext* context,
29 const ::viam::component::base::v1::MoveStraightRequest* request,
30 ::viam::component::base::v1::MoveStraightResponse* response) noexcept override;
31
32 ::grpc::Status Spin(::grpc::ServerContext* context,
33 const ::viam::component::base::v1::SpinRequest* request,
34 ::viam::component::base::v1::SpinResponse* response) noexcept override;
35
36 ::grpc::Status SetPower(
37 ::grpc::ServerContext* context,
38 const ::viam::component::base::v1::SetPowerRequest* request,
39 ::viam::component::base::v1::SetPowerResponse* response) noexcept override;
40
41 ::grpc::Status SetVelocity(
42 ::grpc::ServerContext* context,
43 const ::viam::component::base::v1::SetVelocityRequest* request,
44 ::viam::component::base::v1::SetVelocityResponse* response) noexcept override;
45
46 ::grpc::Status Stop(::grpc::ServerContext* context,
47 const ::viam::component::base::v1::StopRequest* request,
48 ::viam::component::base::v1::StopResponse* response) noexcept override;
49
50 ::grpc::Status IsMoving(
51 ::grpc::ServerContext* context,
52 const ::viam::component::base::v1::IsMovingRequest* request,
53 ::viam::component::base::v1::IsMovingResponse* response) noexcept override;
54
55 ::grpc::Status GetGeometries(
56 ::grpc::ServerContext* context,
57 const ::viam::common::v1::GetGeometriesRequest* request,
58 ::viam::common::v1::GetGeometriesResponse* response) noexcept override;
59
60 ::grpc::Status GetProperties(
61 ::grpc::ServerContext* context,
62 const ::viam::component::base::v1::GetPropertiesRequest* request,
63 ::viam::component::base::v1::GetPropertiesResponse* response) noexcept override;
64
65 ::grpc::Status DoCommand(grpc::ServerContext* context,
66 const viam::common::v1::DoCommandRequest* request,
67 viam::common::v1::DoCommandResponse* response) noexcept override;
68};
69
70} // namespace impl
71} // namespace sdk
72} // namespace viam
Defines a Base component.
A Base is the platform that the other parts of a mobile robot attach to.
Definition base.hpp:25
Definition resource_server_base.hpp:8
gRPC server implementation of a Base component.
Definition base_server.hpp:21
Defines a general-purpose resource manager.