From 53674a75d6c6f6302955e3e993d15d604e0a7a42 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Wed, 15 Nov 2023 09:49:31 +0100 Subject: [PATCH] Velocity limit: remove duplicate message and if(true) --- msg/velocity_limits.msg | 8 -------- src/modules/mavlink/mavlink_receiver.cpp | 14 ++++++-------- 2 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 msg/velocity_limits.msg diff --git a/msg/velocity_limits.msg b/msg/velocity_limits.msg deleted file mode 100644 index 9ab5115abc69..000000000000 --- a/msg/velocity_limits.msg +++ /dev/null @@ -1,8 +0,0 @@ -# Velocity and yaw rate limits for a multicopter position slow mode only - -uint64 timestamp # time since system start (microseconds) - -# absolute speeds, NAN means use default limit -float32 horizontal_velocity # [m/s] -float32 vertical_velocity # [m/s] -float32 yaw_rate # [rad/s] diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 1079eedc3bb3..c80c46a1cd58 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -1220,14 +1220,12 @@ void MavlinkReceiver::handle_message_set_velocity_limits(mavlink_message_t *msg) mavlink_set_velocity_limits_t mavlink_set_velocity_limits; mavlink_msg_set_velocity_limits_decode(msg, &mavlink_set_velocity_limits); - if (true) { - velocity_limits_s velocity_limits{}; - velocity_limits.horizontal_velocity = mavlink_set_velocity_limits.horizontal_speed_limit; - velocity_limits.vertical_velocity = mavlink_set_velocity_limits.vertical_speed_limit; - velocity_limits.yaw_rate = mavlink_set_velocity_limits.yaw_rate_limit; - velocity_limits.timestamp = hrt_absolute_time(); - _velocity_limits_pub.publish(velocity_limits); - } + velocity_limits_s velocity_limits{}; + velocity_limits.horizontal_velocity = mavlink_set_velocity_limits.horizontal_speed_limit; + velocity_limits.vertical_velocity = mavlink_set_velocity_limits.vertical_speed_limit; + velocity_limits.yaw_rate = mavlink_set_velocity_limits.yaw_rate_limit; + velocity_limits.timestamp = hrt_absolute_time(); + _velocity_limits_pub.publish(velocity_limits); } void