PID Control with Victor SPX motor controllers

Has anyone successfully used the built in WPIlib PIDController class with VictorSPX motor controllers?

When attempting to do this I discovered that the PIDController does not want to accept the VictorSPX motor controller object as a PIDOutput. The specific error is: error: no matching function for call to ‘frc::PIDController::PIDController(double&, double&, double&, double&, frc::Encoder*&, ctre::phoenix::motorcontrol::can::VictorSPX*&, double&)’

The root cause seems to be that the CTRE libraries for the VictorSPX do not inherit the PIDOutput class in WPIlib. I was wondering if anyone had figured out a workaround for this short of writing an entirely new PID control class.

CTRE provides WPI_VictorSPX for this.

https://www.ctr-electronics.com/downloads/api/cpp/html/classctre_1_1phoenix_1_1motorcontrol_1_1can_1_1_w_p_i___victor_s_p_x.html

2 Likes

Thanks, missed that in the documentation.

Did using WPI_VictorSPX solve it for you? We are getting the same error message but we are using WPI_VictorSPX.

Yes, it did.

Thanks. We still can’t figure it out, so we are writing our own PID. We are using a mag encoder connected to the Rio. Ran out of Talons :frowning: