Constraints
None of the methods in this page auto-convert units. They're all whatever units Roadrunner uses (iirc, inches, rads, in/sec, rad/sec, etc.)
These are all mappings to the constraint functions. All of these functions return the Anvil instance to allow for method chaining (like so)
- Java
- Kotlin
Anvil.forgeTrajectory(drive, startPose)
.forward(...)
.back(...)
.lineTo(...);
Anvil.forgeTrajectory(drive, startPose)
.forward(...)
.back(...)
.lineTo(...)
Click on the 'Roadrunner mapping' link to go to the LearnRoadRunner docs for the method! Heavy credit goes to the Roadrunner/LearnRoadRunner team fo their great library and documentation.
anvil.resetConstraints()
Roadrunner mapping (resetConstraints)
Clears any temporary constraints set by setConstraints(). Defaults to the ones in DRIVE_CONSTANTS, unless you did something weird.
Velocity constraints
anvil.setVelConstraint() (#1)
Roadrunner mapping (setVelConstraint)
Allows you to set a custom, temporary, TrajectoryVelocityConstraint for the rest of the trajectory, or at least until it is reset/overridden.
anvil.setVelConstraint() (#2)
Roadrunner mapping (setVelConstraint)
Allows you to set a custom, temporary, TrajectoryVelocityConstraint for the rest of the trajectory, or at least until it is reset/overridden.
This one creates the TrajectoryVelocityConstraint for you, using SampleMecanumDrive.getVelocityConstraint()
.
Keep in mind this does not auto-convert units.
anvil.resetVelConstraint()
Roadrunner mapping (resetVelConstraint)
Clears any temporary constraints set by setVelConstraint(). Defaults to the ones in DRIVE_CONSTANTS, unless you did something weird.
Acceleration constraints
anvil.setAccelConstraint() (#1)
Roadrunner mapping (setAccelConstraint)
Allows you to set a custom, temporary, TrajectoryAccelerationConstraint for the rest of the trajectory, or at least until it is reset/overridden.
anvil.setAccelConstraint() (#2)
Roadrunner mapping (setAccelConstraint)
Allows you to set a custom, temporary, TrajectoryAccelerationConstraint for the rest of the trajectory, or at least until it is reset/overridden.
This one creates the TrajectoryAccelerationConstraint for you, using SampleMecanumDrive.getAccelerationConstraint()
.
Keep in mind this does not auto-convert units.
anvil.resetAccelConstraint()
Roadrunner mapping (resetVelConstraint)
Clears any temporary constraints set by setAccelConstraint(). Defaults to the ones in DRIVE_CONSTANTS, unless you did something weird.
Turn constraints
anvil.setTurnConstraint()
Roadrunner mapping (setTurnConstraint)
Allows you to set a custom, temporary, turn constraint for the rest of the trajectory, or at least until it is reset/overridden.
anvil.resetTurnConstraint()
Roadrunner mapping (resetTurnConstraint)
Clears any temporary constraints set by setTurnConstraint(). Defaults to the ones in DRIVE_CONSTANTS, unless you did something weird.