ExponentialProfileMeterVolts
- class wpimath.trajectory.ExponentialProfileMeterVolts(constraints: wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.Constraints)
Bases:
pybind11_object
A Exponential-shaped velocity profile.
While this class can be used for a profiled movement from start to finish, the intended usage is to filter a reference’s dynamics based on ExponentialProfile velocity constraints. To compute the reference obeying this constraint, do the following.
Initialization: @code{.cpp} ExponentialProfile::Constraints constraints{kMaxV, kV, kA}; State previousProfiledReference = {initialReference, 0_mps};
Run on update: @code{.cpp} previousProfiledReference = profile.Calculate(timeSincePreviousUpdate, previousProfiledReference, unprofiledReference);
where unprofiledReference is free to change between calls. Note that when the unprofiled reference is within the constraints, Calculate() returns the unprofiled reference unchanged.
Otherwise, a timer can be started to provide monotonic values for Calculate() and to determine when the profile has completed via IsFinished().
Constructs a ExponentialProfile.
- Parameters:
constraints – The constraints on the profile, like maximum input.
- class Constraints
Bases:
pybind11_object
Profile constraints.
- property A wpimath.units.units_per_second
The State-Space 1x1 system matrix.
- property B wpimath.units.meters_per_second_squared_per_volt
The State-Space 1x1 input matrix.
- static fromCharacteristics(maxInput: wpimath.units.volts, kV: wpimath.units.volt_seconds_per_meter, kA: wpimath.units.volt_seconds_squared_per_meter) wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.Constraints
- static fromStateSpace(maxInput: wpimath.units.volts, a: wpimath.units.units_per_second, b: wpimath.units.meters_per_second_squared_per_volt) wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.Constraints
- property maxInput wpimath.units.volts
Maximum unsigned input voltage.
- maxVelocity() wpimath.units.meters_per_second
Computes the max achievable velocity for an Exponential Profile.
- Returns:
The seady-state velocity achieved by this profile.
- class ProfileTiming
Bases:
pybind11_object
Profile timing.
- property inflectionTime wpimath.units.seconds
Profile inflection time.
- isFinished(t: wpimath.units.seconds) bool
Decides if the profile is finished by time t.
- Parameters:
t – The time since the beginning of the profile.
- Returns:
if the profile is finished at time t.
- property totalTime wpimath.units.seconds
Total profile time.
- class State(arg0: wpimath.units.meters, arg1: wpimath.units.meters_per_second)
Bases:
pybind11_object
Profile state.
- property position wpimath.units.meters
The position at this state.
- property velocity wpimath.units.meters_per_second
The velocity at this state.
- calculate(t: wpimath.units.seconds, current: wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State, goal: wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State) wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State
Calculates the position and velocity for the profile at a time t where the current state is at time t = 0.
- Parameters:
t – How long to advance from the current state toward the desired state.
current – The current state.
goal – The desired state when the profile is complete.
- Returns:
The position and velocity of the profile at time t.
- calculateInflectionPoint(current: wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State, goal: wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State) wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State
Calculates the point after which the fastest way to reach the goal state is to apply input in the opposite direction.
- Parameters:
current – The current state.
goal – The desired state when the profile is complete.
- Returns:
The position and velocity of the profile at the inflection point.
- calculateProfileTiming(current: wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State, goal: wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State) wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.ProfileTiming
Calculates the time it will take for this profile to reach the inflection point, and the time it will take for this profile to reach the goal state.
- Parameters:
current – The current state.
goal – The desired state when the profile is complete.
- Returns:
The timing information for this profile.
- timeLeftUntil(current: wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State, goal: wpimath._controls._controls.trajectory.ExponentialProfileMeterVolts.State) wpimath.units.seconds
Calculates the time it will take for this profile to reach the goal state.
- Parameters:
current – The current state.
goal – The desired state when the profile is complete.
- Returns:
The total duration of this profile.