Skip to content

Allow sending of rangefinder message to be compiled out of the code #29923

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

Merged

Conversation

peterbarker
Copy link
Contributor

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

Minimal actual flash savings:

###### Enabling RANGEFINDER_SENDING(AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED) on copter costs -128 bytes
###### Enabling RANGEFINDER_SENDING(AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED) on plane costs -120 bytes
###### Enabling RANGEFINDER_SENDING(AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED) on rover costs -256 bytes
###### Enabling RANGEFINDER_SENDING(AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED) on antennatracker costs -128 bytes
###### Enabling RANGEFINDER_SENDING(AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED) on sub costs -128 bytes
###### Enabling RANGEFINDER_SENDING(AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED) on blimp costs -128 bytes

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the conditional compilation of the rangefinder MAVLink message by replacing references to AP_RANGEFINDER_ENABLED with the new AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED macro in most relevant locations.

  • Refactored conditional blocks in files to guard the MSG_RANGEFINDER-related code with the new macro.
  • Updated configuration and build scripts to include the new feature flag for rangefinder message sending.
  • Maintained separate conditional compilation for water depth functionality on Rover where intended.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
libraries/GCS_MAVLink/ap_message.h Updated conditional block to include MSG_RANGEFINDER only if new macro is enabled.
libraries/GCS_MAVLink/GCS_config.h Added include and macro definition for AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED.
libraries/GCS_MAVLink/GCS_MAVLink_Parameters.cpp Replaced AP_RANGEFINDER_ENABLED with the new macro for MSG_RANGEFINDER and organized water depth condition.
libraries/GCS_MAVLink/GCS_Common.cpp Updated conditional and ending comments for rangefinder message sending.
libraries/GCS_MAVLink/GCS.h Updated the send_rangefinder declaration to be conditionally compiled with the new macro.
Tools/scripts/extract_features.py Added the new feature mapping for AP_MAVLINK_MSG_RANGEFINDER_SENDING_ENABLED.
Tools/scripts/build_options.py Included a new build feature flag for RANGEFINDER_SENDING.
Rover/GCS_MAVLink_Rover.h Updated the send_rangefinder declaration with the new macro while keeping water depth condition unchanged.
Rover/GCS_MAVLink_Rover.cpp Updated the rangefinder sending functions to use the new conditional macro.

@peterbarker peterbarker force-pushed the pr/rangefinder-sending-optional branch from c6110a6 to 216eb6f Compare April 29, 2025 23:35
@peterbarker peterbarker force-pushed the pr/rangefinder-sending-optional branch from 216eb6f to affc4bd Compare April 30, 2025 05:45
@peterbarker peterbarker force-pushed the pr/rangefinder-sending-optional branch 3 times, most recently from fab3d67 to c9cf1a2 Compare May 5, 2025 22:55
@peterbarker peterbarker force-pushed the pr/rangefinder-sending-optional branch 2 times, most recently from f690610 to bad5382 Compare May 6, 2025 04:08
@peterbarker peterbarker force-pushed the pr/rangefinder-sending-optional branch from bad5382 to e0a96c5 Compare May 7, 2025 08:41
@peterbarker
Copy link
Contributor Author

This PR is a no-binary-output change.

Removing sending rangefinder message - which we intend to do in quite-some-time - will impact the wiki a bit. For example on https://ardupilot.org/copter/docs/common-ainstein-lrd1.html we have a picture showing "sonarrange" - and given the next field is voltage I'm betting those interface elements are actually coming from RANGEFINDER (@Hwurzburg )

@peterbarker peterbarker merged commit 407b270 into ArduPilot:master May 8, 2025
102 checks passed
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label May 8, 2025
@peterbarker peterbarker deleted the pr/rangefinder-sending-optional branch May 9, 2025 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants