MecanumCmd

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

See also

Parameters

drive

KMecanumDrive reference

leftStick

left gamepad joystick

rightStick

right gamepad joystick

Constructors

Link copied to clipboard
fun MecanumCmd(    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))

Properties

Link copied to clipboard
open override val isFinished: Boolean = false

Finish state of command

Inherited properties

Link copied to clipboard
val name: String

The name of the command

Functions

Link copied to clipboard
open override fun execute()

Main part of a command, called while command is running.

Inherited functions

Link copied to clipboard
fun alongWith(vararg parallel: Cmd): ParallelGroup

Run n commands in parallel with this command, ending when all commands have ended

Link copied to clipboard
fun andPause(seconds: Double): SequentialGroup

Pause for n seconds after this command ends

Link copied to clipboard
fun andThen(vararg next: Cmd): SequentialGroup

Runs n commands sequentially after this command

Link copied to clipboard
fun cancel()

Cancel command. KScheduler.cancel

Link copied to clipboard
fun cancelIf(condition: () -> Boolean): RaceGroup

Cancels this command upon fulfilling a condition

Link copied to clipboard
fun deadlineWith(vararg parallel: Cmd): DeadlineGroup

Runs n commands in parallel with this command, ending when this command ends

Link copied to clipboard
open fun end()

Final part of a command, called when command finishes.

Link copied to clipboard
open fun initialize()

First part of running a command, called on start of command.

Link copied to clipboard
fun raceWith(vararg parallel: Cmd): RaceGroup

Run n commands in parallel with this command, ending when any of the commands has ended

Link copied to clipboard
fun schedule()

Schedule command. Syntax sugar for KScheduler.schedule

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
operator fun unaryPlus()
Link copied to clipboard
fun waitUntil(condition: () -> Boolean): SequentialGroup

Wait until a condition has been fulfilled to run this command

Link copied to clipboard
fun withName(commandName: String): Cmd

Name the current command, which shows up in the logger.

Link copied to clipboard
fun withTimeout(time: Double): RaceGroup

Cancels this command after some time if not finished

Inheritors

Link copied to clipboard