Skip to main content

AxisHandle

Trait AxisHandle 

Source
pub trait AxisHandle {
    // Required methods
    fn position(&self) -> f64;
    fn config(&self) -> &AxisConfig;
    fn move_relative(&mut self, distance: f64, vel: f64, accel: f64, decel: f64);
    fn move_absolute(&mut self, position: f64, vel: f64, accel: f64, decel: f64);
    fn halt(&mut self);
    fn is_busy(&self) -> bool;
    fn is_error(&self) -> bool;
    fn motor_on(&self) -> bool;
}
Expand description

High-level interface for a motion axis.

This trait provides a unified interface for both raw Axis objects and the higher-level generated AxisHandle structs used in the control program.

Required Methods§

Source

fn position(&self) -> f64

Actual position in user units.

Source

fn config(&self) -> &AxisConfig

Read-only access to the axis configuration.

Source

fn move_relative(&mut self, distance: f64, vel: f64, accel: f64, decel: f64)

Issue a relative move command.

Source

fn move_absolute(&mut self, position: f64, vel: f64, accel: f64, decel: f64)

Issue an absolute move command.

Source

fn halt(&mut self)

Halt the axis immediately.

Source

fn is_busy(&self) -> bool

True if the axis is currently executing an operation.

Source

fn is_error(&self) -> bool

True if the axis is in an error state.

Source

fn motor_on(&self) -> bool

True if the motor is enabled and holding torque.

Implementations on Foreign Types§

Source§

impl<'a, V: AxisView> AxisHandle for (&'a mut Axis, &'a mut V)

Blanket implementation to allow old-style (Axis, AxisView) calls.

Source§

fn position(&self) -> f64

Source§

fn config(&self) -> &AxisConfig

Source§

fn move_relative(&mut self, distance: f64, vel: f64, accel: f64, decel: f64)

Source§

fn move_absolute(&mut self, position: f64, vel: f64, accel: f64, decel: f64)

Source§

fn halt(&mut self)

Source§

fn is_busy(&self) -> bool

Source§

fn is_error(&self) -> bool

Source§

fn motor_on(&self) -> bool

Implementors§