mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
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:
@@ -33,6 +33,11 @@
|
|||||||
|
|
||||||
#include "HeadingSmoothing.hpp"
|
#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)
|
void HeadingSmoothing::reset(const float heading, const float heading_rate)
|
||||||
{
|
{
|
||||||
const float wrapped_heading = matrix::wrap_pi(heading);
|
const float wrapped_heading = matrix::wrap_pi(heading);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
class HeadingSmoothing
|
class HeadingSmoothing
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HeadingSmoothing() = default;
|
HeadingSmoothing();
|
||||||
~HeadingSmoothing() = default;
|
~HeadingSmoothing() = default;
|
||||||
|
|
||||||
/** @param max_heading_rate [rad/s] */
|
/** @param max_heading_rate [rad/s] */
|
||||||
|
|||||||
Reference in New Issue
Block a user