Bionic-Bison-5535 / FORTE

"FORTE" is FRC Team 5535's Robot for the 2024 FIRST Robotics Competition, "Crescendo".
MIT License
2 stars 0 forks source link

Autonomous - Pick Up and Score Selected Note #3

Closed WesleyMcGinn closed 7 months ago

WesleyMcGinn commented 8 months ago

We need to get a working autonomous that will at least pick up and score a specific note selected in the Shuffleboard.

WesleyMcGinn commented 8 months ago

Ethan, you will be doing the initial coding for our autonomous. If you look at the way we used stages in Launch.java, I think you will be able to make a basic starting autonomous. We will add onto it from there.

Please use an integer called autoStage in Robot.java and have it put to the SmartDashboard in robotPeriodic(). The stages should work something like this.

Stage What It Does Possibly Useful Hint
0 Starts stage 1 autoStage = 1;
1 Starts launch preparation launcher.LAUNCHprep()
2 Use speaker.X() to rotate to point towards the speaker; if the tag is not in view, spin until seen. Do not move on to stage 3 until pointed toward speaker speaker.X() > -5 && speaker.X() < 5
3 LAUNCH! (officially) laucher.something.... Figure it out.
4 Exit starting zone Tim could be useful....

All autonomous code should be directly added to Robot.java; please do not make an Autonomous.java as it would simply be inefficient to use basically every robot variable as a parameter for a system that could have been easily implemented into the main code. No need to make a new branch for this; you can add it directly to main.

Please finish this sometime very soon, soon as in finishing before 6:30pm on Tuesday.

Hopefully this will be a challenge for you. Please let me know here if you have any questions.

WesleyMcGinn commented 8 months ago

After you code that we will be using POF to get the selected note on the field from its exact location. This will involve additional stages but no modification to your code.

After that we will make our 17-point autonomous and crazy-awesome teleop by solving issue #4 with the Limelight.

WesleyMcGinn commented 8 months ago

Nice job! Except you forgot one thing — the robot will act drunken (if you remember previously) without the very important line:

go.update();

Don't worry; I added this with commit a39402f. It is a simple mistake and I think you learned a lot from what you did. We are testing your autonomous first thing tomorrow after school. Good work today.

WesleyMcGinn commented 8 months ago

Hello Again, Ethan. I know we haven't really gotten to test the code you already wrote but we do need to keep going as TIME IS SHORT. Soon, with the addition of #10, we will have a go-to-position function called pof.goTo([x, y]), x being the distance to the local alliance wall and y being the distance to the wall with the sources on it. (Horizontal/Vertical as shown in slide 1 of PLAN.pdf). Pretending that we already have this done and could use pof.goTo(POF.note1) or similar things, please code the following stages:

Stage What It Does Hint
5 Only if shuffleboard note selected, go to position of note if (noteToGet != "0") { pof.goTo(POF.note_);...
6 Drive back while intaking until iseenote No hints this time — you've got this! :)
7 Drive back slower until finished intaking note if (launcher.stage == 0) { stage = 8; }
8 Stop and run aim and launch sequence launcher.aimAndLaunch()
9 null Do nothing

Assume that we also have a function pof.there(), returning true when reached position set by pof.goTo(whatever).

You've got this — just have it done SOON! (As in before 5:30 today.... :) ) Let me know ASAP if you have questions. Good luck!

WesleyMcGinn commented 8 months ago

Nice job coding today! We will test this first thing tomorrow after school. Tomorrow is our LAST DAY!!!!! Let's make the absolute most of our time!