mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 10:11:36 +08:00
ekf2: move "using" keywords to cpp
This commit is contained in:
@@ -33,6 +33,10 @@
|
|||||||
|
|
||||||
#include "EKF2.hpp"
|
#include "EKF2.hpp"
|
||||||
|
|
||||||
|
using namespace time_literals;
|
||||||
|
|
||||||
|
using math::constrain;
|
||||||
|
|
||||||
EKF2::EKF2(bool replay_mode):
|
EKF2::EKF2(bool replay_mode):
|
||||||
ModuleParams(nullptr),
|
ModuleParams(nullptr),
|
||||||
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::nav_and_controllers),
|
ScheduledWorkItem(MODULE_NAME, px4::wq_configurations::nav_and_controllers),
|
||||||
@@ -1961,7 +1965,7 @@ float EKF2::filter_altitude_ellipsoid(float amsl_hgt)
|
|||||||
float dt = 1e-6f * static_cast<float>(_gps_state[0].time_usec - _gps_alttitude_ellipsoid_previous_timestamp[0]);
|
float dt = 1e-6f * static_cast<float>(_gps_state[0].time_usec - _gps_alttitude_ellipsoid_previous_timestamp[0]);
|
||||||
_gps_alttitude_ellipsoid_previous_timestamp[0] = _gps_state[0].time_usec;
|
_gps_alttitude_ellipsoid_previous_timestamp[0] = _gps_state[0].time_usec;
|
||||||
float offset_rate_correction = 0.1f * (height_diff - _wgs84_hgt_offset);
|
float offset_rate_correction = 0.1f * (height_diff - _wgs84_hgt_offset);
|
||||||
_wgs84_hgt_offset += dt * math::constrain(offset_rate_correction, -0.1f, 0.1f);
|
_wgs84_hgt_offset += dt * constrain(offset_rate_correction, -0.1f, 0.1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return amsl_hgt + _wgs84_hgt_offset;
|
return amsl_hgt + _wgs84_hgt_offset;
|
||||||
|
|||||||
@@ -94,9 +94,6 @@
|
|||||||
#define GPS_MAX_RECEIVERS 2
|
#define GPS_MAX_RECEIVERS 2
|
||||||
#define GPS_BLENDED_INSTANCE 2
|
#define GPS_BLENDED_INSTANCE 2
|
||||||
|
|
||||||
using math::constrain;
|
|
||||||
using namespace time_literals;
|
|
||||||
|
|
||||||
class EKF2 final : public ModuleBase<EKF2>, public ModuleParams, public px4::ScheduledWorkItem
|
class EKF2 final : public ModuleBase<EKF2>, public ModuleParams, public px4::ScheduledWorkItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user