Skip to content

Cartesian

This module holds the base class for cartesian mover tools.

CLASS DESCRIPTION
Gantry

Gantry provides controls for a general cartesian robot.

Documentation last updated: 2025-02-22

Gantry

Gantry(
    port: str,
    limits: Sequence[Sequence[float]] = (
        (0, 0, 0),
        (0, 0, 0),
    ),
    *,
    robot_position: Position = Position(),
    home_position: Position = Position(),
    tool_offset: Position = Position(),
    calibrated_offset: Position = Position(),
    scale: float = 1.0,
    deck: Deck | None = None,
    safe_height: float | None = None,
    saved_positions: dict | None = None,
    speed_max: float | None = None,
    device_type_name: str = "GRBL",
    baudrate: int = 115200,
    movement_buffer: int | None = None,
    movement_timeout: int | None = None,
    verbose: bool = False,
    simulation: bool = False,
    **kwargs,
)

Bases: GCode

Gantry provides controls for a general cartesian robot.

ATTRIBUTE DESCRIPTION
limits

lower and upper limits of gantry

TYPE: ndarray

movement_buffer

buffer time after movement

TYPE: int

movement_timeout

timeout for movement

TYPE: int

connection_details

connection details for the device

TYPE: dict

device

device object that communicates with physical tool

TYPE: Device

flags

flags for the class

TYPE: SimpleNamespace[str, bool]

is_busy

whether the device is busy

TYPE: bool

is_connected

whether the device is connected

TYPE: bool

verbose

verbosity of class

TYPE: bool

deck

Deck object for workspace

TYPE: Deck

workspace

workspace bounding box

TYPE: BoundingBox

safe_height

safe height in terms of robot coordinate system

TYPE: float

saved_positions

dictionary of saved positions

TYPE: dict

speed

travel speed of robot

TYPE: float

speed_factor

fraction of maximum travel speed of robot

TYPE: float

speed_max

maximum speed of robot in mm/min

TYPE: float

robot_position

current position of the robot

TYPE: Position

home_position

home position of the robot in terms of robot coordinate system

TYPE: Position

tool_offset

tool offset from robot to end effector

TYPE: Position

calibrated_offset

calibrated offset from robot to work position

TYPE: Position

scale

factor to scale the basis vectors by

TYPE: float

tool_position

robot position of the tool end effector

TYPE: Position

work_position

work position of the robot

TYPE: Position

worktool_position

work position of the tool end effector

TYPE: Position

position

work position of the tool end effector; alias for worktool_position

TYPE: Position

METHOD DESCRIPTION
query

query the device

toggleCoolantValve

toggle the coolant valve

connect

connect to the device

disconnect

disconnect from the device

resetFlags

reset all flags to class attribute _default_flags

shutdown

shutdown procedure for tool

enterZone

enter a zone on the deck

exitZone

exit the current zone on the deck

halt

halt robot movement

home

make the robot go home

isFeasible

checks and returns whether the target coordinates is feasible

loadDeck

load Deck layout object to mover

loadDeckFromDict

load Deck layout object from dictionary

loadDeckFromFile

load Deck layout object from file

move

move the robot in a specific axis by a specific value

moveBy

move the robot by target direction

moveTo

move the robot to target position

moveToSafeHeight

move the robot to safe height

moveRobotTo

move the robot to target position

moveToolTo

move the tool end effector to target position

reset

reset the robot

rotate

rotate the robot in a specific axis by a specific value

rotateBy

rotate the robot by target direction

rotateTo

rotate the robot to target orientation

rotateRobotTo

rotate the robot to target orientation

rotateToolTo

rotate the tool end effector to target orientation

safeMoveTo

safe version of moveTo by moving to safe height first

setSafeHeight

set safe height for robot

setSpeedFactor

set the speed factor of the robot

setToolOffset

set the tool offset of the robot

showWorkspace

show the workspace of the robot

updateRobotPosition

update the robot position

transformRobotToTool

transform robot coordinates to tool coordinates

transformRobotToWork

transform robot coordinates to work coordinates

transformToolToRobot

transform tool coordinates to robot coordinates

transformWorkToRobot

transform work coordinates to robot coordinates

calibrate

calibrate the internal and external coordinate systems

Initialize Gantry class

PARAMETER DESCRIPTION
port

serial port address

TYPE: str

limits

lower and upper limits of gantry, in terms of robot coordinate system. Defaults to ((0, 0, 0), (0, 0, 0)).

TYPE: Sequence[Sequence[float]] DEFAULT: ((0, 0, 0), (0, 0, 0))

robot_position

current position of the robot. Defaults to Position().

TYPE: Position DEFAULT: Position()

home_position

home position of the robot in terms of robot coordinate system. Defaults to Position().

TYPE: Position DEFAULT: Position()

tool_offset

tool offset from robot to end effector. Defaults to Position().

TYPE: Position DEFAULT: Position()

calibrated_offset

calibrated offset from robot to work position. Defaults to Position().

TYPE: Position DEFAULT: Position()

scale

factor to scale the basis vectors by. Defaults to 1.0.

TYPE: float DEFAULT: 1.0

deck

Deck object for workspace. Defaults to None.

TYPE: Deck DEFAULT: None

safe_height

safe height in terms of robot coordinate system. Defaults to None.

TYPE: float DEFAULT: None

saved_positions

dictionary of saved positions. Defaults to dict().

TYPE: dict DEFAULT: None

speed_max

maximum speed of robot in mm/min. Defaults to None.

TYPE: float DEFAULT: None

device_type_name

name of the device type. Defaults to 'GRBL'.

TYPE: str DEFAULT: 'GRBL'

baudrate

baudrate. Defaults to 115200.

TYPE: int DEFAULT: 115200

movement_buffer

buffer for movement. Defaults to None.

TYPE: Optional[int] DEFAULT: None

movement_timeout

timeout for movement. Defaults to None.

TYPE: Optional[int] DEFAULT: None

verbose

verbosity of class. Defaults to False.

TYPE: bool DEFAULT: False

simulation

whether to simulate. Defaults to False.

TYPE: bool DEFAULT: False

limits property

limits: ndarray

Lower and upper limits of gantry