global: Maximum number of WPs can be set in board config
Solved Problem
The maximum number of WAYPOINT is 500. I create more than 500 flight plans.
Solution
RAM size and flash size are different by FC. Therefore, the maximum number of WAYPOINT can be set in board_config.h.
Changelog Entry
None
Alternatives
None
Test coverage
Error message was displayed on PIXHAWK6X-RT after uploading a flight plan that exceeded the maximum number of WAYPOINT.
Context
I think if we make this configurable it would be better to introduce a Kconfig symbol.
For example CONFIG_NUM_MISSIONS_SUPPORTED with the current default 500
https://github.com/PX4/PX4-Autopilot/blob/5082d23777abd44c5ea7b37444be47ffece6db44/src/modules/navigator/Kconfig
I added the WP max number to Kconfig. I changed default.px4board to allow the maximum number of WPs to be specified.
CONFIG_NUM_MISSIONS with y to set the value of CONFIG_NUM_MISSIONS_SUPPORTED to NUM_MISSIONS_SUPPORTED.
Specifying n for CONFIG_NUM_MISSIONS sets the default value to NUM_MISSIONS_SUPPORTED.
CONFIG_NUM_MISSIONS set y
CONFIG_NUM_MISSIONS set n
The NUM_MISSIONS is redundant please just only use NUM_MISSIONS_SUPPORTED
Also there's a Kconfig naming convention https://docs.px4.io/main/en/hardware/porting_guide_config.html#px4-kconfig-symbol-naming-convention
Please rename NUM_MISSIONS_SUPPORTED to NAVIGATOR_NUM_MISSIONS_SUPPORTED and guard it with if MODULES_NAVIGATOR