Viam C++ SDK current
Loading...
Searching...
No Matches
gantry.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <viam/sdk/resource/stoppable.hpp>
7
8namespace viam {
9namespace sdk {
10
12
20class Gantry : public Component, public Stoppable {
21 public:
28
32 };
33
35 inline std::vector<double> get_position() {
36 return get_position({});
37 }
38
41 virtual std::vector<double> get_position(const ProtoStruct& extra) = 0;
42
47 inline void move_to_position(const std::vector<movement_coordinate>& coordinates) {
49 }
50
56 virtual void move_to_position(const std::vector<movement_coordinate>& coordinates,
57 const ProtoStruct& extra) = 0;
58
62 inline bool home() {
63 return home({});
64 }
65
70 virtual bool home(const ProtoStruct& extra) = 0;
71
73 inline std::vector<double> get_lengths() {
74 return get_lengths({});
75 }
76
79 virtual std::vector<double> get_lengths(const ProtoStruct& extra) = 0;
80
82 virtual bool is_moving() = 0;
83
87 virtual ProtoStruct do_command(const ProtoStruct& command) = 0;
88
90 inline std::vector<GeometryConfig> get_geometries() {
91 return get_geometries({});
92 }
93
96 virtual std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) = 0;
97
98 API api() const override;
99
100 protected:
101 using Component::Component;
102};
103
104template <>
106 static API api();
107};
108
109} // namespace sdk
110} // namespace viam
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
Definition component.hpp:10
A Gantry represents a physical gantry and can be used for controlling gantries of N axes.
Definition gantry.hpp:20
virtual void move_to_position(const std::vector< movement_coordinate > &coordinates, const ProtoStruct &extra)=0
Move the axes of the gantry to the desired positions (mm) at the requested speeds (mm/sec).
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
virtual bool home(const ProtoStruct &extra)=0
Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.
std::vector< double > get_position()
Get the positions of the axes of the gantry in millimeters.
Definition gantry.hpp:35
virtual bool is_moving()=0
Reports if the gantry is in motion.
bool home()
Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.
Definition gantry.hpp:62
virtual std::vector< double > get_position(const ProtoStruct &extra)=0
Get the positions of the axes of the gantry in millimeters.
virtual std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra)=0
Returns GeometryConfigs associated with the calling gantry.
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:47
std::vector< double > get_lengths()
Get the lengths of the axes of the gantry in millimeters.
Definition gantry.hpp:73
virtual std::vector< double > get_lengths(const ProtoStruct &extra)=0
Get the lengths of the axes of the gantry in millimeters.
API api() const override
Returns the API associated with a particular resource.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling gantry.
Definition gantry.hpp:90
Definition stoppable.hpp:8
Definition resource_api.hpp:50
A coordinate for moving a single axis of a gantry to a desired position at a requested speed.
Definition gantry.hpp:25
double speed_mm_per_sec
A speed in millimeters per second for the gantry to move at respective to the axis.
Definition gantry.hpp:31
double position_mm
A position for the axis of the gantry to move to, in millimeters.
Definition gantry.hpp:27
Definition pose.hpp:8