NativeMecanumDrivetrain

public final class NativeMecanumDrivetrain extends Feature implements Buildable

A mecanum drivetrain—this doesn't require odometry, hence it being "native" by not relying on external libraries. If you have odometry, use MecanumDrivetrain.

Controls: Right joystick controlls rotation. Left joystick controlls forward/backward/left/right movement. Controller 1 has full power. Controller 2 has reduced power (for finer control)

Parameters

drivetrainMapMode

The motor layout of the drivetrain.

useExpansionHub

Whether or not to use the expansion hub to get the motors. Requires that the expansion hub motors be initialized before use

fieldCentric

Whether or not to use field centric controls. The imu must be initialized prior to use.

isRotInverted

Whether or not to invert the rotation controls. Required for our second robot.

Constructors

Link copied to clipboard

Properties

Link copied to clipboard
private ScriptParameters environment
Link copied to clipboard
public final String name
Link copied to clipboard
public final Boolean needsInit

Functions

Link copied to clipboard
public Unit build()

The method to run when a feature is being built.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
public final ScriptParameters getEnvironment()
Link copied to clipboard
public Unit init(ScriptParameters parameters)
Link copied to clipboard
public Unit loop()

The method to run on every loop of this feature. If this feature is conditional, this will only run if Conditional.when returns true.

Link copied to clipboard
public Unit run(ScriptParameters parameters)
Link copied to clipboard
public final Unit setCONTROL1_COORDINATE_MOTION(Double CONTROL1_COORDINATE_MOTION)
Link copied to clipboard
public final Unit setCONTROL1_ROTATIONAL_MOTION(Double CONTROL1_ROTATIONAL_MOTION)
Link copied to clipboard
public final Unit setCONTROL2_COORDINATE_MOTION(Double CONTROL2_COORDINATE_MOTION)
Link copied to clipboard
public final Unit setCONTROL2_ROTATIONAL_MOTION(Double CONTROL2_ROTATIONAL_MOTION)
Link copied to clipboard
public final Unit setEnvironment(ScriptParameters environment)