FRC 0 to Autonomous: #6 Swerve Drive Auto

  Рет қаралды 44,761

FRC 0 to Autonomous

FRC 0 to Autonomous

Күн бұрын

We'll program an autonomous trajectory following swerve drive robot!
The code for this video:
github.com/Sea...
More on command-based programming:
• FRC 0 to Autonomous: #...
RobotSim Documentation:
docs.google.co...
RobotSim, RobotLib download:
github.com/Sea...
Questions, feedback: SeanSun6814@gmail.com

Пікірлер: 45
@GEARSinc
@GEARSinc Жыл бұрын
This is an EXCELLENT description and code walk-through. I'm sure it tool a lot of time to create, so thank you very much. As the team's Software Coach, I'm going to put it to great use. I'm going to make this a "must view" for my software team.
@Amit_6738
@Amit_6738 Жыл бұрын
It is our first year using a swerve module, so I am really hyped but at the same time confused on how to code it. this video helped a ton! Thanks from team 6738 Excalibur :D
@keeganmcroberts485
@keeganmcroberts485 Жыл бұрын
Did you have an issue with the toSwerveModuleStates()? I am new to coding and having been working on this problem for a couple of weeks now and need any help I can get. It would be great if you could assist.
@riskybidnes
@riskybidnes Жыл бұрын
Were you able to get your code working off this? We are really struggling with answers and finding even where to look for. Code fixes
@Gandagorn
@Gandagorn 2 жыл бұрын
Awesome!!!! Characterization and Pathweaver tutorial next?!??!
@lucastornado9496
@lucastornado9496 11 ай бұрын
Yes please
@MrHotcocopuffs
@MrHotcocopuffs Жыл бұрын
It would have been nice to see some more theory about the base kinematics instead of just the practical implementation with the SwerveDriveKinematics class abstracting away the fun.
@mihirghawghawe6580
@mihirghawghawe6580 Жыл бұрын
Could you help me with my swerve Code please. I have the MK4 Modules. I would greatly apreciate it. I have all the code written out, its just that some things are outdated.
@bananacrapping6240
@bananacrapping6240 Жыл бұрын
You have helped our team so much thank you!
@neesh774
@neesh774 Жыл бұрын
beautiful video, amazing diagrams and explanations of everything, tysm 🙏
@halftonhero
@halftonhero Жыл бұрын
Great video series. Looking at the code, it appears that you don't invert the NavX2.0 heading (NavX 2.0 has CCW being negative)? We always want CCW to be positive correct? (with regards to encoders and gyros, right?) Is this accounted for somewhere else or am I mistaken on the positive CCW notation?
@davinpreble4761
@davinpreble4761 2 жыл бұрын
hey so were using an Xbox controller and I watched your command base videos and I was wondering do I still use the joystick one or do I have to use a different import?
@jjxu6321
@jjxu6321 2 жыл бұрын
Great work!!!
@robertwilliams5224
@robertwilliams5224 2 жыл бұрын
Excellent Tutorial! I found it very informative and gives me much to think about when making the jump to trajectory based autonomous over the drive, stop, turn , drive sequence method. Some constructive feedback and chance for discussion since it seems like many examples are done in the same way. I would have preferred that the trajectory building and autonomous command be done in a subsystem class and/or unique command instead of being done in RobotContainer for clean-code (seems like most frc programmers like to stuff gobs of things in RobotContainer instead of writing clean-code) and more importantly autonomous programs tend to be much more complicated. Generally an autonomous schedule will be comprised of several unique trajectories with other actions like a robot arm or intake system taking control of an object or a shooter projecting an object between those moving the robot along those trajectories. So doing the follow trajectory commands will need to be built up in Individual Commads and called from a Command Group along with other commands, having them defined in or at least called from individual Commands is necessary. It would not a bad idea to get used to doing/teaching code partitioning since that is the norm in the software industry.
@陳維瑜
@陳維瑜 Жыл бұрын
I'm impressed by the code you made!!!
@Elif0691
@Elif0691 Жыл бұрын
Thank you for your video. I have a questions. I guess the Swerve Module you are using is MK3. Which Gear Ratio did you choose in your Swerve Module? Fast 6.86:1 or Standart 8.16:1. I have one more question. Can I use the MK4 swerve module with these codes instead of the MK3 Swerve Module? Thank you from now.
@ellendicarlo1037
@ellendicarlo1037 11 ай бұрын
I have the same question about using this code with MK4 swerve modules. Did you try it and did it work? Thanks!
@xmgamer5672
@xmgamer5672 Жыл бұрын
Does this still work in WPILib 2023? I get an undefined error when I use setDesiredState.
@hyphen8d725
@hyphen8d725 Жыл бұрын
It might be a deprecated thing, check the documentation.
@MagnusGaunt
@MagnusGaunt 2 жыл бұрын
Thanks for this great tutorial! I still have one question though. how do you set the wheels to face forward at the start of autonomous? I'm planning to use color and or distance sensors to get it to read the position at the start of autonomous. but surely there has to be a better way than by hand, right?
@isopod00
@isopod00 2 жыл бұрын
I believe this is what the absolute encoder is for, it remembers its position even after the robot powers down
@EstacaoProfOusado
@EstacaoProfOusado 2 жыл бұрын
your stuff is really good!!! if you have more you can share and I'll see them all! What my opinion would you be more to implement your best implementation model, not your opinion what my opinion would be more to implement your model? as I'm new I can get more information in the initial videos. Congratulations on the stuff!
@Z0G0N
@Z0G0N Жыл бұрын
How do I find the swerve simulation instead of the tank drive?
@cuteredpandas5164
@cuteredpandas5164 Жыл бұрын
So our team is using a CTRE CANcoder, and the code for the rev can encoder is not the same, what code should i use instead for our encoder?
@coolbudy1173
@coolbudy1173 2 жыл бұрын
This video is a life saver, but I do have a few hardware questions. Will this work with SDS Mk3 modules, are the motor ports the SparkMax's id numbers, and does this need a physical pid controller? Those have been the main 3 things on my mind when going though this. And once again, thank you for this top tier content.
@0ToAuto
@0ToAuto 2 жыл бұрын
It should work with Mk3s, and the motor ports are the SparkMax's ids. This implementation only uses WPI's PID controllers, but you can use the PIDs in your motor controller as well. Good luck with coding!
@coolbudy1173
@coolbudy1173 2 жыл бұрын
@@0ToAuto Thank you, much appreciated.
@jksu8296
@jksu8296 2 жыл бұрын
Good tutorial!But I'm a little confusing about the autonomous X and Y PID parameter.It just set the P value to 1.How dose it work? I don't need to test the P value by myself?
@0ToAuto
@0ToAuto 2 жыл бұрын
Great question! You do need to tune your PID controller. These values are the ones that work well on my robot, but your constants may be different. For more info on how PID controllers work and how to tune them, check out FRC 0 to Autonomous #3 & #4.
@pratyushprakash6613
@pratyushprakash6613 2 жыл бұрын
How do we find constant values for our specific modules?
@popsicle6545
@popsicle6545 5 ай бұрын
thanks a ton!!!!!
@muhammadredwanuzzaman2933
@muhammadredwanuzzaman2933 3 күн бұрын
How do I tune it to make it faster?
@jamesracadio1828
@jamesracadio1828 7 ай бұрын
Beginner question: If we plan on using CAN/Bus to connect our motor controllers, would we still use "DriveConstants.kBackRightDriveMotor" or would we have to change "port" to "Id". My assumption is that "port" means they are connected to a PWM port. Am I wrong?
@matthewepshtein9026
@matthewepshtein9026 Жыл бұрын
Thank you sir!
@evanjordan9784
@evanjordan9784 2 жыл бұрын
Awesome video! How would this work with an Xbox controller instead of a joystick?
@giancarlosnazario265
@giancarlosnazario265 Жыл бұрын
When are you planning to post the next 0 to autonomous video?
@jaydenkearns3264
@jaydenkearns3264 Жыл бұрын
What absitleEmcoder are you using
@rachelfernandez4893
@rachelfernandez4893 Жыл бұрын
i love sweve!!!!!!!!!!!!
@riskybidnes
@riskybidnes Жыл бұрын
Will this work with the changes to java in 2023 in frc? My team has lost its head programmer and we are truly lost. Thanks Team1262
@0ToAuto
@0ToAuto Жыл бұрын
Unfortunately, the code for this video was implemented using an older version of WPILib. While the concepts and the majority of the code should stay the same, it no longer compiles with this year's library. Notably, this year's WPILib changed SwerveDriveOdometry to use wheel distances instead of wheel speeds, and this likely needs changing. docs.wpilib.org/en/stable/docs/yearly-overview/yearly-changelog.html#breaking-changes Good luck on this season!
@riskybidnes
@riskybidnes Жыл бұрын
Thanks for the info, don't know if we have time to even try to fix the old code at this point, no one in group is a programmer, and we have no mentor for it. This isn't going to end well... but thanks
@shoezx
@shoezx 5 ай бұрын
tgis is sups cool
@benrecker1899
@benrecker1899 Жыл бұрын
Hey, I keep any error with the normalizeWheelSpeeds, why would that be?
@scca229
@scca229 Жыл бұрын
Found that this needs to be replaced with "desaturateWheelSpeeds" and it removes the error. Now if I could get the Odometry part changed.
FRC 0 to Autonomous: #3 PID Auto-line (Part 1)
21:30
FRC 0 to Autonomous
Рет қаралды 23 М.
1690 Orbit | World Champions | Behind the Bumpers | FRC CRESCENDO Robot
14:00
FUN Robotics Network
Рет қаралды 23 М.
Секрет фокусника! #shorts
00:15
Роман Magic
Рет қаралды 81 МЛН
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 35 МЛН
FRC 0 to Autonomous: #5 Command-Based Robot
25:05
FRC 0 to Autonomous
Рет қаралды 22 М.
The Basics of Swerve Drive
33:56
Official FIRST
Рет қаралды 27 М.
Differential Swerve Drive
4:53
WildWillyRobots
Рет қаралды 378 М.
A DEEP DIVE into SUBMERGED!
1:10:57
StuyPulse
Рет қаралды 466
FRC 0 to Autonomous: #2 Chassis + mechanisms
21:14
FRC 0 to Autonomous
Рет қаралды 17 М.
Einstein Final Tiebreaker - 2022 FIRST Championship
3:10
FIRSTRoboticsCompetition
Рет қаралды 75 М.
Make a TINY Arduino Drone with FPV Camera - Will It Fly?
20:26
Max Imagination
Рет қаралды 932 М.
FRC 0 to Autonomous: #1 Arcade drive + auto-line
7:48
FRC 0 to Autonomous
Рет қаралды 32 М.
Behind the Bumpers | 254 The Cheesy Poofs | + Bonus Pit Tour | Charged Up
14:06
Behind the Bumpers | 4414 HighTide | World Champions | Bonus Pit Tour
14:25
FUN Robotics Network
Рет қаралды 22 М.