Python will be an official FRC language for 2024, and this is our first beta release for the season. We’ve done a lot of work on infrastructure related to RobotPy, and hopefully it will be simpler to maintain in the future.
There is no updated documentation at this time. To install the beta release, you can do pip install robotpy==2024.0.0b3. See our normal documentation for installation, deployment, etc – most things haven’t changed.
Development has moved to a monorepo called mostrobotpy
Most WPILib 2024.0.0 beta 3 features are available
NT4 structured binding support is not implemented
Python 3.8 and 3.9 support is broken, oops
The commands implementation is now pure python thanks to @TheTripleV, please try it out and report bugs
Happy to report that a release of Phoenix v6 for RobotPy is now available!
We’ll have examples and more documentation as beta progresses.
The RobotPy folks have graciously agreed to continue publishing the Phoenix v5 python library, which should be available in the near future.
Also be sure to check out the 2024 FRC Beta to test and give feedback for any of the software you use! Beta feedback is one of the best ways for FRC software developers to make sure everything is ship-shape for kickoff.
robotpy-ctre has been updated with the Phoenix v5 beta package. We have renamed the ctre package to phoenix5 (though the github repository and the name on pypi is still robotpy-ctre).
You can install phoenix5 or phoenix6 via pip install robotpy==2024.0.0b3.post1[phoenix5].
Searching the API documentation, I don’t see some of the classes related to simulation yet. I would imagine those are in the works still or do you need an issue filed on github somewhere?
Trying to port the Java Phoenix 6 CommandBasedDrive example to Python doesn’t work because the Phoenix 6 Python API has no notion of TalonFXSimState. I can’t find anything relating to the relevant methods in there to set the bus voltage etc.
Edit to add:
I added an issue on the Phoenix Releases github page.
You’re correct that the simstate functionality is not currently in the phoenix6 python package - it’s planned and coming soon but no exact ETA date yet.
We’ll be sure to update @NewtonCrosby’s issue tracker on the Phoenix releases repo when the update arrives.
Okay, thanks for confirming. Can you comment on the set pos api not being present that is also mentioned in the GitHub issue? I was struggling to find that last night too.
Not entirely sure where to ask this question since I’m not entirely sure what’s wrong, so sorry in advance if this is the wrong spot.
I’m trying to get a swerve robot up and running with the 2024 beta software, and I’m running into problems with all my CTRE devices running Phoenix 5. All software works in simulation, but I’m trying to get it to work on a real-world robot. For reference, I’m using NEO driven Mk4i L2 modules, and the robot was previously working in 2023 software before performing the setup steps for 2024 beta.
(1) The Pigeon2.0 on board keeps reporting that its firmware is too old (Error -8, Firmware must be newer than 22.0). I cracked open Phoenix Tuner X and made sure my firmware was up to date, it is 22.7.3.0. In addition (though I would expect this with incorrect firmware), the device does not respond to any calls with values that make sense, it just always reports 0 for both getYaw() and getFirmwareVersion().
(2) CANCoders also report 0 for any function call. They are also on the newest firmware version available. I also confirmed in Tuner X that the CANCoders do actually measure position, and that they’re doing so as I expect them to.
Any help or troubleshooting options would be appreciated. I feel like I’ve missed some key setup step somewhere along the line, but can’t figure out what.
I can’t seem to find a folder labeled “vendordeps” anywhere in my project files (I don’t know if this is related to that not showing up, but I’m not using VSCode for this right now. I’ve been using PyCharm throughout the year and haven’t had any issues 'til now.)