Hello.
I am trying to implement a new control design using the AC_PID.cpp.
But while trying to enter the new parameters for the new pid object in parameters.h and parameters.cpp (Using this documentation: Adding a New Parameter to Copter — Dev documentation), I encounter this error from the compiler.
ArduSub/Parameters.h: In constructor ‘Parameters::Parameters()’:
ArduSub/Parameters.h:649:30: error: ‘NEW_P’ was not declared in this scope
new_pid(NEW_P,NEW_I,NEW_D,NEW_IMAX,NEW_FILT_HZ,NEW_DT)
The initializer new_pid is called below the legacy P controller.
The parameter k_param_new_pid was added and AC_PID new_PID; is declared in Parameters.h
The GGROUP(new_pid,“NEW_”,AC_PID) is also added in Parameters.cpp.
NOTE: When the initializer is removed and I try to compile, I receive this error:
/opt/workspace/ArduSub/Parameters.h: In constructor ‘Parameters::Parameters()’:
/opt/workspace/ArduSub/Parameters.h:647:127: error: no matching function for call to ‘AC_PID::AC_PID()’
pid_accel_z(ACCEL_Z_P, ACCEL_Z_I, ACCEL_Z_D, ACCEL_Z_IMAX, ACCEL_Z_FILT_HZ, MAIN_LOOP_SECONDS).
Adding a GSCALAR parameter doesn’t cause any problem though.
Thank
Thanks.