Class HeadingAssistModule
java.lang.Object
xbot.common.subsystems.drive.control_logic.HeadingAssistModule
Encaspulates a useful bit of driving logic: - The robot should attempt to
hold its current heading, even if it's temporarily rotated by outside forces.
- If the human driver wants the robot to turn (above some small threshold),
then the robot should turn according to human desires. - After a few moments,
the robot should memorize its current heading, and attempt to hold it again.
The automatic response can take one of two forms: - Hold a specific heading,
as mentioned above, using a PID controller - Resist changes in rotational
velocity using a D-only controller.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static class
-
Constructor Summary
ConstructorDescriptionHeadingAssistModule
(HeadingModule headingModule, HeadingModule decayModule, String prefix, PropertyFactory propMan, BasePoseSubsystem pose) -
Method Summary
Modifier and TypeMethodDescriptiondouble
calculateHeadingPower
(double humanRotationalPower) Core method of the HeadingAssistModule.void
reset()
void
-
Constructor Details
-
HeadingAssistModule
@AssistedInject public HeadingAssistModule(@Assisted("headingModule") HeadingModule headingModule, @Assisted("decayModule") HeadingModule decayModule, @Assisted("prefix") String prefix, PropertyFactory propMan, BasePoseSubsystem pose)
-
-
Method Details
-
setMode
-
reset
public void reset() -
calculateHeadingPower
public double calculateHeadingPower(double humanRotationalPower) Core method of the HeadingAssistModule. You input the human rotational power input, and this will determine whether or not to have the human drive the robot or whether the robot should continue on its last heading. In either case, it will return the suggested power output to the drive subsystem in order to achieve those goals.- Parameters:
humanRotationalPower
- - values between -1 and 1, in terms of "maximum rotational power"- Returns:
- values between -1 and 1, in terms of "how hard you should try in order to satisfy rotational goals."
-