Viam C++ SDK current
Loading...
Searching...
No Matches
gantry_client.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <grpcpp/channel.h>
7
8#include <viam/api/component/gantry/v1/gantry.grpc.pb.h>
9
11
12namespace viam {
13namespace sdk {
14namespace impl {
15
19class GantryClient : public Gantry {
20 public:
21 using interface_type = Gantry;
22 GantryClient(std::string names, std::shared_ptr<grpc::Channel> channel);
23
24 std::vector<double> get_position(const AttributeMap& extra) override;
25 void move_to_position(const std::vector<movement_coordinate>& coordinates,
26 const AttributeMap& extra) override;
27 bool home(const AttributeMap& extra) override;
28 std::vector<double> get_lengths(const AttributeMap& extra) override;
29 bool is_moving() override;
30 void stop(const AttributeMap& extra) override;
31 AttributeMap do_command(const AttributeMap& command) override;
32 std::vector<GeometryConfig> get_geometries(const AttributeMap& extra) override;
33
37 using Gantry::home;
39 using Gantry::stop;
40
41 private:
42 using StubType = viam::component::gantry::v1::GantryService::StubInterface;
43 std::unique_ptr<StubType> stub_;
44 std::shared_ptr<grpc::Channel> channel_;
45};
46
47} // namespace impl
48} // namespace sdk
49} // namespace viam
A Gantry represents a physical gantry and can be used for controlling gantries of N axes.
Definition gantry.hpp:23
std::vector< double > get_position()
Get the positions of the axes of the gantry in millimeters.
Definition gantry.hpp:38
bool home()
Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.
Definition gantry.hpp:65
void move_to_position(const std::vector< movement_coordinate > &coordinates)
Move the axes of the gantry to the desired positions (mm) at the requested speeds (mm/sec).
Definition gantry.hpp:50
std::vector< double > get_lengths()
Get the lengths of the axes of the gantry in millimeters.
Definition gantry.hpp:76
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling gantry.
Definition gantry.hpp:93
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
gRPC client implementation of a Gantry component.
Definition gantry_client.hpp:19
bool home(const AttributeMap &extra) override
Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.
bool is_moving() override
Reports if the gantry is in motion.
void move_to_position(const std::vector< movement_coordinate > &coordinates, const AttributeMap &extra) override
Move the axes of the gantry to the desired positions (mm) at the requested speeds (mm/sec).
std::vector< double > get_position(const AttributeMap &extra) override
Get the positions of the axes of the gantry in millimeters.
void stop(const AttributeMap &extra) override
Stops a resource from running.
std::vector< GeometryConfig > get_geometries(const AttributeMap &extra) override
Returns GeometryConfigs associated with the calling gantry.
AttributeMap do_command(const AttributeMap &command) override
Send/receive arbitrary commands to the resource.
std::vector< double > get_lengths(const AttributeMap &extra) override
Get the lengths of the axes of the gantry in millimeters.
Defines a Gantry component.
Definition pose.hpp:8