Skip to main content

Advanced mappings

info

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)

Anvil.forgeTrajectory(drive, startPose)
.forward(...)
.back(...)
.lineTo(...);
tip

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

Params
  • time: Number - The amount of time to wait
  • anvil.setReversed()

    Roadrunner mapping (setReversed)

    Allows you set run your trajectory with the bot facing backwards.

    Params
  • enabled: Boolean - Whether or not to set the subsequent paths reversed
  • 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.

    Params
  • tangent: Double - ¡Ze tangent!
  • anvil.addTrajectory() (#1)

    Roadrunner mapping (addTrajectory)

    Pushes a new Trajectory segment onto the sequence.

    Params
  • trajectory: Trajectory - The trajectory to add
  • anvil.addTrajectory() (#2)

    Roadrunner mapping (addTrajectory)

    Pushes the returned Trajectory segment onto the sequence.

    Params
  • trajectory: () -> Trajectory - A function which returns trajectory to add