PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

global: Maximum number of WPs can be set in board config

Open muramura opened this issue 1 year ago • 3 comments

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

Screenshot from 2024-02-12 16-30-31

muramura avatar Feb 12 '24 07:02 muramura

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

PetervdPerk-NXP avatar Feb 12 '24 08:02 PetervdPerk-NXP

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 Screenshot from 2024-02-18 13-48-53

CONFIG_NUM_MISSIONS set n Screenshot from 2024-02-18 13-51-09

muramura avatar Feb 18 '24 05:02 muramura

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

PetervdPerk-NXP avatar Feb 19 '24 15:02 PetervdPerk-NXP