RobotPy 2024 Beta 3 now available

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
  • REV and NavX vendors are available
    • CTRE is managing their own releases this year, and I believe it will be available soon
  • Our examples repository has a 2024-beta branch
11 Likes

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.

2 Likes

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].

Thanks for the update link @Jacob_C .

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.

If anyone else is interested in pursuing this, or checking my work, the WIP repo is GitHub - Lambda-Corps/2024_Python_beta

Is simulation supported in phoenix6 for robotpy? I may just be missing it but I’m not finding the .get_sim_state on the TalonFX object.

The TalonFXSimState class definition isn’t anywhere to be found that I can see, so any getters for it won’t be there either.

Is there a pypi package for nt4 yet?

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.

Thanks Jacob.

For those interested, link to the github issue: Add Python Simulation Support to Phoenix 6 · Issue #52 · CrossTheRoadElec/Phoenix-Releases · GitHub

Correct me if I’m wrong but this hasn’t been updated since the switch to mostrobotpy

The 2024 releases for pyntcore are built from mostrobotpy.

It seems the latest release on pypi is still 2023, is there a debug release somewhere else?

I see 2024 releases at the link I posted (marked as pre-release). What do you see at that link?

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.

Ah there it is, thank you!

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.

Can you share the following

  • A screenshot of all the devices in Tuner
  • Your CTRE json located in your vendordeps folder.

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.)

Oh yeah, Python. I think there is a pip command to get your version of the dependency.