Class HeadingModule
java.lang.Object
xbot.common.subsystems.drive.control_logic.HeadingModule
Encapsulates the logic needed to rotate the robot to a specific angle.
When using a PD or PID controller, it will attempt to reach that angle.
When using a D-only controller, it will just resist any rotational motion.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionHeadingModule
(PIDManager headingDrivePid, BasePoseSubsystem pose, PropertyFactory propMan) -
Method Summary
Modifier and TypeMethodDescriptiondouble
calculateDeltaHeadingPower
(double desiredDeltaHeadingInDegrees) double
double
calculateHeadingPower
(double desiredHeading) double
calculateHeadingPower
(Rotation2d desiredHeading) void
boolean
void
reset()
-
Field Details
-
defaultPValue
public final double defaultPValue- See Also:
-
-
Constructor Details
-
HeadingModule
@AssistedInject public HeadingModule(@Assisted("headingDrivePid") PIDManager headingDrivePid, BasePoseSubsystem pose, PropertyFactory propMan)
-
-
Method Details
-
isOnTarget
public boolean isOnTarget() -
reset
public void reset() -
calculateHeadingPower
public double calculateHeadingPower(double desiredHeading) -
calculateHeadingPower
-
calculateDeltaHeadingPower
public double calculateDeltaHeadingPower(double desiredDeltaHeadingInDegrees) -
freezeHeading
public void freezeHeading() -
calculateFrozenHeadingPower
public double calculateFrozenHeadingPower()
-