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

AP_Airspeed move into AP_Vehicle #18838

Conversation

hendjoshsr71
Copy link
Member

This moves AP_Airspeed into AP_Vehicle as a basis for next adding airspeed into copter in this PR #18813

I could use a little help with the #ifdefs as I couldn't figure out a way to get everything I wanted without putting vehicle specific defines in AP_Airspeed.??

The biggest being Airspeed must be enabled for all vehicles & boards it is currently enabled on. And then be able to exclude APM_BUILD_ArduCopter being built-in by default.

@hendjoshsr71 hendjoshsr71 force-pushed the pr/move_airspeed_to_ap_vehicle branch 2 times, most recently from 007448e to 950d9d0 Compare October 4, 2021 11:11
ArduPlane/sensors.cpp Outdated Show resolved Hide resolved
libraries/AP_Airspeed/AP_Airspeed.h Outdated Show resolved Hide resolved
ArduPlane/GCS_Plane.cpp Outdated Show resolved Hide resolved
@tridge
Copy link
Contributor

tridge commented Oct 5, 2021

the saving of 208 bytes is suspicious

ArduPlane/ArduPlane.cpp Outdated Show resolved Hide resolved
@hendjoshsr71 hendjoshsr71 force-pushed the pr/move_airspeed_to_ap_vehicle branch 2 times, most recently from c326ae0 to 21ce4fb Compare October 8, 2021 09:09
@hendjoshsr71
Copy link
Member Author

Added conversion code for Rover & Sub including an AP_Param method to help with moving the whole sub-group. Turns out my previous method didn't work.

However, there is an argument to be made that for Rover(Sailboats) & Sub that conversion for this may be overkill?
I still want to test a bit more on plane and on hardware but It seems conversion code isn't necessary in this case?

@hendjoshsr71
Copy link
Member Author

the saving of 208 bytes is suspicious

@tridge
Yes, this was correctly suspicious. It seems that in GCS.cpp the vehicle specific defines do not get set.
The below define won't pick up the airspeed control sensors status flags that I moved up into GCS.cpp

If you have some time to help me with this it would be appreciated? It seems like a waf build system issue that I've been unable to solve yet.

#define HAL_AIRSPEED_ENABLED APM_BUILD_TYPE(APM_BUILD_ArduPlane) || APM_BUILD_TYPE(APM_BUILD_Rover)  || \
                             APM_BUILD_TYPE(APM_BUILD_ArduSub)   || APM_BUILD_TYPE(APM_BUILD_Replay)

@hendjoshsr71
Copy link
Member Author

I've tested this param conversion for Plane on a CubeOrange and all seems well. I also tested the param conversion for Rover and Sub in SITL.

I've currently only set the HAL_AIRSPEED_ENABLED define for the vehicle libraries due to issues with APM_BUILD_TYPE.

@hendjoshsr71
Copy link
Member Author

Closing this as these commits were merged in #18813

@hendjoshsr71 hendjoshsr71 deleted the pr/move_airspeed_to_ap_vehicle branch January 19, 2022 07:28
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.

None yet

6 participants