mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 16:23:46 +08:00
add space after function name and if statement (#21225)
old-commit-hash: e4e669bb0fc1a919dfb38800099f8e3ad52346f1
This commit is contained in:
@@ -190,7 +190,7 @@ void Localizer::handle_sensors(double current_time, const capnp::List<cereal::Se
|
||||
const cereal::SensorEventData::Reader& sensor_reading = log[i];
|
||||
|
||||
// Ignore empty readings (e.g. in case the magnetometer had no data ready)
|
||||
if (sensor_reading.getTimestamp() == 0){
|
||||
if (sensor_reading.getTimestamp() == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ void Localizer::handle_gps(double current_time, const cereal::GpsLocationData::R
|
||||
return;
|
||||
}
|
||||
|
||||
if (floatlist2vector(log.getVNED()).norm() > TRANS_SANITY_CHECK){
|
||||
if (floatlist2vector(log.getVNED()).norm() > TRANS_SANITY_CHECK) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ void Localizer::handle_cam_odo(double current_time, const cereal::CameraOdometry
|
||||
VectorXd rot_calib_std = floatlist2vector(log.getRotStd());
|
||||
VectorXd trans_calib_std = floatlist2vector(log.getTransStd());
|
||||
|
||||
if ((rot_calib_std.minCoeff() <= MIN_STD_SANITY_CHECK) || (trans_calib_std.minCoeff() <= MIN_STD_SANITY_CHECK)){
|
||||
if ((rot_calib_std.minCoeff() <= MIN_STD_SANITY_CHECK) || (trans_calib_std.minCoeff() <= MIN_STD_SANITY_CHECK)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ void Localizer::handle_cam_odo(double current_time, const cereal::CameraOdometry
|
||||
void Localizer::handle_live_calib(double current_time, const cereal::LiveCalibrationData::Reader& log) {
|
||||
if (log.getRpyCalib().size() > 0) {
|
||||
auto calib = floatlist2vector(log.getRpyCalib());
|
||||
if ((calib.minCoeff() < -CALIB_RPY_SANITY_CHECK) || (calib.maxCoeff() > CALIB_RPY_SANITY_CHECK)){
|
||||
if ((calib.minCoeff() < -CALIB_RPY_SANITY_CHECK) || (calib.maxCoeff() > CALIB_RPY_SANITY_CHECK)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ void Localizer::reset_kalman(double current_time) {
|
||||
|
||||
void Localizer::finite_check(double current_time) {
|
||||
bool all_finite = this->kf->get_x().array().isFinite().all() or this->kf->get_P().array().isFinite().all();
|
||||
if (!all_finite){
|
||||
if (!all_finite) {
|
||||
LOGE("Non-finite values detected, kalman reset");
|
||||
this->reset_kalman(current_time);
|
||||
}
|
||||
@@ -364,7 +364,7 @@ void Localizer::time_check(double current_time) {
|
||||
}
|
||||
double filter_time = this->kf->get_filter_time();
|
||||
bool big_time_gap = !std::isnan(filter_time) && (current_time - filter_time > 10);
|
||||
if (big_time_gap){
|
||||
if (big_time_gap) {
|
||||
LOGE("Time gap of over 10s detected, kalman reset");
|
||||
this->reset_kalman(current_time);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user