mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-15 03:10:34 +08:00
CI: enable clang-tidy bugprone-incorrect-roundings (#26574)
switched to lroundf and included cmath in all removed std namespace - quick tested Signed-off-by: kuralme <kuralme@protonmail.com>
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "FixedWingModeManager.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <px4_platform_common/events.h>
|
||||
#include <uORB/topics/longitudinal_control_configuration.h>
|
||||
|
||||
@@ -139,7 +140,7 @@ FixedWingModeManager::vehicle_command_poll()
|
||||
|
||||
} else if (vehicle_command.command == vehicle_command_s::VEHICLE_CMD_DO_CHANGE_SPEED) {
|
||||
|
||||
if ((static_cast<uint8_t>(vehicle_command.param1 + .5f) == vehicle_command_s::SPEED_TYPE_AIRSPEED)) {
|
||||
if ((static_cast<uint8_t>(lroundf(vehicle_command.param1)) == vehicle_command_s::SPEED_TYPE_AIRSPEED)) {
|
||||
if (vehicle_command.param2 > FLT_EPSILON) { // param2 is an equivalent airspeed setpoint
|
||||
if (_control_mode_current == FW_POSCTRL_MODE_AUTO) {
|
||||
_pos_sp_triplet.current.cruising_speed = vehicle_command.param2;
|
||||
|
||||
Reference in New Issue
Block a user