Programming III - Commands and Basic Motor Control
Programming III - Commands and Basic Motor Control
brushed
identify it
CONTROLLING MOTORS
3. Instantiate the motor controller with the correct CAN
ID.
ControlModes: ControlMode.PercentOutput,
ControlMode.Velocity, ControlMode.Current,
ControlMode.Position.
COMMANDS
Two different ways to declare a Command: subclassing &
Command Factories
separate file.
Command Factories
separate file.
run/RunCommand: execute
the Command.
DOUBLE COLON
parameters.
BINDING COMMANDS
Create a controller (CommandXboxController or
CommandPS4Controller) in RobotContainer
alongWith()
.andThen()
.withTimeout()
.until()
.unless()
COMMAND GROUPS
Parallel Group: Commands run simultaneously
Race Group: As soon as one Command finishes, all others are interrupted.
agian.
COMMAND GROUPS
Command Groups can be called by adding a decorator to an existing
class:
TIPS
Use VSCode IntelliSense if you don’t know what you’re looking for
TIPS
Hover over errors to see what the issue is
WPILib Docs
Example Code
Chief Delphi