mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 14:23:34 +08:00
Finished conversion to C++
This commit is contained in:
@@ -35,8 +35,9 @@ APPNAME = attitude_estimator_ekf
|
|||||||
PRIORITY = SCHED_PRIORITY_DEFAULT
|
PRIORITY = SCHED_PRIORITY_DEFAULT
|
||||||
STACKSIZE = 2048
|
STACKSIZE = 2048
|
||||||
|
|
||||||
CSRCS = attitude_estimator_ekf_main.c \
|
CXXSRCS = attitude_estimator_ekf_main.cpp
|
||||||
attitude_estimator_ekf_params.c \
|
|
||||||
|
CSRCS = attitude_estimator_ekf_params.c \
|
||||||
codegen/eye.c \
|
codegen/eye.c \
|
||||||
codegen/attitudeKalmanfilter.c \
|
codegen/attitudeKalmanfilter.c \
|
||||||
codegen/mrdivide.c \
|
codegen/mrdivide.c \
|
||||||
|
|||||||
+12
-5
@@ -66,11 +66,17 @@
|
|||||||
#include <systemlib/perf_counter.h>
|
#include <systemlib/perf_counter.h>
|
||||||
#include <systemlib/err.h>
|
#include <systemlib/err.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
#include "codegen/attitudeKalmanfilter_initialize.h"
|
#include "codegen/attitudeKalmanfilter_initialize.h"
|
||||||
#include "codegen/attitudeKalmanfilter.h"
|
#include "codegen/attitudeKalmanfilter.h"
|
||||||
#include "attitude_estimator_ekf_params.h"
|
#include "attitude_estimator_ekf_params.h"
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
__EXPORT int attitude_estimator_ekf_main(int argc, char *argv[]);
|
extern "C" __EXPORT int attitude_estimator_ekf_main(int argc, char *argv[]);
|
||||||
|
|
||||||
static bool thread_should_exit = false; /**< Deamon exit flag */
|
static bool thread_should_exit = false; /**< Deamon exit flag */
|
||||||
static bool thread_running = false; /**< Deamon status flag */
|
static bool thread_running = false; /**< Deamon status flag */
|
||||||
@@ -265,10 +271,11 @@ const unsigned int loop_interval_alarm = 6500; // loop interval in microseconds
|
|||||||
/* Main loop*/
|
/* Main loop*/
|
||||||
while (!thread_should_exit) {
|
while (!thread_should_exit) {
|
||||||
|
|
||||||
struct pollfd fds[2] = {
|
struct pollfd fds[2];
|
||||||
{ .fd = sub_raw, .events = POLLIN },
|
fds[0].fd = sub_raw;
|
||||||
{ .fd = sub_params, .events = POLLIN }
|
fds[0].events = POLLIN;
|
||||||
};
|
fds[1].fd = sub_params;
|
||||||
|
fds[1].events = POLLIN;
|
||||||
int ret = poll(fds, 2, 1000);
|
int ret = poll(fds, 2, 1000);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
Reference in New Issue
Block a user