Creating a command

Commands are classes you create that provide behaviors or actions for your subsystems. The subsystem class should set the operation of the subsystem, like ElevatorUp to start the elevator moving up, or ElevatorToSetPoint to set the elevator's PID setpoint. The commands initiate the subystem operation and keep track of when it is finished.

Drag a command to the robot description Commands folder

Drag a command to the robot description Commands folder

Simple commands can be dragged from the palette to the robot description. The command will be created under the Commands folder.

Creating commands using the context menu

Creating commands using the context menu

You can also create commands using the right-click context menu on the Command folder in the robot description.

Give the command a name and set the required subsystem

Give the command a name and set the required subsystem

Name the command with something meaningful that describes what the command will do. Then set the subsystem that is used by this command. When this command is scheduled, it will automatically stop any command currently running that also requires this command. If a command to open the gripper is currently running (requiring the gripper subsystem) and the close gripper command is scheduled, it will immediately stop opening and start closing.