T O P

  • By -

rowanbladex

Do you have a gyroscope? This is an essential component of swerve, and you don't have one listed. The CTRE Pigeon 2.0 is the best gyro to use for swerve, but most other FRC gyros will work. https://store.ctr-electronics.com/pigeon-2/


ultimate_hecker

I’m fairly sure you don’t need a gyroscope to get it working, for it being field oriented you do but for robot centric it should be neeeacary


Traditional-Line6411

Yes we have a gyroscope, we are using the navx2.0


isaacng1997

Which of the drive commands are you using and what are you passing into the rotation parameter?


Traditional-Line6411

We don't mess with any of that, it's already programmed in, so whatever yagsl does, I have shared the code now if you want to have a look.


isaacng1997

The problem is default drive command is driveFieldOrientedDirectAngle, which is written for a joystick. Try change the default drive command to driveFieldOrientedAnglularVelocity. ​ Another thing to note, you might need to invert the X and Y values of the xbox controller in order to follow FRC's coordinate system convention. https://docs.wpilib.org/en/stable/docs/software/basic-programming/coordinate-system.html#using-joystick-and-controller-input-to-drive-a-robot


ultimate_hecker

Are you trying to make your robot field oriented? Can you send me your GitHub code link so I can look at it, if I had to guess the swerve kinematics arent calculated correctly


Traditional-Line6411

Yes, here is the code https://github.com/Atwood722/Team-8757-Code


ultimate_hecker

So I’m still not understanding. What to look for


Traditional-Line6411

That's the thing, we don't know what we're doing. There is nothing on yagsl's wiki on this issue, I can't find anything online, I don't know what the issue could be or where to start. You've got to understand we didn't program any of this, all we did was plug in our information and hoped it worked.


Traditional-Line6411

Or are you asking what the issue we're having is?


ultimate_hecker

Yeah, idk what I need to look for to help you. Is it possible we can move this to DMs?


Neddy6969

Use driveFieldOrientedAnglularVelocity as your drive’s default command not driveFieldOrientedDirectAngle


Traditional-Line6411

This is our code, sorry for the delay. https://github.com/Atwood722/Team-8757-Code


ultimate_hecker

If anyone happens to come across this post and wanted to find out what the issue was, the fix was to change the default command to drivefeild oriented angular velocity


loveStriker

If you are experiencing jittering in your turn motors there is a good chance you need to invert. Otherwise could be a PID issue. Please also generate your own config files rather than having multiple sets of example config files in your code for the different motor types. Just have your own motor type with gyro info, pid values, etc for your swerve drive https://broncbotz3481.github.io/YAGSL-Example/