mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 04:03:35 +08:00
NuttX carry minimal c++ cmath (replacing Matrix stdlib_imports.hpp)
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
#include <lib/mixer_module/mixer_module.hpp>
|
||||
|
||||
// UDRAL Specification Messages
|
||||
using std::isfinite;
|
||||
#include <reg/udral/service/actuator/common/sp/Vector31_0_1.h>
|
||||
#include <reg/udral/service/common/Readiness_0_1.h>
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
#include <lib/parameters/param.h>
|
||||
#include <containers/List.hpp>
|
||||
|
||||
#include <cmath>
|
||||
using std::isfinite;
|
||||
#include <uavcan/_register/Access_1_0.h>
|
||||
|
||||
#include "../CanardHandle.hpp"
|
||||
|
||||
@@ -282,11 +282,11 @@ UavcanGnssBridge::gnss_fix2_sub_cb(const uavcan::ReceivedDataStructure<uavcan::e
|
||||
if (!msg.ecef_position_velocity.empty()) {
|
||||
heading = msg.ecef_position_velocity[0].velocity_xyz[0];
|
||||
|
||||
if (!isnan(msg.ecef_position_velocity[0].velocity_xyz[1])) {
|
||||
if (!std::isnan(msg.ecef_position_velocity[0].velocity_xyz[1])) {
|
||||
heading_offset = msg.ecef_position_velocity[0].velocity_xyz[1];
|
||||
}
|
||||
|
||||
if (!isnan(msg.ecef_position_velocity[0].velocity_xyz[2])) {
|
||||
if (!std::isnan(msg.ecef_position_velocity[0].velocity_xyz[2])) {
|
||||
heading_accuracy = msg.ecef_position_velocity[0].velocity_xyz[2];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "UavcanPublisherBase.hpp"
|
||||
|
||||
#include <uavcan/equipment/gnss/Fix2.hpp>
|
||||
@@ -126,14 +128,14 @@ public:
|
||||
ecefpositionvelocity.velocity_xyz[2] = NAN;
|
||||
|
||||
// Use ecef_position_velocity for now... There is no heading field
|
||||
if (!isnan(gps.heading)) {
|
||||
if (!std::isnan(gps.heading)) {
|
||||
ecefpositionvelocity.velocity_xyz[0] = gps.heading;
|
||||
|
||||
if (!isnan(gps.heading_offset)) {
|
||||
if (!std::isnan(gps.heading_offset)) {
|
||||
ecefpositionvelocity.velocity_xyz[1] = gps.heading_offset;
|
||||
}
|
||||
|
||||
if (!isnan(gps.heading_accuracy)) {
|
||||
if (!std::isnan(gps.heading_accuracy)) {
|
||||
ecefpositionvelocity.velocity_xyz[2] = gps.heading_accuracy;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user