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: http://ardupilot.org/dev/docs/code-overview-adding-a-new-parameter.html), 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
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.