mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
allow testing ekf2 in simulation with jmavsim
This commit is contained in:
@@ -37,7 +37,10 @@ set(config_module_list
|
|||||||
#modules/attitude_estimator_q
|
#modules/attitude_estimator_q
|
||||||
modules/ekf_att_pos_estimator
|
modules/ekf_att_pos_estimator
|
||||||
modules/position_estimator_inav
|
modules/position_estimator_inav
|
||||||
|
modules/mc_pos_control
|
||||||
|
modules/mc_att_control
|
||||||
modules/navigator
|
modules/navigator
|
||||||
|
modules/commander
|
||||||
modules/vtol_att_control
|
modules/vtol_att_control
|
||||||
modules/controllib
|
modules/controllib
|
||||||
modules/ekf2
|
modules/ekf2
|
||||||
@@ -51,7 +54,6 @@ set(config_module_list
|
|||||||
lib/launchdetection
|
lib/launchdetection
|
||||||
lib/terrain_estimation
|
lib/terrain_estimation
|
||||||
lib/runway_takeoff
|
lib/runway_takeoff
|
||||||
lib/ecl/EKF/tests/base
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set(config_extra_builtin_cmds
|
set(config_extra_builtin_cmds
|
||||||
|
|||||||
@@ -45,8 +45,7 @@ sensors start
|
|||||||
commander start
|
commander start
|
||||||
land_detector start multicopter
|
land_detector start multicopter
|
||||||
navigator start
|
navigator start
|
||||||
attitude_estimator_q start
|
ekf_att_pos_estimator start
|
||||||
position_estimator_inav start
|
|
||||||
mc_pos_control start
|
mc_pos_control start
|
||||||
mc_att_control start
|
mc_att_control start
|
||||||
mixer load /dev/pwm_output0 ../../../../ROMFS/px4fmu_common/mixers/quad_x.main.mix
|
mixer load /dev/pwm_output0 ../../../../ROMFS/px4fmu_common/mixers/quad_x.main.mix
|
||||||
|
|||||||
@@ -32,13 +32,13 @@
|
|||||||
#############################################################################
|
#############################################################################
|
||||||
set(MODULE_CFLAGS)
|
set(MODULE_CFLAGS)
|
||||||
if (${OS} STREQUAL "nuttx")
|
if (${OS} STREQUAL "nuttx")
|
||||||
list(APPEND MODULE_CFLAGS -Wframe-larger-than=30000)
|
list(APPEND MODULE_CFLAGS -Wframe-larger-than=60000)
|
||||||
endif()
|
endif()
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE modules__ekf2
|
MODULE modules__ekf2
|
||||||
MAIN ekf2
|
MAIN ekf2
|
||||||
COMPILE_FLAGS ${MODULE_CFLAGS}
|
COMPILE_FLAGS ${MODULE_CFLAGS}
|
||||||
STACK 30000
|
STACK 60000
|
||||||
SRCS
|
SRCS
|
||||||
ekf2_main.cpp
|
ekf2_main.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
#include <uORB/topics/vehicle_gps_position.h>
|
#include <uORB/topics/vehicle_gps_position.h>
|
||||||
#include <uORB/topics/airspeed.h>
|
#include <uORB/topics/airspeed.h>
|
||||||
|
|
||||||
#include <ecl/EKF/estimator_base.h>
|
#include <ecl/EKF/ekf.h>
|
||||||
|
|
||||||
|
|
||||||
extern "C" __EXPORT int ekf2_main(int argc, char *argv[]);
|
extern "C" __EXPORT int ekf2_main(int argc, char *argv[]);
|
||||||
@@ -128,7 +128,7 @@ private:
|
|||||||
|
|
||||||
Ekf2::Ekf2()
|
Ekf2::Ekf2()
|
||||||
{
|
{
|
||||||
_ekf = new EstimatorBase();
|
_ekf = new Ekf();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ekf2::~Ekf2()
|
Ekf2::~Ekf2()
|
||||||
@@ -225,6 +225,8 @@ void Ekf2::task_main()
|
|||||||
if (airspeed_updated) {
|
if (airspeed_updated) {
|
||||||
_ekf->setAirspeedData(airspeed.timestamp, &airspeed.indicated_airspeed_m_s);
|
_ekf->setAirspeedData(airspeed.timestamp, &airspeed.indicated_airspeed_m_s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_ekf->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user