lift package¶
Submodules¶
lift.claw module¶
Code for the claw subsystem.
This file contains code for the claw, which is implemented as a finite-state automaton with these states:
- neutral: the claw is fully open and not in action.
- closing: the claw is transitioning from the “neutral” state to the “closed” state.
- closed: the claw is in the closed position, but still exerting light pressure to maintain grip on the cube.
- opening: the claw is transitioning from the “closed” state to the “neutral” state.
- manual_ctrl: a disconnected state from the other four; used when the driver wants full control over the claw without assistance from the state automaton.
Authors: | Brandon Gong, Sebastian Mobo |
---|---|
Version: | 0.0.1 |
Date: | January 19, 2018 |
-
class
lift.claw.
Claw
(talon_id)[source]¶ Bases:
object
Implements a finite-state automaton for manipulating the claw.
Parameters: - talon_id – the ID number of the talon on the claw.
- contact_sensor_channel – the channel that the contact sensor is connected to.
-
claw_adjust_time
= 0.25¶
-
claw_movement_time
= 0.5¶ time to allow for the claw to open, in seconds
-
close
()[source]¶ Close the claw.
This function does a quick check to make sure it is a valid state change before actually changing the state to “closing”. For example you cannot set the state to “closing” if the claw is already gripping the cube.
-
open
()[source]¶ Open the claw.
The idea of checking the state change is similar to that of the close() function, but it also resets the opening start time.