Pathing mappings
All of these methods autoconvert to inches/radians/seconds behind the scenes, from the units set up in GlobalUnits.
For example, if GlobalUnits is set-up as inches/degrees/milliseconds, you can do something like
.turn(90)
to turn 90 degrees, and it does Math.toRadians(90)
automatically.
These are the mappings from Anvil to the normal TrajectorySequenceBuilder functions that have to do with pathing, such as lines, splines, and raw movements.
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(...)
They also all take just numbers, and convert them to the poses/vectors behind the scenes, allowing for a much cleaner API, and thus a much better developer experience.
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.
Raw movements
anvil.forward()
anvil.back()
anvil.turn()
anvil.strafeLeft()
Roadrunner mapping (strafeLeft)
anvil.strafeRight()
Roadrunner mapping (strafeRight)
Lines
anvil.lineTo()
anvil.strafeTo()
Functionally equivalent to lineTo
anvil.lineToConstantHeading()
Roadrunner mapping (lineToConstantHeading)
Functionally equivalent to lineTo
anvil.lineToLinearHeading()
Roadrunner mapping (lineToLinearHeading)
anvil.lineToSplineHeading()
Roadrunner mapping (lineToSplineHeading)
Splines
anvil.splineTo()
anvil.splineToConstantHeading()
Roadrunner mapping (splineToConstantHeading)
anvil.splineToLinearHeading()
Roadrunner mapping (splineToLinearHeading)
anvil.splineToSplineHeading()
Roadrunner mapping (splineToSplineHeading)