Closed pietrodn closed 5 years ago
Looks good, but what I don't like so much is that it can 'drift off' by an arbitrary amount, for example when flying circles (especially fixed-wings). E.g. https://logs.px4.io/plot_app?log=6452c397-a8a5-4ab9-a009-ebb6431360bd
You're right. However I can't think of a smart way to solve this problem. Would an interactive control to activate or deactivate unwrapping be an acceptable solution?
However I can't think of a smart way to solve this problem.
I don't have a good solution either - except to check if the min/max exceeds a limit and use the old behavior in that case. But generally I'd like to add as little logic as possible to plots, to keep them simple to interprete.
Would an interactive control to activate or deactivate unwrapping be an acceptable solution?
Preferably not, to keep the interface simple.
We can do the change and then see if there are cases where this behavior is not acceptable.
Merging now. A possible alternative would be to check if the the tracking error is > PI, and if so only adjust the estimated yaw.
Attitude plots (Roll Angle, Pitch Angle, Yaw Angle) are wrapped from -180° to 180°. This causes poor plots, with weird "jumps", when the drone passes the 180° threshold, e.g., by oscillating in yaw around 180°:
By using the numpy.unwrap() method, we can avoid those jumps and obtain a more continuous graph. The following example is the same plot as before, with the patch applied: