From 10ae3f3e3b4bb4778a5e4c4114f47b2322e31768 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Mon, 15 May 2023 15:59:16 +0200 Subject: [PATCH] set position values to nan when sending velocity setpoint --- src/px4_connection/src/px4_controller.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/px4_connection/src/px4_controller.cpp b/src/px4_connection/src/px4_controller.cpp index 6ba66214..9e471c5b 100644 --- a/src/px4_connection/src/px4_controller.cpp +++ b/src/px4_connection/src/px4_controller.cpp @@ -274,6 +274,10 @@ private: msg.velocity[0] = velocity[0]; msg.velocity[1] = velocity[1]; msg.velocity[2] = D_SPEED(velocity[2]); + for (int i = 0; i < 3; i++) + { + msg.position[i] = NAN; + } publish_trajectory_setpoint(msg); }