mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
change abs to std::fabs
This commit is contained in:
parent
e7cdb19424
commit
c7ff253a6d
@ -654,7 +654,7 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
|
||||
|
||||
float rate_threshold = 0.15f;
|
||||
|
||||
if (abs(rates_setpoint.pitch) < rate_threshold) {
|
||||
if (std::fabs(rates_setpoint.pitch) < rate_threshold) {
|
||||
//warnx("[inav] test ohne comp");
|
||||
flow_ang[0] = (flow.pixel_flow_x_integral / (float)flow.integration_timespan * 1000000.0f) * params.flow_k;//for now the flow has to be scaled (to small)
|
||||
}
|
||||
@ -665,7 +665,7 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
|
||||
+ gyro_offset_filtered[0]) * params.flow_k;//for now the flow has to be scaled (to small)
|
||||
}
|
||||
|
||||
if (abs(rates_setpoint.roll) < rate_threshold) {
|
||||
if (std::fabs(rates_setpoint.roll) < rate_threshold) {
|
||||
flow_ang[1] = (flow.pixel_flow_y_integral / (float)flow.integration_timespan * 1000000.0f) * params.flow_k;//for now the flow has to be scaled (to small)
|
||||
}
|
||||
else {
|
||||
@ -676,7 +676,7 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
|
||||
|
||||
/* flow measurements vector */
|
||||
float flow_m[3];
|
||||
if (abs(rates_setpoint.yaw) < rate_threshold) {
|
||||
if (std::fabs(rates_setpoint.yaw) < rate_threshold) {
|
||||
flow_m[0] = -flow_ang[0] * flow_dist;
|
||||
flow_m[1] = -flow_ang[1] * flow_dist;
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user