|
HoloLib
High-performance holonomic (X-Drive) control library for VEX V5
|
A modular controller for various lift mechanisms. More...
#include <modular_lift.h>
Public Member Functions | |
| ModularLift (const std::vector< LiftMotorConfig > &m_configs, LiftMechanism t, LiftConfig c) | |
| Construct a new ModularLift object. | |
| ~ModularLift () | |
| Destroy the ModularLift object. | |
| float | getLiftRadians (float motor_degrees) |
| Convert raw motor degrees into lift arm radians (or meters for cascade). | |
| void | setPayload (float mass_kg) |
| Set the mass of the current payload to update feed-forward calculations dynamically. | |
| float | calculateFeedforward (float current_motor_degrees) |
| Calculate the required feed-forward voltage to hold the lift at its current position. | |
| void | moveTo (float target_motor_degrees) |
| Command the lift to move to a target position. | |
| void | cancel () |
| Cancel the current movement command. | |
| void | waitUntilDone () |
| Block the current thread until the lift reaches its target position. | |
| bool | isRunning () |
| Check if the lift is currently trying to reach a target position. | |
A modular controller for various lift mechanisms.
Handles background task processing, feed-forward calculations based on physics, and LQR/state-feedback control for accurate positioning.
Definition at line 55 of file modular_lift.h.
| ModularLift::ModularLift | ( | const std::vector< LiftMotorConfig > & | m_configs, |
| LiftMechanism | t, | ||
| LiftConfig | c | ||
| ) |
Construct a new ModularLift object.
| m_configs | Vector of motor configurations for the lift. |
| t | The type of lift mechanism (e.g. FOUR_BAR, CASCADE). |
| c | The configuration containing physical constants and control gains. |
| ModularLift::~ModularLift | ( | ) |
Destroy the ModularLift object.
Cleans up the background task and associated resources.
| float ModularLift::getLiftRadians | ( | float | motor_degrees | ) |
Convert raw motor degrees into lift arm radians (or meters for cascade).
| motor_degrees | The raw sensor value in degrees. |
| void ModularLift::setPayload | ( | float | mass_kg | ) |
Set the mass of the current payload to update feed-forward calculations dynamically.
| mass_kg | Mass of the payload in kilograms. |
| float ModularLift::calculateFeedforward | ( | float | current_motor_degrees | ) |
Calculate the required feed-forward voltage to hold the lift at its current position.
| current_motor_degrees | The current position of the lift. |
| void ModularLift::moveTo | ( | float | target_motor_degrees | ) |
Command the lift to move to a target position.
| target_motor_degrees | The target position in motor degrees. |
| void ModularLift::cancel | ( | ) |
Cancel the current movement command.
| void ModularLift::waitUntilDone | ( | ) |
Block the current thread until the lift reaches its target position.
| bool ModularLift::isRunning | ( | ) |
Check if the lift is currently trying to reach a target position.