How many parameters are supported in the group ParametersG2?

Hi,

I’m defining custom parameters for my ardupilot firmware. I try to use the g2 list.

Somehow the accumulative parameter idx goes beyond 63. Then I get an error as shown in the screenshot.

I check the code and find the definitions below (in the file /libraries/AP_Param/AP_Param.cpp)

It is weird that the idx should be able to go beyond 63 since the variable “idx” is defined as uint8_t. However, the comment “treat idx 0 as 63 for duplicates” makes me confused. Can idx go beyond 63 or not? How many parameters are supported under ParametersG2?

Thanks!

Did you follow the wiki?

hello,
No you cannot got over 63. so you will have to add another parameter table like G3.
If you are using a lot of parameter for your custom code, best is to create your own parameter table called like G10 and set all your parameter in it. That way you will have easier rebase and maintenance with ArduPilot upstream

Khancyr,

Thanks! I followed your suggestion and created a parameter table called G7. But this new parameter table did not store the correct values of newly defined parameters.

For example, I defined a parameter called “CTRLENABLE” with AP_int8 and I set it to 1 in mavproxy. My code logs the value of this parameter and it turned out to be oscillating between 0.5 and 0. I’m not sure if it is mapped to someplace in the parameter storage that’s not supposed to store this parameter.

Thanks!