Viam C++ SDK current
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | List of all members
viam::sdk::Gantry Class Referenceabstract

A Gantry represents a physical gantry and can be used for controlling gantries of N axes. More...

#include "components/gantry.hpp"

+ Inheritance diagram for viam::sdk::Gantry:

Classes

struct  movement_coordinate
 A coordinate for moving a single axis of a gantry to a desired position at a requested speed. More...
 

Public Member Functions

std::vector< double > get_position ()
 Get the positions of the axes of the gantry in millimeters.
 
virtual std::vector< double > get_position (const ProtoStruct &extra)=0
 Get the positions of the axes of the gantry in millimeters.
 
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).
 
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).
 
bool home ()
 Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.
 
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_lengths ()
 Get the lengths of the axes of the gantry in millimeters.
 
virtual std::vector< double > get_lengths (const ProtoStruct &extra)=0
 Get the lengths of the axes of the gantry in millimeters.
 
virtual bool is_moving ()=0
 Reports if the gantry is in motion.
 
virtual ProtoStruct get_status ()=0
 Get the status of the gantry.
 
virtual ProtoStruct do_command (const ProtoStruct &command)=0
 Send/receive arbitrary commands to the resource.
 
std::vector< GeometryConfig > get_geometries ()
 Returns GeometryConfigs associated with the calling gantry.
 
virtual std::vector< GeometryConfig > get_geometries (const ProtoStruct &extra)=0
 Returns GeometryConfigs associated with the calling gantry.
 
virtual KinematicModel get_kinematic_model (const kinematics_options &options, const ProtoStruct &extra)=0
 Get the kinematic model of the gantry.
 
KinematicModel get_kinematic_model (const kinematics_options &options={})
 Get the kinematic model of the gantry.
 
virtual KinematicsData get_kinematics (const ProtoStruct &extra)
 Get the kinematics data associated with the gantry as a raw file.
 
KinematicsData get_kinematics ()
 Get the kinematics data associated with the gantry as a raw file.
 
API api () const override
 Returns the API associated with a particular resource.
 
- Public Member Functions inherited from viam::sdk::Component
Name get_resource_name () const override
 Returns the Name for a particular resource.
 
- Public Member Functions inherited from viam::sdk::Resource
 Resource (std::string name)
 
 Resource (const ResourceConfig &cfg)
 Construct from a resource config. Use this overload to ensure Viam App log filtering works immediately during object construction.
 
virtual std::string name () const
 Return the resource's name.
 
void set_log_level (log_level) const
 Set the log level for log messages originating from this Resource.
 
- Public Member Functions inherited from viam::sdk::Stoppable
virtual void stop (const ProtoStruct &extra)=0
 Stops a resource from running.
 
void stop ()
 Stops a resource from running.
 

Protected Member Functions

 Component ()
 
 Component (std::string name)
 
 Component (const ResourceConfig &cfg)
 
- Protected Member Functions inherited from viam::sdk::Component
 Component (std::string name)
 
 Component (const ResourceConfig &cfg)
 
- Protected Member Functions inherited from viam::sdk::Resource
Name get_resource_name (const std::string &type) const
 

Additional Inherited Members

- Protected Attributes inherited from viam::sdk::Resource
LogSource logger_
 

Detailed Description

A Gantry represents a physical gantry and can be used for controlling gantries of N axes.

This acts as an abstract parent class to be inherited from by any drivers representing specific gantry implementations. This class cannot be used on its own.

Member Function Documentation

◆ api()

API viam::sdk::Gantry::api ( ) const
overridevirtual

Returns the API associated with a particular resource.

Implements viam::sdk::Resource.

◆ do_command()

virtual ProtoStruct viam::sdk::Gantry::do_command ( const ProtoStruct & command)
pure virtual

Send/receive arbitrary commands to the resource.

Parameters
Commandthe command to execute.
Returns
The result of the executed command.

Implemented in viam::sdk::impl::GantryClient.

◆ get_geometries()

virtual std::vector< GeometryConfig > viam::sdk::Gantry::get_geometries ( const ProtoStruct & extra)
pure virtual

Returns GeometryConfigs associated with the calling gantry.

Parameters
extraAny additional arguments to the method

Implemented in viam::sdk::impl::GantryClient, and viam::sdk::impl::GantryClient.

◆ get_kinematic_model() [1/2]

virtual KinematicModel viam::sdk::Gantry::get_kinematic_model ( const kinematics_options & options,
const ProtoStruct & extra )
pure virtual

Get the kinematic model of the gantry.

Parameters
optionsWhich mesh payloads to include in the response.
extraAny additional arguments to the method.
Returns
The gantry's links, joints and output frames.

Implemented in viam::sdk::impl::GantryClient, and viam::sdk::impl::GantryClient.

◆ get_kinematic_model() [2/2]

KinematicModel viam::sdk::Gantry::get_kinematic_model ( const kinematics_options & options = {})
inline

Get the kinematic model of the gantry.

Parameters
optionsWhich mesh payloads to include in the response.
Returns
The gantry's links, joints and output frames.

◆ get_kinematics() [1/2]

KinematicsData viam::sdk::Gantry::get_kinematics ( )

Get the kinematics data associated with the gantry as a raw file.

Returns
A variant of kinematics data, with the type indicating the format of the data.

◆ get_kinematics() [2/2]

virtual KinematicsData viam::sdk::Gantry::get_kinematics ( const ProtoStruct & extra)
virtual

Get the kinematics data associated with the gantry as a raw file.

Parameters
extraAny additional arguments to the method.
Returns
A variant of kinematics data; URDF variants may include meshes by filepath.
Exceptions
Exceptionwith ErrorCondition::k_not_supported unless overridden.

Reimplemented in viam::sdk::impl::GantryClient.

◆ get_lengths()

virtual std::vector< double > viam::sdk::Gantry::get_lengths ( const ProtoStruct & extra)
pure virtual

Get the lengths of the axes of the gantry in millimeters.

Parameters
extraAny additional arguments to the method

Implemented in viam::sdk::impl::GantryClient, and viam::sdk::impl::GantryClient.

◆ get_position()

virtual std::vector< double > viam::sdk::Gantry::get_position ( const ProtoStruct & extra)
pure virtual

Get the positions of the axes of the gantry in millimeters.

Parameters
extraAny additional arguments to the method

Implemented in viam::sdk::impl::GantryClient, and viam::sdk::impl::GantryClient.

◆ get_status()

virtual ProtoStruct viam::sdk::Gantry::get_status ( )
pure virtual

Get the status of the gantry.

Returns
A ProtoStruct containing the status of the gantry.

Implemented in viam::sdk::impl::GantryClient.

◆ home() [1/2]

bool viam::sdk::Gantry::home ( )
inline

Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.

Returns
Whether the gantry has run the homing sequence successfully.

◆ home() [2/2]

virtual bool viam::sdk::Gantry::home ( const ProtoStruct & extra)
pure virtual

Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.

Parameters
extraAny additional arguments to the method
Returns
Whether the gantry has run the homing sequence successfully.

Implemented in viam::sdk::impl::GantryClient, and viam::sdk::impl::GantryClient.

◆ is_moving()

virtual bool viam::sdk::Gantry::is_moving ( )
pure virtual

Reports if the gantry is in motion.

Implemented in viam::sdk::impl::GantryClient.

◆ move_to_position() [1/2]

void viam::sdk::Gantry::move_to_position ( const std::vector< movement_coordinate > & coordinates)
inline

Move the axes of the gantry to the desired positions (mm) at the requested speeds (mm/sec).

Parameters
coordinatesA vector whose entries represent the position and speed pairs for each axis.

◆ move_to_position() [2/2]

virtual void viam::sdk::Gantry::move_to_position ( const std::vector< movement_coordinate > & coordinates,
const ProtoStruct & extra )
pure virtual

Move the axes of the gantry to the desired positions (mm) at the requested speeds (mm/sec).

Parameters
coordinatesA vector whose entries represent the position and speed pairs for each axis.
extraAny additional arguments to the method

Implemented in viam::sdk::impl::GantryClient, and viam::sdk::impl::GantryClient.


The documentation for this class was generated from the following file: