Skip to content

Rename AP::ahrs().get_roll() to AP::ahrs().get_roll_rad() etc. #30222

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
merged 30 commits into from
Jun 5, 2025

Conversation

peterbarker
Copy link
Contributor

@peterbarker peterbarker commented Jun 3, 2025

Costs more bytes on boards with scripting because of the extra bindings

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

Changes all the scripts to choose between renaming to use the new binding or use the other new binding introduced, get_roll_deg etc. Most places change to use _deg

Deprecates the old get_roll etc bindings, so at some stage that space can be reclaimed.

If scripting is disabled then this is a no-compiler-output change. To that end, reviews could probably focus on the LUA script changes.

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

@peterbarker peterbarker force-pushed the pr/rename-ahrs-get-roll branch 3 times, most recently from f829d75 to 6dff5ec Compare June 3, 2025 06:06
singleton AP_AHRS method get_roll float
singleton AP_AHRS method get_roll deprecate Use get_roll_rad
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
singleton AP_AHRS method get_roll deprecate Use get_roll_rad
singleton AP_AHRS method get_roll deprecate Use get_roll_rad or get_roll_deg

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, thanks!

@peterbarker peterbarker force-pushed the pr/rename-ahrs-get-roll branch from ad6f723 to 3d5208a Compare June 3, 2025 09:44
@peterbarker peterbarker force-pushed the pr/rename-ahrs-get-roll branch from 3d5208a to 719084a Compare June 4, 2025 07:23
@peterbarker peterbarker force-pushed the pr/rename-ahrs-get-roll branch from 719084a to fe28602 Compare June 4, 2025 10:51
@peterbarker
Copy link
Contributor Author

I've removed the _deg bindings and marking for merge as discussed at DevCall.

I brought up the fact that you can get degs trivially, and that the flash cost for _deg bindings is real and permanent... so we decided to nix them for now.

@IamPete1 there was the question as to whether we could add custom bindings for get_roll() and instantly deprecate them. This would allow us to not have the bindings in the main code at all. I just wasn't sure we could deprecate custom functions....

@peterbarker peterbarker merged commit d846a6e into ArduPilot:master Jun 5, 2025
102 of 103 checks passed
@peterbarker peterbarker deleted the pr/rename-ahrs-get-roll branch June 5, 2025 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants