Package com.asiankoala.koawalib.command.commands

Types

Link copied to clipboard
open class ChooseCmd(    onTrue: Cmd,     onFalse: Cmd,     condition: () -> Boolean) : Cmd

Command that chooses between two different commands based on condition

Link copied to clipboard
abstract class Cmd

Commands are the basis of how koawalib interacts with the robot. Each command has initialize(), execute(), and end() methods executed throughout its lifecycle. Commands contain a list of subsystem "requirements", preventing multiple subsystems accessing a command simultaneously. All commands are scheduled and ran through the CommandScheduler.

Link copied to clipboard
class FieldCentricCmd @JvmOverloads constructor(    imu: KIMU,     drive: KMecanumDrive,     leftStick: KStick,     rightStick: KStick,     scalars: Pose = Pose(1.0, 1.0, 1.0),     cubics: Pose = Pose(1.0, 1.0, 1.0),     constants: Pose = Pose(1.0, 1.0, 1.0)) : MecanumCmd
Link copied to clipboard
class GVFCmd(    drive: KMecanumOdoDrive,     controller: GVFController,     cmds: ProjQuery) : Cmd
Link copied to clipboard
open class InstantCmd(action: () -> Unit, requirements: KSubsystem) : Cmd

Command that runs once and stops

Link copied to clipboard
class LoopCmd(action: () -> Unit, requirements: KSubsystem) : LoopUntilCmd

Command that runs infinitely

Link copied to clipboard
open class LoopUntilCmd(    action: () -> Unit,     endCondition: () -> Boolean,     requirements: KSubsystem) : Cmd
Link copied to clipboard
open class MecanumCmd @JvmOverloads constructor(    drive: KMecanumDrive,     leftStick: KStick,     rightStick: KStick,     scalars: Pose = Pose(1.0, 1.0, 1.0),     cubics: Pose = Pose(1.0, 1.0, 1.0),     constants: Pose = Pose(1.0, 1.0, 1.0)) : Cmd

TeleOp drive control command vector drive power is calculated with the function: f(x) = max(0, s * x * (kx^3 - k + 1)) * sgn(x) e.g. xPower = max(0, xScalar * leftStick.x * (xCubic * leftStick.x ^ 3 - xCubic + 1) see the desmos graph for an understanding of it

Link copied to clipboard
class RumbleCmd(gamepad: KGamepad, ms: Int) : InstantCmd
Link copied to clipboard
class WaitCmd(seconds: Double) : Cmd

Dummy command, finishes after n seconds

Link copied to clipboard
class WaitUntilCmd(condition: () -> Boolean) : Cmd

Dummy command, finishes when condition is called

Link copied to clipboard
class WatchdogCmd(toSchedule: Cmd, condition: () -> Boolean) : Cmd