HeadingSmoothing: set correct maximum heading

The velocity smoothing library constrains the maximum vellocity.
I set the default constraint to 0 to find these exact issues.
The heading smoothing did not initialize the maximum velocity
which in this use case is the maximum heading.
So heading was always constrained to 0 -> north until this change.
This commit is contained in:
Matthias Grob 2023-11-27 16:25:05 +01:00
parent 5a2efc1cb2
commit d014d76ca7
2 changed files with 6 additions and 1 deletions

View File

@ -33,6 +33,11 @@
#include "HeadingSmoothing.hpp"
HeadingSmoothing::HeadingSmoothing()
{
_velocity_smoothing.setMaxVel(M_PI_F); // smoothed "velocity" is heading [-pi, pi]
}
void HeadingSmoothing::reset(const float heading, const float heading_rate)
{
const float wrapped_heading = matrix::wrap_pi(heading);

View File

@ -54,7 +54,7 @@
class HeadingSmoothing
{
public:
HeadingSmoothing() = default;
HeadingSmoothing();
~HeadingSmoothing() = default;
/** @param max_heading_rate [rad/s] */