CTRE Phoenix Library

Hello! I am from Rookie Team 8714 and I need help adding the CTRE Phoenix library to VS Code.

I followed the Phoenix document and installed the extension: FRC: VS Code C++/Java — Phoenix documentation
I tried reinstall the library and it says “Library added”.

However, when I import WPI_TalonFX, the class is not found.

Thank you so much!
Team 8714.

How are u installing the libraries?

Does the vendor dependency show up in VS code in your explorer tab like below? I highlighted in blue just to show VS Code won’t do that.

Also what did your import statement look like?

I followed the document, it says there are 2 ways to install the library:

  1. Install the library offline: go to Manage Library Vendors → Select CTRE Phoenix (however, i did not find the CTRE Phoenix)
  2. Install the library online: go to Mange Library Vendors → Paste the URL provided by the vendor.

I don’t see it show up in my explorer tab. I only see WPILibOldCommands.json
Could you help me, please?

You probably need to refresh intellisense. Open the Command Palette and run Java: Clean Java Language Server Workspace

This is my import statement: import com.ctre.phoenix.motorcontrol.can.WPI_TalonFX;

And after that if it isn’t there try the manage vendor libraries and paste the url again.

I tried installing the older version of the library (v5.19.4.1) and it worked. I can now import the class from the CTRE Phoenix library.
Thank you!

If thats the case, that means you’re running a 2021 robot project. You need to be running 2022 WPILib to be compatible with the 2022 image, and to be legal in season.

Needing to run the old version feels like a red flag. Are you sure you are running the 2022 wpilib vs code and not an old version?

Don’t move forward until you have the 2022 tools installed successfully.

Save yourself the headache of trying to get this fixed at inspection time of your first event.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.