Skip to content

Commit

Permalink
Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
mahimayoga committed Jan 8, 2025
1 parent fcd3295 commit 5a5195d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
9 changes: 2 additions & 7 deletions src/modules/land_detector/FixedwingLandDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,14 @@ bool FixedwingLandDetector::_get_landed_state()

} else if (hrt_elapsed_time(&_vehicle_local_position.timestamp) < 1_s) {

float val;
float val = 0.0f;

if (!_vehicle_local_position.v_xy_valid) {
// set _velocity_xy_filtered to 0 if data is invalid
val = 0.0f;

} else {
if (_vehicle_local_position.v_xy_valid) {
// Horizontal velocity complimentary filter.
val = 0.97f * _velocity_xy_filtered + 0.03f * sqrtf(_vehicle_local_position.vx * _vehicle_local_position.vx +
_vehicle_local_position.vy * _vehicle_local_position.vy);
}


if (PX4_ISFINITE(val)) {
_velocity_xy_filtered = val;
}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/land_detector/land_detector_params_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ PARAM_DEFINE_FLOAT(LNDFW_AIRSPD_MAX, 6.00f);
PARAM_DEFINE_FLOAT(LNDFW_TRIG_TIME, 2.f);

/**
* Fixed-wing land detector: max rotation
* Fixed-wing land detector: max rotational speed
*
* Maximum allowed angular velocity around each axis allowed in the landed state.
* Maximum allowed norm of the angular velocity in the landed state.
*
* @unit deg/s
* @decimal 1
Expand Down
4 changes: 2 additions & 2 deletions src/modules/land_detector/land_detector_params_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ PARAM_DEFINE_FLOAT(LNDMC_Z_VEL_MAX, 0.25f);
PARAM_DEFINE_FLOAT(LNDMC_XY_VEL_MAX, 1.5f);

/**
* Multicopter max rotation
* Multicopter max rotational speed
*
* Maximum allowed angular velocity around each axis allowed in the landed state.
* Maximum allowed norm of the angular velocity (roll, pitch) in the landed state.
*
* @unit deg/s
* @decimal 1
Expand Down

0 comments on commit 5a5195d

Please sign in to comment.