Advanced 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 mappings consist of slightly more "advanced" mappings for lack of a better word. I guess they're just mappings that didn't fit into a specific category lol
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.waitTime()
Roadrunner mapping (waitSeconds)
Allows for simple wait segments. Not much to it. This is useful for running actions in between trajectories. Markers can be run during wait segments.
Time unit (e.g. milliseconds or centuries or something) can be specified in GlobalUnits
*Defaults to seconds
anvil.setReversed()
Roadrunner mapping (setReversed)
Allows you set run your trajectory with the bot facing backwards.
anvil.setTangent()
Roadrunner mapping (setTangent)
Allows you to set a heading tangent on a trajectory, allowing you to follow a trajectory at arbitrary heading tangents.
anvil.addTrajectory() (#1)
Roadrunner mapping (addTrajectory)
Pushes a new Trajectory segment onto the sequence.
anvil.addTrajectory() (#2)
Roadrunner mapping (addTrajectory)
Pushes the returned Trajectory segment onto the sequence.