mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Create EKF object in right context
This commit is contained in:
parent
2b6a9c5122
commit
1e25ceb085
@ -106,7 +106,16 @@ void swap_var(float &d1, float &d2)
|
||||
d2 = tmp;
|
||||
}
|
||||
|
||||
void AttPosEKF::UpdateStrapdownEquationsNED()
|
||||
AttPosEKF::AttPosEKF()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
AttPosEKF::~AttPosEKF()
|
||||
{
|
||||
}
|
||||
|
||||
void AttPosEKF::UpdateStrapdownEquationsNED()
|
||||
{
|
||||
Vector3f delVelNav;
|
||||
float q00;
|
||||
|
||||
@ -78,6 +78,10 @@ struct ekf_status_report {
|
||||
class AttPosEKF {
|
||||
|
||||
public:
|
||||
|
||||
AttPosEKF();
|
||||
~AttPosEKF();
|
||||
|
||||
// Global variables
|
||||
float KH[n_states][n_states]; // intermediate result used for covariance updates
|
||||
float KHP[n_states][n_states]; // intermediate result used for covariance updates
|
||||
|
||||
@ -292,7 +292,7 @@ FixedwingEstimator::FixedwingEstimator() :
|
||||
_initialized(false),
|
||||
_gps_initialized(false),
|
||||
_mavlink_fd(-1),
|
||||
_ekf(new AttPosEKF())
|
||||
_ekf(nullptr)
|
||||
{
|
||||
|
||||
_mavlink_fd = open(MAVLINK_LOG_DEVICE, 0);
|
||||
@ -396,6 +396,8 @@ void
|
||||
FixedwingEstimator::task_main()
|
||||
{
|
||||
|
||||
_ekf = new AttPosEKF();
|
||||
|
||||
if (!_ekf) {
|
||||
errx(1, "failed allocating EKF filter - out of RAM!");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user