-
Notifications
You must be signed in to change notification settings - Fork 46
Curriculum challenge ~ Auto stopping Collector
The 2023 robot had a collector to suck in inflatable cubes. But once the collector had a cube it needed to stop intaking so hard or it would pop the cube.
You're going to implement this feature from scratch yourself in this challenge.
The collector is a motor that you can set the power of just like you've been doing for the drive motors this whole time.
Your first step is to implement a basic Subsystem and Commands for this collector mechanism that can run the motors forwards and backwards.
From there, you'll add in the ability to detect that a cube has been intaked and the motor should stop trying so hard.
First create a new git repository using our template as a base: https://github.com/new?template_name=FRCRobotTemplate&template_owner=Team488
Give the repository a name like "My2023Robot"
Then clone this repository locally
Create a new java class CollectorSubsystem
that inherits from BaseSubsystem
.
It should have a XCANSparkMax
motor inside of it that you can make go forward, backwards or stop with functions.
Map intake/outtake to reasonable buttons on the gamepad.
Make stop the default command for your new subsystem so the motor will stop when no buttons are pressed.
You can read the velocity that the motor is turning. Using this, we can try to detect if we're trying to intake but the motor isn't actually turning very fast anymore (because a cube is stuck in it). Once we've detected that, we can send a weaker power to the motors to keep the cube in the intake but not pop it!
When this is working, you should be able to run your intake command on the real robot and try feeding it a cube and verify the motor stops once the cube is acquired.
- 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