Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCS_MAVLink: simplify MissionItemProtocol get_item interface #29223

Conversation

peterbarker
Copy link
Contributor

stop passing through _link and the original msg, move use to the base class instead.

starts fence and rally also using the "correct the GCS's count" code.

This also corrects the error code when correcting the GCS's count to INVALID_SEQUENCE rather than just ERROR

Board                    AP_Periph  blimp  bootloader  copter  heli  iofirmware  plane  rover  sub
CubeOrange-periph-heavy  144               *
CubeRedPrimary                      24     *           24      24                24     24     24
Durandal                            64     *           64      64                64     64     64
Hitec-Airspeed           *                 *
KakuteH7-bdshot                     24     *           24      24                24     24     24
MatekF405                           24     *           24      24                24     24     24
Pixhawk1-1M-bdshot                  24                 24      24                24     24     24
f103-QiotekPeriph        *                 *
f303-Universal           *                 *
iomcu                                                                *
revo-mini                           24     *           24      24                24     24     24
skyviper-journey                                       24
skyviper-v2450                                         24

This should allow for cleanups in the AP_Filesystem_Mission code in the future.

mavlink_mission_item_int_t ret_packet;
const MAV_MISSION_RESULT result_code = get_item(_link, msg, packet, ret_packet);
const MAV_MISSION_RESULT result_code = get_item(packet.seq, ret_packet);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possible can avoid item_exists() and check return code from get_item()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Saved 8 or 16 bytes...

Board                    AP_Periph  blimp  bootloader  copter  heli  iofirmware  plane  rover  sub
CubeOrange-periph-heavy  88                *                                                   
CubeRedPrimary                      8      *           16      16                16     16     8
Durandal                            8      *           8       8                 8      8      8
Hitec-Airspeed           *                 *                                                   
KakuteH7-bdshot                     16     *           8       8                 16     8      8
MatekF405                           8      *           8       16                16     16     8
Pixhawk1-1M-bdshot                  8                  8       16                16     16     8
f103-QiotekPeriph        *                 *                                                   
f303-Universal           *                 *                                                   
iomcu                                                                *                         
revo-mini                           16     *           16      8                 16     16     16
skyviper-journey                                       16                                      
skyviper-v2450                                         16                                      

@peterbarker peterbarker force-pushed the pr/missionitemprotocol-get-item-simpler branch from 1eb7079 to d3d4ea5 Compare February 5, 2025 11:05
stop passing through _link and the original msg, move use to the base class instead.

starts fence and rally also using the "correct the GCS's count" code.

This also corrects the error code when correcting the GCS's count to INVALID_SEQUENCE rather than just ERROR
@peterbarker peterbarker force-pushed the pr/missionitemprotocol-get-item-simpler branch from d3d4ea5 to 4550ab9 Compare February 5, 2025 11:06
@peterbarker peterbarker merged commit 4161c42 into ArduPilot:master Feb 5, 2025
100 checks passed
@peterbarker peterbarker deleted the pr/missionitemprotocol-get-item-simpler branch February 5, 2025 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants