mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-03 09:30:34 +08:00
remove all <cmath> usage
* the NuttX c++ library is incomplete, let's avoid including it until we have a real standard library in place
This commit is contained in:
@@ -76,7 +76,7 @@
|
||||
#include <circuit_breaker/circuit_breaker.h>
|
||||
#include <systemlib/mavlink_log.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
#include <cstring>
|
||||
|
||||
@@ -768,7 +768,7 @@ Commander::handle_command(vehicle_status_s *status_local, const vehicle_command_
|
||||
bool cmd_arms = (static_cast<int>(cmd.param1 + 0.5f) == 1);
|
||||
|
||||
// Arm/disarm is enforced when param2 is set to a magic number.
|
||||
const bool enforce = (static_cast<int>(std::round(cmd.param2)) == 21196);
|
||||
const bool enforce = (static_cast<int>(roundf(cmd.param2)) == 21196);
|
||||
|
||||
if (!enforce) {
|
||||
if (!land_detector.landed && !is_ground_rover(&status)) {
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <drivers/drv_airspeed.h>
|
||||
#include <uORB/topics/differential_pressure.h>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <uORB/topics/sensor_combined.h>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <poll.h>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
#include <fcntl.h>
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <drivers/drv_accel.h>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
* @author Julian Oes <julian@oes.ch>
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
#include <mathlib/mathlib.h>
|
||||
#include <matrix/math.hpp>
|
||||
|
||||
|
||||
@@ -1546,8 +1546,8 @@ MavlinkMissionManager::format_mavlink_mission_item(const struct mission_item_s *
|
||||
mavlink_mission_item_int_t *item_int =
|
||||
reinterpret_cast<mavlink_mission_item_int_t *>(mavlink_mission_item);
|
||||
|
||||
item_int->x = std::round(mission_item->lat * 1e7);
|
||||
item_int->y = std::round(mission_item->lon * 1e7);
|
||||
item_int->x = round(mission_item->lat * 1e7);
|
||||
item_int->y = round(mission_item->lon * 1e7);
|
||||
|
||||
} else {
|
||||
mavlink_mission_item->x = (float)mission_item->lat;
|
||||
|
||||
Reference in New Issue
Block a user