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_ExternalAHRS: Fixed InertialLabs External AHRS driver #26153

Closed
wants to merge 9 commits into from

Conversation

VSheleverIL
Copy link

@VSheleverIL VSheleverIL commented Feb 6, 2024

  1. According to the Inertial Labs INS documentation, for conversion accelerometer output data, the value of g = 9.8106 m/s should be used. Using the GRAVITY_MSS constant will increase accelerometer errors.

    ins_data.accel = u.accel_data_hr.tofloat().rfu_to_frd()*GRAVITY_MSS*1.0e-6;

  2. The differential pressure in the Inertial Labs INS data format is represented in mbar. Therefore, for use in the ArduPilot algorithm, the value must be converted to Pa (Pascal).

    airspeed_data.differential_pressure = u.differential_pressure*1.0e-4;

  3. Using the offset_bearing() function to calculate northing and easting speeds is incorrect in this case, so a direct calculation has been added.

    velxy.offset_bearing(u.gnss_vel_track.track_over_ground*0.01, u.gnss_vel_track.hor_speed*0.01);

  4. Following the recommendations of Inertial Labs, the output data format (data set) has been expanded to include the following data:

    • Dilution of Precision (there is used in the algorithm);
    • GNSS Heading, GNSS Pitch, GNSS Angles position type, GNSS Heading timestamp (сurrently not implemented in the ArduPilot algorithm.).

    Additionally, logging of these data types has been added.

if (GOT_MSG(BARO_DATA) &&
GOT_MSG(TEMPERATURE)) {
AP::baro().handle_external(baro_data);
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing these definitions doesn't look right. I suspect this change was unintentional.

@@ -267,7 +268,7 @@ bool AP_ExternalAHRS_InertialLabs::check_uart()
}
case MessageType::ACCEL_DATA_HR: {
CHECK_SIZE(u.accel_data_hr);
ins_data.accel = u.accel_data_hr.tofloat().rfu_to_frd()*GRAVITY_MSS*1.0e-6;
ins_data.accel = u.accel_data_hr.tofloat().rfu_to_frd()*9.8106f*1.0e-6;
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: white space at the end.

Copy link
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

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

Hi @VSheleverIL,

Thanks for this. Could you correct the commit title so that it starts with "AP_ExternalAHRS:"? If you look through our commit history you'll see we always prefix our commits with the subsystem to make it easier to see what is affected by the commit. This is especially important during backports. To be clear I meant the commit title, not the PR title.

Could you also fill in the PR description including testing that has been performed?

@VSheleverIL VSheleverIL changed the title Fixed InertialLabs External AHRS driver AP_ExternalAHRS: Fixed InertialLabs External AHRS driver Feb 7, 2024
@VSheleverIL VSheleverIL closed this Feb 7, 2024
@VSheleverIL
Copy link
Author

Hi @VSheleverIL,

Thanks for this. Could you correct the commit title so that it starts with "AP_ExternalAHRS:"? If you look through our commit history you'll see we always prefix our commits with the subsystem to make it easier to see what is affected by the commit. This is especially important during backports. To be clear I meant the commit title, not the PR title.

Could you also fill in the PR description including testing that has been performed?

Hi @rmackay9,

Thank you for your feedback. I have made changes according to your comments. Please review the outcome. Thank you!

@VSheleverIL VSheleverIL reopened this Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants