Swerve problem

two swerve wheels rotate one way, and two others rotate the other way

Can someone help me?

EXAMPLE

It’s a little hard to help you from this description, but the things I would check first are:

  • Are the CAN ids assigned correctly?
  • Are the locations of the modules set correctly? Remember that positive X is forwards, and positive Y is left.
  • Are the module offsets set correctly?
  • Are motor/encoder inversions set correctly?

I don’t know what swerve drive library you’re using, but you might find some of this website to be useful.

yes, everything is fine, and we use yagsl.

code:

One thing that leaps out at me is that your module locations are about 11, which sounds like it has to be inches, but you seem to be using metres elsewhere.

Hi I dont fully understand your issue, but it seems you aren’t using the YAGSL example project. So it maybe hard to debug exactly what is happening.

Going off memory here from prior threads

Double check that the modules are asigned to the corners you expect them to be in code, you can get this issue (if i understand your problem correctly) if the modules on the right hand side of the bot are on the left side and vice versa. The modules are turning correctly, but based on the CAN IDs they are on the “wrong” corners of the bot.

Edit: see nstrike’s post below.

2 Likes

I think you might be running into Configuration | YAGSL

2 Likes

We have a similar issue ours move only forward and backward but it cant turn right or left and it doesnt turn back to strating position does anybody have and advice. we use SDS MK4i mdoule with 8 kraken motors with 4 encoders

For CTRE swerve you need to run through the verification steps, for YAGSL those steps are even more manual

Is possibale for you to explain

Yes, but only if i know which one are you using.

Are you using all CTRE Products (Krakens, CANCoders, and Pigeon2.0)?

Yes all the parts are from CTR

only our pdh is rev

Did you use this to create your Swerve project?

No we did not

You should it is optimized for the CTRE ecosystem in a way most teams wont be able to do without years of development.

It does not support any other vendor for your swerve drive so you MUST ONLY use Krakens (for now, TalonFXS coming soon probably), CANCoders, and a Pigeon2 for your swerve drive.

Okay thank you for your help and time

And do we need pigeon to make it work

Yes, for CTRe swerve generator and swerve api you need a pigeon 2.0. For all swerve drive systems you need a gryo to drive the swerve in a field orientated mode which is very highly recommended.

1 Like

Do you have any codes we can use