43 #include <px4_platform_common/px4_config.h> 44 #include <px4_platform_common/defines.h> 45 #include <px4_platform_common/tasks.h> 46 #include <px4_platform_common/posix.h> 90 if (argc >= 2 && !strcmp(argv[1],
"start")) {
92 PX4_INFO(
"already running");
97 thread_should_exit =
false;
98 daemon_task = px4_task_spawn_cmd(
"landing_target_estimator",
100 SCHED_PRIORITY_DEFAULT,
103 (argv) ? (
char *
const *)&argv[2] :
nullptr);
107 if (!strcmp(argv[1],
"stop")) {
108 thread_should_exit =
true;
110 if (!thread_running) {
111 PX4_WARN(
"landing_target_estimator not running");
117 if (!strcmp(argv[1],
"status")) {
118 if (thread_running) {
122 PX4_INFO(
"not started");
129 PX4_WARN(
"usage: landing_target_estimator {start|stop|status}");
135 PX4_DEBUG(
"starting");
137 thread_running =
true;
141 while (!thread_should_exit) {
143 px4_usleep(1000000 / landing_target_estimator_UPDATE_RATE_HZ);
146 PX4_DEBUG(
"exiting");
148 thread_running =
false;
static constexpr uint32_t landing_target_estimator_UPDATE_RATE_HZ
int landing_target_estimator_thread_main(int argc, char *argv[])
Mainloop of daemon.
__EXPORT int landing_target_estimator_main(int argc, char *argv[])
Landing target position estimator app start / stop handling function This makes the module accessible...
static bool thread_running
daemon status flag
High-resolution timer with callouts and timekeeping.
Simple error/warning functions, heavily inspired by the BSD functions of the same names...
static int daemon_task
Handle of daemon task / thread.
static bool thread_should_exit
daemon exit flag