Sorry, if this is a very elementary problem. But I haven’t able to solve it for 5 straight coding days.
I’m developing some quatrotor controller with ArduCopter V3.3-dev, which I think have the same parameter structure with 3.2. And for those controller, I need some additional parameters, some of them (e,g. inertia) are in vector form.
I’ve read about the article on how to add a parameters but still unable to pass the compiler:
dev.ardupilot.com/wiki/apmcopter … overview….
Here is what I’ve done(for one of the parameter):
[ul]
add parameter number k_param_ew_inertia @ Parameters.h
add variable declaration AP_Vector3f inertia below @ Parameters.h (AP_Vector3 won’t work as stated in the guiding page)
trying to get it work in Parameters.pde like:
[/ul]
// @Param: EW_IXX
// @DisplayName: Ewing inertia Ixx
// @Description: inertia Ixx
// @Range: 0 1000
// @User: Advanced
// @Param: EW_IYY
// @DisplayName: Ewing inertia Iyy
// @Description: inertia Iyy
// @Range: 0 1000
// @User: Advanced
// @Param: EW_IZZ
// @DisplayName: Ewing inertia Izz
// @Description: inertia Izz
// @Range: 0 1000
// @User: Advanced
GSCALAR(inertia, "INERTIA", INERTIA_V3),
[ul]
with defines in APM_Config.h as follows (Althought the guiding page told me to place in config.h, but config.h told me to do that in APM_Config.h)[/ul]
#define IXX_DEFAULT 0.002f
#define IYY_DEFAULT 0.002f
#define IZZ_DEFAULT 0.004f
#define INERTIA_V3 Vector3f(IXX_DEFAULT, IYY_DEFAULT, IZZ_DEFAULT)
[ul]the compiler gives the error:[/ul]
I do understand since I use the G-SCALAR it should be scalar, right? Then how should I do this right?
I’ve tried to initialize the AP_Vectors3 in initializers of Parameters.h like:
inertia(IXX_DEFAULT, IYY_DEFAULT, IZZ_DEFAULT),
Then compiler would give:
And call that in the constructor won’t work either.
So who do I do a Vector3 parameter exactly? Is there anything I’ve missed or misunderstand?
The parameter part of the code is a little difficult for me and I’m not quite understand it.
I appreciate anyone who read this and any advice is wellcome!