mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 20:23:34 +08:00
enable Wshadow
This commit is contained in:
+3
-3
@@ -37,7 +37,7 @@ project (ECL CXX)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
set(CMAKE_CURRENT_SOURCE_DIR ./)
|
||||
set(CMAKE_CXX_FLAGS "-DPOSIX_SHARED")
|
||||
set (EIGEN3_INCLUDE_DIR "/usr/local/include/eigen3/")
|
||||
set(EIGEN3_INCLUDE_DIR "/usr/local/include/eigen3/")
|
||||
|
||||
IF( NOT EIGEN3_INCLUDE_DIR )
|
||||
MESSAGE( FATAL_ERROR "Please point the environment variable EIGEN3_INCLUDE_DIR to the include directory of your Eigen3 installation.")
|
||||
@@ -69,5 +69,5 @@ set(SRCS
|
||||
geo.cpp
|
||||
mathlib.cpp
|
||||
)
|
||||
add_definitions(-std=c++11)
|
||||
add_library(ecl SHARED ${SRCS})
|
||||
add_definitions(-std=c++11 -Wall -Werror)
|
||||
add_library(ecl SHARED ${SRCS})
|
||||
|
||||
@@ -196,9 +196,6 @@ void Ekf::fuseAirspeed()
|
||||
_state.quat_nominal.normalize();
|
||||
|
||||
// update covariance matrix via Pnew = (I - KH)P = P - KHP
|
||||
float KH[_k_num_states][_k_num_states] = {};
|
||||
float KHP[_k_num_states][_k_num_states] = {};
|
||||
|
||||
for (unsigned row = 0; row < _k_num_states; row++) {
|
||||
for (unsigned column = 0; column < _k_num_states; column++) { // Here it will be a lot of zeros, should optimize that...
|
||||
KH[row][column] = Kfusion[row] * H_TAS[column];
|
||||
@@ -222,4 +219,4 @@ void Ekf::fuseAirspeed()
|
||||
makeSymmetrical();
|
||||
limitCov();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -197,10 +197,10 @@ bool Ekf::gps_is_good(struct gps_message *gps)
|
||||
// This check can only be used if the vehicle is stationary during alignment
|
||||
if (!_control_status.flags.armed) {
|
||||
vel_limit = 10.0f * _params.req_hdrift;
|
||||
float velN = fminf(fmaxf(gps->vel_ned[0], -vel_limit), vel_limit);
|
||||
float velE = fminf(fmaxf(gps->vel_ned[1], -vel_limit), vel_limit);
|
||||
_gps_velN_filt = velN * filter_coef + _gps_velN_filt * (1.0f - filter_coef);
|
||||
_gps_velE_filt = velE * filter_coef + _gps_velE_filt * (1.0f - filter_coef);
|
||||
float gps_velN = fminf(fmaxf(gps->vel_ned[0], -vel_limit), vel_limit);
|
||||
float gps_velE = fminf(fmaxf(gps->vel_ned[1], -vel_limit), vel_limit);
|
||||
_gps_velN_filt = gps_velN * filter_coef + _gps_velN_filt * (1.0f - filter_coef);
|
||||
_gps_velE_filt = gps_velE * filter_coef + _gps_velE_filt * (1.0f - filter_coef);
|
||||
float horiz_speed = sqrtf(_gps_velN_filt * _gps_velN_filt + _gps_velE_filt * _gps_velE_filt);
|
||||
_gps_check_fail_status.flags.hspeed = (horiz_speed > _params.req_hdrift);
|
||||
|
||||
|
||||
@@ -246,8 +246,6 @@ void Ekf::fuseVelPosHeight()
|
||||
_state.quat_nominal.normalize();
|
||||
|
||||
// update covarinace matrix via Pnew = (I - KH)P
|
||||
float KHP[_k_num_states][_k_num_states] = {};
|
||||
|
||||
for (unsigned row = 0; row < _k_num_states; row++) {
|
||||
for (unsigned column = 0; column < _k_num_states; column++) {
|
||||
KHP[row][column] = Kfusion[row] * P[state_index][column];
|
||||
|
||||
Reference in New Issue
Block a user