-
Notifications
You must be signed in to change notification settings - Fork 45
Curriculum challenge ~ Altering Tank Drive
At this point you now have a basic robot that can be driven around with a set of 2 joysticks using tank drive. Next we're going to augment that basic drive system to support a whole range of new pieces of functionality.
For the commands in this list, you can just focus on implementing the command itself. Don’t worry about mapping the commands to buttons, the unit tests will just run your command directly. Later on you'll learn how to do the button->command mapping.
- Command you'll be filling in: TogglePrecisionDriveCommand (this file already exists - find it under xbot->subsystems->drive->commands)
- Unit test: TogglePrecisionDriveCommandTest
Example: User has left joystick at 100% forward. The left motors are outputting 100% forward power. User then presses the joystick button while holding joystick forward. The left motors should now be outputting 50% power.
Hints:
- We want to modify the behavior of the DriveSubsystem until this method is called again. This means we'll need to use TogglePrecisionDriveCommand to save some information into the DriveSubsystem every time .
- Command: ArcadeDriveWithJoysticksCommand
- Unit test: ArcadeDriveTest
Hint: when calling x and y values from the operator interface, use leftJoystick.
Example: User has joystick full forward. Robot drives forward. User has joystick full right. Robot spins in place to the right. User has the joystick full forward and full right. Robot goes forward while turning to the right.
How you achieve this is up to you, there are algorithms online you can research or come up with your own solution. The tests just verify some basic cases.
We use Xbox and similar controllers for driving the robot:
Continue with the next curriculum challenge: Moving to a target position
- Home
- Challenges
- Setting up your environment
- Basic Robot Principles
- Tank Drive
- Altering Tank Drive
- Moving to a target position
- Rotating to a target orientation
- Factories
- The Power of Injection
- Dependency Injection with Dagger
- Upgrading Using the SeriouslyCommonLib
- Running XbotEDU on a Real Robot
- Auto Stopping Collector