Skip to content

Conversation

@turtle4831
Copy link

Revamps DifferentialSwerveModuleBase.java

@Mineinjava
Copy link
Owner

Hi!
thanks for this contribution. Can you send a video of it working?

This looks like a great contribution. Sorry that I missed it for so long.

@turtle4831
Copy link
Author

We dismantled or diffy swerve after drop but I asked a local team who built one if I can borrow it ill send a video when I pick it up (it is only one module idk if thats fine)

@Mineinjava
Copy link
Owner

Or we can also have @Astr0clad who is more familiar with Diffy take a more thorough look at it.

@cmontigel
Copy link
Collaborator

At first glance, the kinematics seem more in line with a two-motor coaxial setup. I will take a second look tonight to verify this though.

@Mineinjava
Copy link
Owner

@Astr0clad any update?

@cmontigel
Copy link
Collaborator

I just wanted to follow up here...

@turtle4831 Are you still able to get a video of this? Based on my readthroughs, the kinematics seem more in line with coaxial than differential swerve.

@turtle4831
Copy link
Author

the kinematics should be the same i only changed the way the modules get power, lowk mightve messed it up though

@cmontigel
Copy link
Collaborator

I think the part that is tripping me up most is this:

    motorSpeeds[0] = speed;
    motorSpeeds[1] = angle;

In differential swerve, you normally need to take a combination of the pod rotation speed and the wheel speed, but it appears that you are assigning one motor your wheel speed and the second motor the pod rotation speed. Maybe it works out in the end, but I'm not entirely sure ngl. Could you elaborate on the math/theory behind it, I could be wrong here.

Sidenote: @Mineinjava we should probably look at getting some unit tests set up for the different swerve kinematics classes.

@Mineinjava
Copy link
Owner

Unit tests for kinematic classes are definitely a good idea.

See also https://astr0clad.github.io/quail_docs/guides/math/#reverse-kinematics-differential-swerve

@turtle4831
Copy link
Author

oh oops i didnt notice that, the commented code above that is what it shouldve been

@Fenghuang4
Copy link

@turtle4831 It is also quite common to return the module state through some function. You have speed set mutators, but nothing to return data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants