Gantry API | Component APIs
Gantry API
The gantry API allows you to give commands to your gantry components for coordinated control of one or more linear actuators.
The gantry component supports the following methods:
| Method Name | Description |
|---|---|
GetPosition |
Get the current positions of the axis of the gantry (mm). |
MoveToPosition |
Move the axes of the gantry to the desired positions (mm) at the requested speeds (mm/sec). |
GetLengths |
Get the lengths of the axes of the gantry (mm). |
Home |
Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches. |
GetGeometries |
Get all the geometries associated with the gantry in its current configuration, in the frame of the gantry. |
IsMoving |
Get if the gantry is currently moving. |
Stop |
Stop all motion of the gantry. |
Reconfigure |
Reconfigure this resource. |
DoCommand |
Execute model-specific commands that are not otherwise defined by the component API. |
GetKinematics |
Get the kinematics information associated with the gantry. |
GetResourceName |
Get the ResourceName for this gantry. |
Close |
Safely shut down the resource and prevent further use. |
API
GetPosition
Get the current positions of the axis of the gantry (mm).
Parameters:
extra(Mapping[ str, Any]) (optional): Extra options to pass to the underlying RPC call.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- (List[ float]): : A list of the position of the axes of the gantry in millimeters.
Example:
For more information, see the Python SDK Docs.
Parameters:
ctx(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.extra(map[string]interface{}): Extra options to pass to the underlying RPC call.
Returns:
- [(float64)]: A list of the position of the axes of the gantry in millimeters.
- (error): An error, if one occurred.
Example:
For more information, see the Go SDK Docs.
Parameters:
extra(None) (optional)callOptions(CallOptions) (optional)
Returns:
- (Promise<number[]>): A list of the current position of each axis in millimeters.
Example:
For more information, see the TypeScript SDK Docs.
Parameters:
Returns:
Example:
For more information, see the Flutter SDK Docs.
MoveToPosition
Move the axes of the gantry to the desired positions (mm) at the requested speeds (mm/sec).
Parameters:
positions(List[ float]) (required): A list of positions for the axes of the gantry to move to, in millimeters.speeds(List[ float]) (required): A list of speeds in millimeters per second for the gantry to move at respective to each axis.extra(Mapping[ str, Any]) (optional): Extra options to pass to the underlying RPC call.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- None.
Example:
For more information, see the Python SDK Docs.
Parameters:
ctx(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.positionsMm(float64): A list of positions for the axes of the gantry to move to, in millimeters.speedsMmPerSec(float64): A list of speeds in millimeters per second for the gantry to move at respective to each axis.extra(map[string]interface{}): Extra options to pass to the underlying RPC call.
Returns:
- (error): An error, if one occurred.
Example:
For more information, see the Go SDK Docs.
Parameters:
positionsMm(number) (required): The goal positions for each axis of the gantry.speedsMmPerSec(number) (required): The desired speed for each axis to move to the respective position in positionsMm.extra(None) (optional)callOptions(CallOptions) (optional)
Returns:
- (Promise)
Example:
For more information, see the TypeScript SDK Docs.
Parameters:
positionsList < double > (required)speedsList < double > (required)extraMap < String, dynamic>? (optional)
Returns:
Example:
For more information, see the Flutter SDK Docs.
GetLengths
Get the lengths of the axes of the gantry (mm).
Parameters:
Returns:
- (List[ float]): : A list of the lengths of the axes of the gantry in millimeters.
Example:
For more information, see the Python SDK Docs.
Parameters:
Returns:
- (float64): A list of the lengths of the axes of the gantry in millimeters.
- (error): An error, if one occurred.
Example:
For more information, see the Go SDK Docs.
Parameters:
extra(None) (optional)callOptions(CallOptions) (optional)
Returns:
- (Promise<number[]>): A list of the length of each axis in millimeters.
Example:
For more information, see the TypeScript SDK Docs.
Parameters:
Returns:
Example:
For more information, see the Flutter SDK Docs.
Home
Run the homing sequence of the gantry to re-calibrate the axes with respect to the limit switches.
Parameters:
Returns:
- ( bool): : Whether the gantry has run the homing sequence successfully.
Example:
For more information, see the Python SDK Docs.
Parameters:
Returns:
- (bool): Whether the gantry has run the homing sequence successfully.
- (error): An error, if one occurred.
Example:
For more information, see the Go SDK Docs.
Parameters:
extra(None) (optional)callOptions(CallOptions) (optional)
Returns:
- (Promise): A bool representing whether the gantry has run the homing sequence successfully.
Example:
For more information, see the TypeScript SDK Docs.
Parameters:
Returns:
Example:
For more information, see the Flutter SDK Docs.
GetGeometries
Get all the geometries associated with the gantry in its current configuration, in the frame of the gantry. The motion and navigation services use the relative position of inherent geometries to configured geometries representing obstacles for collision detection and obstacle avoidance while motion planning.
Parameters:
Returns:
- ( List[viam.proto.common.Geometry]): : The geometries associated with the Component.
Example:
For more information, see the Python SDK Docs.
Parameters:
extra(None) (optional)callOptions(CallOptions) (optional)
Returns:
Example:
For more information, see the TypeScript SDK Docs.
IsMoving
Get if the gantry is currently moving.
Parameters:
timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- ( bool): : Whether the gantry is moving.
Example:
For more information, see the Python SDK Docs.
Parameters:
ctx(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
Returns:
Example:
For more information, see the Go SDK Docs.
Parameters:
callOptions(CallOptions) (optional)
Returns:
- (Promise)
Example:
For more information, see the TypeScript SDK Docs.
Parameters:
- None.
Returns:
Example:
For more information, see the Flutter SDK Docs.
Stop
Stop all motion of the gantry.
Parameters:
Returns:
- None.
Example:
For more information, see the Python SDK Docs.
Parameters:
Returns:
- (error): An error, if one occurred.
Example:
For more information, see the Go SDK Docs.
Parameters:
extra(None) (optional)callOptions(CallOptions) (optional)
Returns:
- (Promise)
Example:
For more information, see the TypeScript SDK Docs.
Parameters:
Returns:
Example:
For more information, see the Flutter SDK Docs.
Reconfigure
Reconfigure this resource. Reconfigure must reconfigure the resource atomically and in place.
Parameters:
ctx(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.deps(Dependencies): The resource dependencies.conf(Config): The resource configuration.
Returns:
- (error): An error, if one occurred.
For more information, see the Go SDK Docs.
DoCommand
Execute model-specific commands that are not otherwise defined by the component API. Most models do not implement DoCommand. Any available model-specific commands should be covered in the model's documentation. If you are implementing your own gantry and want to add features that have no corresponding built-in API method, you can implement them with DoCommand.
Parameters:
command(Mapping[ str, ValueTypes]) (required): The command to execute.timeout( float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.
Returns:
- (Mapping[ str, viam.utils.ValueTypes]): : Result of the executed command.
Raises:
- (NotImplementedError): Raised if the Resource does not support arbitrary commands.
Example:
For more information, see the Python SDK Docs.
Parameters:
ctx(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.cmd(map[string]interface{}): The command to execute.
Returns:
- (map[string]interface{}): The command response.
- (error): An error, if one occurred.
Example:
For more information, see the Go SDK Docs.
Parameters:
command( Struct) (required): The command to execute. Accepts either a Struct or a plain object, which will be converted automatically.callOptions(CallOptions) (optional)
Returns:
- (Promise< JsonValue >)
Example:
For more information, see the TypeScript SDK Docs.
Parameters:
Returns:
Example:
For more information, see the Flutter SDK Docs.
GetKinematics
Get the kinematics information associated with the gantry.
Parameters:
Returns:
- ( viam.components.KinematicsReturn): : A tuple containing two values; the first [0] value represents the format of the file, either in URDF format (
KinematicsFileFormat.KINEMATICS_FILE_FORMAT_URDF) or Viam’s kinematic parameter format (spatial vector algebra) (KinematicsFileFormat.KINEMATICS_FILE_FORMAT_SVA), and the second [1] value represents the byte contents of the file. If available, a third [2] value provides meshes keyed by URDF filepath.
Example:
For more information, see the Python SDK Docs.
Parameters:
Returns:
- (referenceframe.Model): The kinematics model of the resource.
- (error): An error, if one occurred.
For more information, see the Go SDK Docs.
GetResourceName
Get the ResourceName for this gantry.
Parameters:
name( str) (required): The name of the Resource.
Returns:
- ( viam.proto.common.ResourceName): : The ResourceName of this Resource.
Example:
For more information, see the Python SDK Docs.
Parameters:
- None.
Returns:
Example:
For more information, see the Go SDK Docs.
Parameters:
- None.
Returns:
- (string): The name of the resource.
Example:
For more information, see the TypeScript SDK Docs.
Parameters:
nameString (required)
Returns:
Example:
For more information, see the Flutter SDK Docs.
Close
Safely shut down the resource and prevent further use.
Parameters:
- None.
Returns:
- None.
Example:
For more information, see the Python SDK Docs.
Parameters:
ctx(Context): A Context carries a deadline, a cancellation signal, and other values across API boundaries.
Returns:
- (error): An error, if one occurred.
Example:
For more information, see the Go SDK Docs.