From a38ca838fd67a6db6dd4dcf234587958924ad9e3 Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Mon, 15 May 2023 17:19:37 +0200 Subject: [PATCH] negative height --- src/px4_connection/src/px4_controller.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/px4_connection/src/px4_controller.cpp b/src/px4_connection/src/px4_controller.cpp index f2aa3aaa..88798dcf 100644 --- a/src/px4_connection/src/px4_controller.cpp +++ b/src/px4_connection/src/px4_controller.cpp @@ -187,10 +187,10 @@ private: } else if (request->control_mode == CONTROL_MODE_POSITION) { - for (int i = 0; i < 3; i++) - { - position[i] += request->values[i]; - } + position[0] += position[0]; + position[1] += position[1]; + position[2] -= position[2]; // height is negative + RCLCPP_INFO(this->get_logger(), "Got new position setpoint: %f %f %f", position[0], position[1], position[2]); }