From 138d3a3444a9efe677e08f61861087c029d0199e Mon Sep 17 00:00:00 2001 From: GuillaumeLaine Date: Mon, 13 May 2024 09:09:55 +0200 Subject: [PATCH] review: apply suggestions --- .../px4_ros2/control/setpoint_types/direct_actuators.hpp | 2 +- .../px4_ros2/control/setpoint_types/experimental/rates.hpp | 2 +- px4_ros2_cpp/src/components/mode.cpp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/direct_actuators.hpp b/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/direct_actuators.hpp index 33ee345..8543c97 100644 --- a/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/direct_actuators.hpp +++ b/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/direct_actuators.hpp @@ -31,7 +31,7 @@ class DirectActuatorsSetpointType : public SetpointBase ~DirectActuatorsSetpointType() override = default; Configuration getConfiguration() override; - float desiredUpdateRateHz() override {return 100.f;} + float desiredUpdateRateHz() override {return 200.f;} /** * Send servos setpoint diff --git a/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/experimental/rates.hpp b/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/experimental/rates.hpp index d1924a6..e9094d5 100644 --- a/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/experimental/rates.hpp +++ b/px4_ros2_cpp/include/px4_ros2/control/setpoint_types/experimental/rates.hpp @@ -27,7 +27,7 @@ class RatesSetpointType : public SetpointBase ~RatesSetpointType() override = default; Configuration getConfiguration() override; - float desiredUpdateRateHz() override {return 100.f;} + float desiredUpdateRateHz() override {return 200.f;} void update( const Eigen::Vector3f & rate_setpoints_ned_rad, diff --git a/px4_ros2_cpp/src/components/mode.cpp b/px4_ros2_cpp/src/components/mode.cpp index 4840ace..6e2a258 100644 --- a/px4_ros2_cpp/src/components/mode.cpp +++ b/px4_ros2_cpp/src/components/mode.cpp @@ -229,6 +229,7 @@ bool ModeBase::onRegistered() activateSetpointType(*_setpoint_types[0]); if (_setpoint_update_rate_hz < FLT_EPSILON) { + // Do not use default setpoint rate if rate was already set by user setSetpointUpdateRateFromSetpointTypes(); }