Section 4.4 - Working with our Tank Drive Subsystem
Controlling our Tank Drive
This lesson will demonstrate how to create a tank drive command and bind it to a controller for your robot. You will start by establishing a command that interacts with the tank drive subsystem, ensuring it has exclusive access through the addRequirements method. The lesson will explain the importance of using DoubleSupplier for joystick values, allowing continuous access to the latest input. You will then implement the command's execute method to drive the tank using the current joystick values and the end method to stop the robot. Finally, you'll learn to instantiate an Xbox controller for easy button access and set the tank drive command as the default for the subsystem, utilizing lambda expressions for dynamic value updates. The session will conclude with a simulation to verify functionality.