AP_Vehicle: correct description of G_Dt #21255
Open
+1
−2
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.
I'm quite sure this is not the correct fix for this problem - I'm creating this PR for discussion.
G_Dtshould probable rightly be set fromget_last_loop_time_srather thanget_loop_period_s. The former is the measured time for the last loop. The latter is memoised at vehicle startup based on the configured loop rate (SCHED_LOOP_RATE).#13399 made us consistent across vehicles, but did move us from using the last loop period on Copter to using the configured loop period instead. It was the only vehicle which was using the last loop period.
I think the correct fix here is probably to eliminate
G_Dtaltogether, and have each place where it was being used changed to either use the desired loop rate (when initialising slew rates, for example), or to use actual last loop period (when updating filters, perhaps?). grep finds 74 matches forG_Dt, but some of the matches look identical-in-shape to others meaning it won't be 74 decisions to make.