-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Use sample time in Attitude logging #28005
Conversation
b1d6586
to
8bfd640
Compare
Pretty sure we used to do this, and it allowed time to go backwards in logs, and that was painful when you were trying to compare messages... Maybe an extra field? |
Do we guarantee that logs are monotonically increasing? I guess if we do then an extra field would be the way, but that will make log analysis of these messages harder |
I don't recall this but we have line numbers and a time stamp. I don't see why we would have a time stamp associated with the time the log message was communicated to the logging thread rather than the time the data in the message was relevant. |
8bfd640
to
fd466ef
Compare
Will need a rework after #28026 has been merged. |
394b89a
to
f874287
Compare
log attitude dt
f874287
to
de6b842
Compare
@@ -173,7 +173,7 @@ class AP_AHRS_View | |||
} | |||
|
|||
// Logging Functions | |||
void Write_AttitudeView(const Vector3f &targets) 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.
random whitespace change
@@ -53,14 +54,15 @@ void AP_AHRS::Write_Attitude(const Vector3f &targets) const | |||
{ | |||
const struct log_Attitude pkt{ | |||
LOG_PACKET_HEADER_INIT(LOG_ATTITUDE_MSG), | |||
time_us : AP_HAL::micros64(), | |||
time_us : AP::scheduler().get_loop_start_time_us(), |
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.
This introduces a coupling between AHRS and the scheduler.
We merged a change to use the sample time in the rate message - this uses a different pattern where we don't pass that timestamp in...
Resolution at DevCall is that we'll create an Which I think means we want to close this! |
we decided to create an ANG message in AC_AttitudeControl instead |
Closing this one as we're going with |
When interpreting rate and attitude control logs it is important to be able to correlate the log message with when the data was captured rather than when the log was written. This is especially important as we increase the frequency of the rate loop and make it asynchronous. This small change adds the ability to capture the sample time from the scheduler and then uses that in the attitude log message.
Split from #27029