DifferentialDriveVoltageConstraint

class wpimath.trajectory.constraint.DifferentialDriveVoltageConstraint(feedforward: wpimath._controls._controls.controller.SimpleMotorFeedforwardMeters, kinematics: wpimath.kinematics._kinematics.DifferentialDriveKinematics, maxVoltage: volts)

Bases: TrajectoryConstraint

A class that enforces constraints on differential drive voltage expenditure based on the motor dynamics and the drive kinematics. Ensures that the acceleration of any wheel of the robot while following the trajectory is never higher than what can be achieved with the given maximum voltage.

Creates a new DifferentialDriveVoltageConstraint.

Parameters:
  • feedforward – A feedforward component describing the behavior of the drive.

  • kinematics – A kinematics component describing the drive geometry.

  • maxVoltage – The maximum voltage available to the motors while following the path. Should be somewhat less than the nominal battery voltage (12V) to account for “voltage sag” due to current draw.

maxVelocity(pose: wpimath.geometry._geometry.Pose2d, curvature: radians_per_meter, velocity: meters_per_second) meters_per_second
minMaxAcceleration(pose: wpimath.geometry._geometry.Pose2d, curvature: radians_per_meter, speed: meters_per_second) wpimath._controls._controls.constraint.TrajectoryConstraint.MinMax