Skip to content

Conversation

@PickleFace5
Copy link
Contributor

@PickleFace5 PickleFace5 commented Nov 25, 2024

I have translated the SwerveSetpointGenerator and such to Python, however there’s a few more things I plan to add:

  • Additional Kinematics support (currently only works with 4 modules) A fair bit of PathPlanner currently only works with 4 modules, so this won't be added.
  • Additional init constructor

I also need to test to ensure I translated it correctly.

@github-actions github-actions bot added the PathPlannerLib Changes to PathPlannerLib label Nov 25, 2024
@mjansen4857
Copy link
Owner

I don't think additional kinematics is required at the moment, as various places in the library for all languages currently only support using 4 modules. This is mainly due to path flipping, which can only handle properly flipping feedforwards if the modules are in FL, FR, BL, BR order, which is only possible when using 4.

@PickleFace5
Copy link
Contributor Author

PickleFace5 commented Nov 25, 2024

I figured that was the case, but I kept is as a possible. I'll probably leave the code how it is in case someone wants to update it to run with other module configurations in the future, since most of it is built to work with an aribtrary amount of modules.
The issue is that for C++ and Python, the kinematics class is split into multiple classes, like SwerveDrive4Kinematics, SwerveDrive6Kinematics, etc. I have the translation built on the "standard" SD4Kinematics, but if someone wants to add support for other configurations, they're free to do so.

@PickleFace5
Copy link
Contributor Author

After fixing all the type errors and adding the additional constructors, I seem to be having a logic error with the drive motor calculations. The steer motors seem to be working correctly, but the drive motors output nearly nothing. This could be from my implementation, but I'll have to double check my translation when I get the chance sometime soon.

@PickleFace5
Copy link
Contributor Author

Still no luck 😔

@PickleFace5
Copy link
Contributor Author

I forgot 2 parenthesis, but after adding them back the setpoint generator works! All that's left to do is to update the documentation, but I'll mark this PR as ready for review.

@PickleFace5 PickleFace5 marked this pull request as ready for review November 27, 2024 05:52
@github-actions github-actions bot added the documentation Pull requests that update the documentation site files label Nov 27, 2024
@PickleFace5
Copy link
Contributor Author

Should be good now.

@mjansen4857
Copy link
Owner

Could you duplicate the check from #927 in this?

@mjansen4857 mjansen4857 added this to the Kickoff Release milestone Dec 17, 2024
@mjansen4857 mjansen4857 enabled auto-merge (squash) December 19, 2024 17:15
@mjansen4857 mjansen4857 merged commit cfdb5b4 into mjansen4857:main Dec 19, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Pull requests that update the documentation site files PathPlannerLib Changes to PathPlannerLib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants