mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 11:06:04 +08:00
replace camel case by snake case.
Co-Authored-By: EliaTarasov <elias.tarasov@gmail.com>
This commit is contained in:
committed by
Roman Bapst
parent
84d9820baa
commit
aa36fa2dfd
@@ -252,17 +252,17 @@ private:
|
|||||||
uint64_t _gps_alttitude_ellipsoid_previous_timestamp[GPS_MAX_RECEIVERS] {}; ///< storage for previous timestamp to compute dt
|
uint64_t _gps_alttitude_ellipsoid_previous_timestamp[GPS_MAX_RECEIVERS] {}; ///< storage for previous timestamp to compute dt
|
||||||
float _wgs84_hgt_offset = 0; ///< height offset between AMSL and WGS84
|
float _wgs84_hgt_offset = 0; ///< height offset between AMSL and WGS84
|
||||||
|
|
||||||
int _airdata_sub{-1};
|
int _airdata_sub{ -1};
|
||||||
int _airspeed_sub{-1};
|
int _airspeed_sub{ -1};
|
||||||
int _ev_odom_sub{-1};
|
int _ev_odom_sub{ -1};
|
||||||
int _landing_target_pose_sub{-1};
|
int _landing_target_pose_sub{ -1};
|
||||||
int _magnetometer_sub{-1};
|
int _magnetometer_sub{ -1};
|
||||||
int _optical_flow_sub{-1};
|
int _optical_flow_sub{ -1};
|
||||||
int _params_sub{-1};
|
int _params_sub{ -1};
|
||||||
int _sensor_selection_sub{-1};
|
int _sensor_selection_sub{ -1};
|
||||||
int _sensors_sub{-1};
|
int _sensors_sub{ -1};
|
||||||
int _status_sub{-1};
|
int _status_sub{ -1};
|
||||||
int _vehicle_land_detected_sub{-1};
|
int _vehicle_land_detected_sub{ -1};
|
||||||
|
|
||||||
// because we can have several distance sensor instances with different orientations
|
// because we can have several distance sensor instances with different orientations
|
||||||
int _range_finder_subs[ORB_MULTI_MAX_INSTANCES] {};
|
int _range_finder_subs[ORB_MULTI_MAX_INSTANCES] {};
|
||||||
@@ -270,7 +270,7 @@ private:
|
|||||||
|
|
||||||
// because we can have multiple GPS instances
|
// because we can have multiple GPS instances
|
||||||
int _gps_subs[GPS_MAX_RECEIVERS] {};
|
int _gps_subs[GPS_MAX_RECEIVERS] {};
|
||||||
int _gps_orb_instance{-1};
|
int _gps_orb_instance{ -1};
|
||||||
|
|
||||||
orb_advert_t _att_pub{nullptr};
|
orb_advert_t _att_pub{nullptr};
|
||||||
orb_advert_t _wind_pub{nullptr};
|
orb_advert_t _wind_pub{nullptr};
|
||||||
@@ -1253,10 +1253,12 @@ void Ekf2::run()
|
|||||||
if (vehicle_land_detected_updated) {
|
if (vehicle_land_detected_updated) {
|
||||||
if (orb_copy(ORB_ID(vehicle_land_detected), _vehicle_land_detected_sub, &vehicle_land_detected) == PX4_OK) {
|
if (orb_copy(ORB_ID(vehicle_land_detected), _vehicle_land_detected_sub, &vehicle_land_detected) == PX4_OK) {
|
||||||
_ekf.set_in_air_status(!vehicle_land_detected.landed);
|
_ekf.set_in_air_status(!vehicle_land_detected.landed);
|
||||||
if(_gnd_effect_deadzone.get() > 0.0f)
|
|
||||||
|
if (_gnd_effect_deadzone.get() > 0.0f) {
|
||||||
_ekf.set_gnd_effect_flag(vehicle_land_detected.in_ground_effect);
|
_ekf.set_gnd_effect_flag(vehicle_land_detected.in_ground_effect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// use the landing target pose estimate as another source of velocity data
|
// use the landing target pose estimate as another source of velocity data
|
||||||
bool landing_target_pose_updated = false;
|
bool landing_target_pose_updated = false;
|
||||||
@@ -1269,7 +1271,7 @@ void Ekf2::run()
|
|||||||
// we can only use the landing target if it has a fixed position and a valid velocity estimate
|
// we can only use the landing target if it has a fixed position and a valid velocity estimate
|
||||||
if (landing_target_pose.is_static && landing_target_pose.rel_vel_valid) {
|
if (landing_target_pose.is_static && landing_target_pose.rel_vel_valid) {
|
||||||
// velocity of vehicle relative to target has opposite sign to target relative to vehicle
|
// velocity of vehicle relative to target has opposite sign to target relative to vehicle
|
||||||
float velocity[2] = {-landing_target_pose.vx_rel, -landing_target_pose.vy_rel};
|
float velocity[2] = { -landing_target_pose.vx_rel, -landing_target_pose.vy_rel};
|
||||||
float variance[2] = {landing_target_pose.cov_vx_rel, landing_target_pose.cov_vy_rel};
|
float variance[2] = {landing_target_pose.cov_vx_rel, landing_target_pose.cov_vy_rel};
|
||||||
_ekf.setAuxVelData(landing_target_pose.timestamp, velocity, variance);
|
_ekf.setAuxVelData(landing_target_pose.timestamp, velocity, variance);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ bool MulticopterLandDetector::_get_ground_contact_state()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if we are moving horizontally.
|
// Check if we are moving horizontally.
|
||||||
_horizontalMovement = sqrtf(_vehicleLocalPosition.vx * _vehicleLocalPosition.vx
|
_horizontal_movement = sqrtf(_vehicleLocalPosition.vx * _vehicleLocalPosition.vx
|
||||||
+ _vehicleLocalPosition.vy * _vehicleLocalPosition.vy) > _params.maxVelocity;
|
+ _vehicleLocalPosition.vy * _vehicleLocalPosition.vy) > _params.maxVelocity;
|
||||||
|
|
||||||
// if we have a valid velocity setpoint and the vehicle is demanded to go down but no vertical movement present,
|
// if we have a valid velocity setpoint and the vehicle is demanded to go down but no vertical movement present,
|
||||||
@@ -189,7 +189,7 @@ bool MulticopterLandDetector::_get_ground_contact_state()
|
|||||||
bool hit_ground = _in_descend && !verticalMovement;
|
bool hit_ground = _in_descend && !verticalMovement;
|
||||||
|
|
||||||
// TODO: we need an accelerometer based check for vertical movement for flying without GPS
|
// TODO: we need an accelerometer based check for vertical movement for flying without GPS
|
||||||
if ((_has_low_thrust() || hit_ground) && (!_horizontalMovement || !_has_position_lock())
|
if ((_has_low_thrust() || hit_ground) && (!_horizontal_movement || !_has_position_lock())
|
||||||
&& (!verticalMovement || !_has_altitude_lock())) {
|
&& (!verticalMovement || !_has_altitude_lock())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -336,7 +336,7 @@ bool MulticopterLandDetector::_has_minimal_thrust()
|
|||||||
|
|
||||||
bool MulticopterLandDetector::_get_ground_effect_state()
|
bool MulticopterLandDetector::_get_ground_effect_state()
|
||||||
{
|
{
|
||||||
if (_in_descend && !_horizontalMovement) {
|
if (_in_descend && !_horizontal_movement) {
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ private:
|
|||||||
hrt_abstime _landed_time{0};
|
hrt_abstime _landed_time{0};
|
||||||
|
|
||||||
bool _in_descend{false}; ///< vehicle is desending
|
bool _in_descend{false}; ///< vehicle is desending
|
||||||
bool _horizontalMovement{false}; ///< vehicle is moving horizontally
|
bool _horizontal_movement{false}; ///< vehicle is moving horizontally
|
||||||
|
|
||||||
/* get control mode dependent pilot throttle threshold with which we should quit landed state and take off */
|
/* get control mode dependent pilot throttle threshold with which we should quit landed state and take off */
|
||||||
float _get_takeoff_throttle();
|
float _get_takeoff_throttle();
|
||||||
|
|||||||
Reference in New Issue
Block a user