-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
ExternalAHRS: fixed IMU access, check origin and common logging #26329
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9f826b2
AP_InertialSensor: fixed accel cal simple to remove unused IMUs
tridge ff30f04
AP_ExternalAHRS: added EAHRS_LOG_RATE and common logging
tridge b066887
RC_Channel: disable GPS on external AHRS with GPS_DISABLE
tridge 0fa12ec
AP_ExternalAHRS: added support for GPS disable and fwd flight
tridge 1cc231a
AP_ExternalAHRS: make get_accel() and get_gyro() bool
tridge 9c6d13e
AP_AHRS: don't use accel/gyro from ExternalAHRS unless enabled
tridge e236894
AP_ExternalAHRS: check for origin in pre-arm check
tridge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -115,8 +115,8 @@ class AP_ExternalAHRS { | |||||||||
bool get_speed_down(float &speedD); | ||||||||||
bool pre_arm_check(char *failure_msg, uint8_t failure_msg_len) const; | ||||||||||
void get_filter_status(nav_filter_status &status) const; | ||||||||||
Vector3f get_gyro(void); | ||||||||||
Vector3f get_accel(void); | ||||||||||
bool get_gyro(Vector3f &gyro); | ||||||||||
bool get_accel(Vector3f &accel); | ||||||||||
Comment on lines
+118
to
+119
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Force consumers to check the error state because otherwise, they can read garbage data. |
||||||||||
void send_status_report(class GCS_MAVLINK &link) const; | ||||||||||
|
||||||||||
// update backend | ||||||||||
|
@@ -163,7 +163,12 @@ class AP_ExternalAHRS { | |||||||||
float differential_pressure; // Pa | ||||||||||
float temperature; // degC | ||||||||||
} airspeed_data_message_t; | ||||||||||
|
||||||||||
|
||||||||||
// set GNSS disable for auxillary function GPS_DISABLE | ||||||||||
void set_gnss_disable(bool disable) { | ||||||||||
gnss_is_disabled = disable; | ||||||||||
} | ||||||||||
|
||||||||||
protected: | ||||||||||
|
||||||||||
enum class OPTIONS { | ||||||||||
|
@@ -176,6 +181,7 @@ class AP_ExternalAHRS { | |||||||||
|
||||||||||
AP_Enum<DevType> devtype; | ||||||||||
AP_Int16 rate; | ||||||||||
AP_Int16 log_rate; | ||||||||||
AP_Int16 options; | ||||||||||
AP_Int16 sensors; | ||||||||||
|
||||||||||
|
@@ -190,6 +196,11 @@ class AP_ExternalAHRS { | |||||||||
void set_default_sensors(uint16_t _sensors) { | ||||||||||
sensors.set_default(_sensors); | ||||||||||
} | ||||||||||
|
||||||||||
uint32_t last_log_ms; | ||||||||||
|
||||||||||
// true when user has disabled the GNSS | ||||||||||
bool gnss_is_disabled; | ||||||||||
}; | ||||||||||
|
||||||||||
namespace AP { | ||||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1378,6 +1378,9 @@ bool RC_Channel::do_aux_function(const AUX_FUNC ch_option, const AuxSwitchPos ch | |
|
||
case AUX_FUNC::GPS_DISABLE: | ||
AP::gps().force_disable(ch_flag == AuxSwitchPos::HIGH); | ||
#if HAL_EXTERNAL_AHRS_ENABLED | ||
AP::externalAHRS().set_gnss_disable(ch_flag == AuxSwitchPos::HIGH); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome to see this feature! |
||
#endif | ||
break; | ||
|
||
case AUX_FUNC::GPS_DISABLE_YAW: | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
More-tightly scope this?