Devices Package¶
This is the documentation concerned with controlling an Axis/Axes.
Axis Module¶
-
class
commanduino.devices.axis.
Axis
(linear_actuator, unit_per_step=1, min_position=0, max_position=inf)[source]¶ Bases:
object
Represents a singular Axis which devices can move along.
- Args:
linear_actuator: The linear actuator which moves along the axis.
unit_per_step (int): Amount of units to move per step, default set to 1
min_position (int): Minimum position of the axis, default set to 0
max_position (str): The maximum position of hte axis, cast to (float)
-
cast_position
(position_in_unit)[source]¶ Casts the position on the axis.
- Args:
- position_in_unit (int): Position in units.
- Returns:
- casted_position (int): The casted position.
-
get_current_position
()[source]¶ Gets the current position on the axis.
- Returns:
- self.step_to_position (int): THe position of the linear actuator.
-
get_switch_state
()[source]¶ Gets the switch state of the linear actuator.
- Returns:
- The switch state of the linear actuator.
-
home
(wait=True)[source]¶ Returns the actuator to the home position.
- Args:
- wait (bool): Wait until the actuator is idle, default set to True
-
is_initialized
()[source]¶ Check for initialisation.
- Returns:
- self.initialized (bool): Initialisation status
-
is_moving
()[source]¶ Check for axis movement.
- Returns:
- self.linear_actuator.is_moving (bool): The actuator movement status.
-
move
(delta_position_in_unit, wait=True, force=False)[source]¶ Moves the linear actuator.
- Args:
delta_position_in_unit (int): The amount to move.
wait (bool): Wait until the linear actuator is idle, default set to True.
force (bool):Force the movement, default set to False.
-
move_to
(position_in_unit, wait=True, force=False)[source]¶ Moves the linear actuator to a set position.
- Args:
position_in_unit (int): Position to move to.
wait (bool): Wait until the actuator is idle, default set to True.
force (bool): Force the movement, default set to False.
-
position_to_step
(position_in_unit)[source]¶ Converts position to steps.
- Args:
- position_in_unit (int): Position in Units.
- Returns:
- n_steps (int): Number of steps.
-
class
commanduino.devices.axis.
MultiAxis
(*args)[source]¶ Bases:
object
Represents a collection of Axis objects which device can move along.
- Args:
- *args: Variable argument list.
-
get_current_position
()[source]¶ Gets the current position of the axes.
- Returns:
- position (List): List of the positions.
-
get_switch_state
()[source]¶ Gets the switch state of the axes.
- Returns:
- switch_state (List): List of the switch states.
-
home
(wait=True)[source]¶ Returns the axes to their home position.
- Args:
- wait (bool): Wait until the axes are idle, default set to True.
-
is_initialized
()[source]¶ Gets the initialisation status of the devices.
- Returns:
- self.initialised (bool): The initialisation status.
-
is_moving
()[source]¶ Check for movement along the axes.
- Returns:
True (bool): The axes are moving.
False (bool): The axes are not moving.
-
move
(position_array_in_unit, wait=True, force=False)[source]¶ Moves the axes.
- Args:
position_array_in_unit (int): The amount to move.
wait (bool): Wait until the axes are idle, default set to True.
force (bool): Force the movement of the axes, default set to False.