Package-level declarations

Types

Link copied to clipboard
class CustomTask(val onLoop: () -> Boolean) : Task

Task that allows you to execute code using a lambda

Link copied to clipboard
class DelayTask(var delay: Int) : Task

Pause for a specified amount of time in a queue

Link copied to clipboard
class ForkTask(val task1: Task, val task2: Task) : Task

Runs two tasks concurrently. Will wait for both tasks to complete before moving on. This can be used with TaskList for complex behavior

Link copied to clipboard
class KillTask(val task: Task) : Task

Task that kills another task.

Link copied to clipboard
class LogTask(var text: String) : Task

Log a string to the console using System.out.println

Link copied to clipboard
class MotorPowerTask(val power: Double, val motor: Motor) : Task

Set the power of a motor

Link copied to clipboard
class MotorVelocityTask(var target: Double, val motor: Motor, val encoder: RotaryEncoder, val pid: PID) : Task

Task that controls the velocity of a motor using a PID controller. Stop task using kill function.

Link copied to clipboard
class NullTask : Task

Task that doesn't do anything

Link copied to clipboard
class PointTask(val goal: Waypoint, val controller: PTPController) : Task

Move the robot to a target position using a point to point controller

Link copied to clipboard
class ResetRotationTask(var rotation: Double, var localizer: Localizer) : Task

Set the localizer rotation. Can be used to reset the localizer angle from an external source such as vision.

Link copied to clipboard
class RotateTask(var goal: Double, val relative: Boolean, val controller: PTPController) : Task

Rotate the robot to a set angle or by a set amount

Link copied to clipboard
class ServoTask(val servo: Servo, val position: Double) : Task

Task that sets the position of a servo

Link copied to clipboard
class SetMotorPositionTask(val position: Double, val ctrlr: MotorPositionController) : Task

Set the position of a motor using a MotorPositionController

Link copied to clipboard
interface Task
Link copied to clipboard
class TaskList : Task

A task containing a list of tasks that will occur sequentially as if they were in a queue. Can be used with a ForkTask to allow multiple sequences of events to happen concurrently. A task list can contain a custom task at the end of it which adds more tasks to the list allowing for recurrent execution.

Link copied to clipboard
class TaskQueue

The Task Queue is a scheduling system. It is a Queue to which Tasks can be added. A task is simply an object which contains a loop function which returns a boolean. The loop function of the task at the front of the queue will be executed every update cycle until it returns true. Once the task loop function returns true the task is discarded from the queue and the next task begins executing. By using ForkTasks and TaskLists it is possible to create arbitrarily complex trees of tasks. Loops of tasks can be implementing via recursion using a TaskList and CustomTask.

Link copied to clipboard
class WaitForMotorTask(val motorCtrlr: MotorPositionController, var epsilon: Float) : Task

Wait for a motor position controller to reach its target position