mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 20:31:37 +08:00
changed isnan checks and cmake compiler condition for apple machines
This commit is contained in:
@@ -99,7 +99,7 @@ extern "C" {
|
|||||||
strncmp(path, "/dev/", 5) != 0) {
|
strncmp(path, "/dev/", 5) != 0) {
|
||||||
va_list p;
|
va_list p;
|
||||||
va_start(p, flags);
|
va_start(p, flags);
|
||||||
mode = va_arg(p, mode_t);
|
mode = va_arg(p, int);
|
||||||
va_end(p);
|
va_end(p);
|
||||||
|
|
||||||
// Create the file
|
// Create the file
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ add_executable(mainapp
|
|||||||
apps.h
|
apps.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang" OR NOT APPLE)
|
if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang" AND NOT APPLE)
|
||||||
target_link_libraries(mainapp
|
target_link_libraries(mainapp
|
||||||
-Wl,--start-group
|
-Wl,--start-group
|
||||||
${module_libraries}
|
${module_libraries}
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ float LowPassFilter2p::apply(float sample)
|
|||||||
|
|
||||||
// do the filtering
|
// do the filtering
|
||||||
float delay_element_0 = sample - _delay_element_1 * _a1 - _delay_element_2 * _a2;
|
float delay_element_0 = sample - _delay_element_1 * _a1 - _delay_element_2 * _a2;
|
||||||
if (isnan(delay_element_0) || isinf(delay_element_0)) {
|
if (!PX4_ISFINITE(delay_element_0)) {
|
||||||
// don't allow bad values to propagate via the filter
|
// don't allow bad values to propagate via the filter
|
||||||
delay_element_0 = sample;
|
delay_element_0 = sample;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -721,7 +721,7 @@ MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set the yaw sp value */
|
/* set the yaw sp value */
|
||||||
if (!offboard_control_mode.ignore_attitude && !isnan(set_position_target_local_ned.yaw)) {
|
if (!offboard_control_mode.ignore_attitude && PX4_ISFINITE(set_position_target_local_ned.yaw)) {
|
||||||
pos_sp_triplet.current.yaw_valid = true;
|
pos_sp_triplet.current.yaw_valid = true;
|
||||||
pos_sp_triplet.current.yaw = set_position_target_local_ned.yaw;
|
pos_sp_triplet.current.yaw = set_position_target_local_ned.yaw;
|
||||||
|
|
||||||
@@ -730,7 +730,7 @@ MavlinkReceiver::handle_message_set_position_target_local_ned(mavlink_message_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set the yawrate sp value */
|
/* set the yawrate sp value */
|
||||||
if (!offboard_control_mode.ignore_bodyrate && !isnan(set_position_target_local_ned.yaw)) {
|
if (!offboard_control_mode.ignore_bodyrate && PX4_ISFINITE(set_position_target_local_ned.yaw)) {
|
||||||
pos_sp_triplet.current.yawspeed_valid = true;
|
pos_sp_triplet.current.yawspeed_valid = true;
|
||||||
pos_sp_triplet.current.yawspeed = set_position_target_local_ned.yaw_rate;
|
pos_sp_triplet.current.yawspeed = set_position_target_local_ned.yaw_rate;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user