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 <viam/api/component/gantry/v1/gantry.grpc.pb.h>
7
9#include <viam/sdk/rpc/dial.hpp>
10
11namespace viam {
12namespace sdk {
13namespace impl {
14
18class GantryClient : public Gantry {
19 public:
20 using interface_type = Gantry;
21 GantryClient(std::string name, const ViamChannel& channel);
22
23 const ViamChannel& channel() const {
24 return *channel_;
25 }
26
27 std::vector<double> get_position(const ProtoStruct& extra) override;
28 void move_to_position(const std::vector<movement_coordinate>& coordinates,
29 const ProtoStruct& extra) override;
30 bool home(const ProtoStruct& extra) override;
31 std::vector<double> get_lengths(const ProtoStruct& extra) override;
32 bool is_moving() override;
33 void stop(const ProtoStruct& extra) override;
34 ProtoStruct do_command(const ProtoStruct& command) override;
35 ProtoStruct get_status() override;
36 std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) override;
38 const ProtoStruct& extra) override;
39// Overriding the deprecated raw-bytes accessor keeps older servers readable.
40#pragma GCC diagnostic push
41#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
42 KinematicsData get_kinematics(const ProtoStruct& extra) override;
43#pragma GCC diagnostic pop
44
49 using Gantry::home;
51 using Gantry::stop;
52
53 private:
54 using StubType = viam::component::gantry::v1::GantryService::StubInterface;
55 std::unique_ptr<StubType> stub_;
56 const ViamChannel* channel_;
57};
58
59} // namespace impl
60} // namespace sdk
61} // namespace viam
A Gantry represents a physical gantry and can be used for controlling gantries of N axes.
Definition gantry.hpp:21
virtual KinematicModel get_kinematic_model(const kinematics_options &options, const ProtoStruct &extra)=0
Get the kinematic model of the gantry.
std::vector< double > get_position()
Get the positions of the axes of the gantry in millimeters.
Definition gantry.hpp:36
bool home()
Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.
Definition gantry.hpp:63
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:48
std::vector< double > get_lengths()
Get the lengths of the axes of the gantry in millimeters.
Definition gantry.hpp:74
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling gantry.
Definition gantry.hpp:95
virtual std::string name() const
Return the resource's name.
void stop()
Stops a resource from running.
Definition stoppable.hpp:16
Definition dial.hpp:24
gRPC client implementation of a Gantry component.
Definition gantry_client.hpp:18
std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra) override
Returns GeometryConfigs associated with the calling gantry.
bool is_moving() override
Reports if the gantry is in motion.
ProtoStruct get_status() override
Get the status of the gantry.
KinematicModel get_kinematic_model(const kinematics_options &options, const ProtoStruct &extra) override
Get the kinematic model of the gantry.
KinematicsData get_kinematics(const ProtoStruct &extra) override
Get the kinematics data associated with the gantry as a raw file.
void move_to_position(const std::vector< movement_coordinate > &coordinates, const ProtoStruct &extra) override
Move the axes of the gantry to the desired positions (mm) at the requested speeds (mm/sec).
void stop(const ProtoStruct &extra) override
Stops a resource from running.
bool home(const ProtoStruct &extra) override
Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.
std::vector< double > get_lengths(const ProtoStruct &extra) override
Get the lengths of the axes of the gantry in millimeters.
ProtoStruct do_command(const ProtoStruct &command) override
Send/receive arbitrary commands to the resource.
std::vector< double > get_position(const ProtoStruct &extra) override
Get the positions of the axes of the gantry in millimeters.
Defines a Gantry component.
A component's kinematics as a tree of links and joints. Its proto JSON encoding is also the on-disk k...
Definition kinematics.hpp:154
Definition pose.hpp:20
Options for a GetKinematics request.
Definition kinematics.hpp:39