-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Add AP_AirSensor library #29219
base: master
Are you sure you want to change the base?
Add AP_AirSensor library #29219
Conversation
Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
* Scripting bindings don't seem to show up yet Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
Signed-off-by: Ryan Friedman <[email protected]>
enum class Type { | ||
NONE, | ||
#if AP_AIRSENSOR_SCRIPTING_ENABLED | ||
SCRIPTING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SCRIPTING | |
SCRIPTING, |
_backend_type = (AP_AirSensor::Type )_params.type.get(); | ||
} | ||
|
||
bool AP_AirSensor_Backend::get_aoa(float& a) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be consistent about where that opening brace is!
ArduPilot convention is on a fresh line, but we differ across libraries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll run astyle on all this before it's actually put up for review. I'm more concerned with architecture than code style at this moment.
virtual bool init() = 0; | ||
virtual ~AP_AirSensor_Backend() {} | ||
virtual void update() = 0; | ||
// get measured wind vector [m/s] | ||
virtual bool get_wind(Vector3f& wind_uvw) const { return false; } | ||
// get measured angle of attack [rad] | ||
virtual bool get_aoa(float& a) const; | ||
|
||
#if AP_SCRIPTING_ENABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
certical whitespace here somewhere, please!
#endif | ||
|
||
#ifndef AP_AIRSENSOR_SCRIPTING_ENABLED | ||
#define AP_AIRSENSOR_SCRIPTING_ENABLED (AP_AIRSENSOR_ENABLED && AP_SCRIPTING_ENABLED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create an AP_AIRSENSOR_BACKEND_DEFAULT_ENABLED
|
Looking for initial feedback- see the README.
A bit of an alternative to #29107 that leaves AP_Airspeed as is