Transitioning to Swerve Drive in Python - Seeking Guidance

Hey Chief Delphi community,

I’m Cash from BC Robotics 4504, and we’re excited to share our journey as we make a significant shift from a traditional tank drive to a swerve drive this season. We believe this new paradigm will bring great advantages to our team, but we’re currently facing a unique challenge due to our Python-based approach.

Current State:
To give you a bit of context, our team primarily uses Python with the RobotPy & MagicRobot frameworks. While this choice aligns with our preferences, we’ve found it challenging to locate relevant information on how to program a swerve drive using Python. Most of the available resources we’ve come across predominantly focus on Java or C++. This is where we’re hoping the Chief Delphi community can step in and guide us in the right direction.

Challenges: Our main challenges include the scarcity of Python-specific resources for swerve drive programming. We’ve scoured the internet and found that many teams opt for Java or C++ when implementing swerve drive systems. As a result, we’re in search of any Python-centric guidance, code snippets, or tips that can help us adapt this exciting technology to our preferred language.

If you’ve got experience with Python and swerve drives, or if you know of any resources or teams that have tackled similar challenges, we’d greatly appreciate your insights. Whether it’s pointing us to relevant documentation, sharing Python swerve drive libraries, or providing code examples, your assistance will be invaluable to our team’s success. We’re eager to learn and adapt, so any suggestions are welcome.

Thank you in advance for your support and guidance. We’re looking forward to connecting with the Chief Delphi community and making this transition to swerve drive a smooth one.

2 Likes

@Dee probably has some comments here, 7407 looked very functional and used python for their swerve.

I’ll also be watching this thread because I’m getting increasingly irked at how verbose java is for some things. And don’t suggest Labview, don’t you put that evil on me Ricky Bobby!

1 Like

4774 has been using python for many years and has been doing swerve + magicbot for a number of them. I believe they even have their swerve working in simulation?

2 Likes

Our team recently decided to transition from Java to Python. It’s very easy to convert any Java code into RobotPy Python. If you can’t find an example of a system you want in Python, look at the Java code and you can easily replicate it in Python.
Here is our code from last year which has a swerve drive (translated from Java to Python):

2 Likes

We decided to switch to python this year because our swerve only works in python. GitHub - Team997Coders/pyswerve_2024