45 Eigen::Matrix<float, 1, 2>
K;
121 std::vector<pros::Motor> motors;
125 std::atomic<bool> is_running;
126 std::atomic<bool> cancel_request;
127 std::atomic<bool> is_settled;
130 pros::Mutex target_mutex;
131 float target_position = 0.0f;
133 static void task_trampoline(
void *params);
134 void controlLoopImpl();
A modular controller for various lift mechanisms.
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.
float getLiftRadians(float motor_degrees)
Convert raw motor degrees into lift arm radians (or meters for cascade).
bool isRunning()
Check if the lift is currently trying to reach a target position.
ModularLift(const std::vector< LiftMotorConfig > &m_configs, LiftMechanism t, LiftConfig c)
Construct a new ModularLift object.
void cancel()
Cancel the current movement command.
~ModularLift()
Destroy the ModularLift object.
void waitUntilDone()
Block the current thread until the lift reaches its target position.
void moveTo(float target_motor_degrees)
Command the lift to move to a target position.
LiftMechanism
Enum defining the physical mechanism of the lift.
Configuration constants and physical properties of the lift.
float arm_length
Length of the lift arm.
float payload_mass_kg
Mass of the payload being lifted in kilograms.
float tolerance
Acceptable error tolerance for considering a move finished.
float gear_ratio
External gear ratio applied to the motors.
Eigen::Matrix< float, 1, 2 > K
State-feedback gain matrix [kP, kD].
float spool_radius
Radius of the spool (for cascade/elevator mechanisms)
float arm_mass_kg
Mass of the arm mechanism in kilograms.
float kG_base
Base gravity feed-forward gain.
Configuration for a single lift motor.
int port
Motor port number.
pros::MotorGear gearset
Motor internal gearset.
Task parameters for the lift's background control task.
ModularLift * instance
Pointer to the lift instance.