TurnCommand

package com.seattlesolvers.solverslib.pedropathing

This command calls Pedro Pathing's follower.turn(radians, isLeft), which allows you to easily turn a certain amount of radians (or degrees) in place.

It has four parameters, with the first three being mandatory:

  1. Pedro Pathing's Follower (which controls the robot movement)

  2. The angle to turn by (default is Radians)

  3. Whether or not the robot should turn left (counterclockwise)

TurnCommand(Follower follower, double angle, boolean isLeft)

// Example
new TurnCommand(follower, Math.PI / 2, true)
  1. An optional parameter for a custom AngleUnit to turn by (AngleUnit.Radians or AngleUnit.Degrees)

TurnCommand(Follower follower, double angle, boolean isLeft, AngleUnit angleUnit)

// Example
new TurnCommand(follower, 90.0, true, AngleUnit.DEGREES)

To see how you can use this command in a CommandOpMode, you can look at this example.

Last updated