Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename _arming -> _actuator_armed , _battery -> _battery_status in the land_detector module. #12342

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/modules/land_detector/FixedwingLandDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ float FixedwingLandDetector::_get_max_altitude()
bool FixedwingLandDetector::_get_landed_state()
{
// only trigger flight conditions if we are armed
if (!_arming.armed) {
if (!_actuator_armed.armed) {
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions src/modules/land_detector/LandDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void LandDetector::Run()
perf_begin(_cycle_perf);

_check_params(false);
_actuator_armed_sub.update(&_arming);
_actuator_armed_sub.update(&_actuator_armed);
_update_topics();
_update_state();

Expand Down Expand Up @@ -124,7 +124,7 @@ void LandDetector::Run()

// set the flight time when disarming (not necessarily when landed, because all param changes should
// happen on the same event and it's better to set/save params while not in armed state)
if (_takeoff_time != 0 && !_arming.armed && _previous_armed_state) {
if (_takeoff_time != 0 && !_actuator_armed.armed && _previous_armed_state) {
_total_flight_time += now - _takeoff_time;
_takeoff_time = 0;

Expand All @@ -139,7 +139,7 @@ void LandDetector::Run()
_param_total_flight_time_low.commit_no_notification();
}

_previous_armed_state = _arming.armed;
_previous_armed_state = _actuator_armed.armed;

perf_end(_cycle_perf);

Expand Down
2 changes: 1 addition & 1 deletion src/modules/land_detector/LandDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class LandDetector : public ModuleBase<LandDetector>, ModuleParams, px4::Schedul
systemlib::Hysteresis _ground_contact_hysteresis{true};
systemlib::Hysteresis _ground_effect_hysteresis{false};

actuator_armed_s _arming {};
actuator_armed_s _actuator_armed {};

private:

Expand Down
14 changes: 7 additions & 7 deletions src/modules/land_detector/MulticopterLandDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ MulticopterLandDetector::MulticopterLandDetector()
void MulticopterLandDetector::_update_topics()
{
_actuator_controls_sub.update(&_actuator_controls);
_battery_sub.update(&_battery);
_battery_sub.update(&_battery_status);
_sensor_bias_sub.update(&_sensor_bias);
_vehicle_attitude_sub.update(&_vehicle_attitude);
_vehicle_control_mode_sub.update(&_control_mode);
Expand Down Expand Up @@ -141,7 +141,7 @@ bool MulticopterLandDetector::_get_freefall_state()
bool MulticopterLandDetector::_get_ground_contact_state()
{
// When not armed, consider to have ground-contact
if (!_arming.armed) {
if (!_actuator_armed.armed) {
return true;
}

Expand Down Expand Up @@ -192,7 +192,7 @@ bool MulticopterLandDetector::_get_maybe_landed_state()
const hrt_abstime now = hrt_absolute_time();

// When not armed, consider to be maybe-landed
if (!_arming.armed) {
if (!_actuator_armed.armed) {
return true;
}

Expand Down Expand Up @@ -239,7 +239,7 @@ bool MulticopterLandDetector::_get_maybe_landed_state()
bool MulticopterLandDetector::_get_landed_state()
{
// When not armed, consider to be landed
if (!_arming.armed) {
if (!_actuator_armed.armed) {
return true;
}

Expand All @@ -265,15 +265,15 @@ float MulticopterLandDetector::_get_max_altitude()
/* ToDo: add a meaningful altitude */
float valid_altitude_max = _params.altitude_max;

if (_battery.warning == battery_status_s::BATTERY_WARNING_LOW) {
if (_battery_status.warning == battery_status_s::BATTERY_WARNING_LOW) {
valid_altitude_max = _params.altitude_max * 0.75f;
}

if (_battery.warning == battery_status_s::BATTERY_WARNING_CRITICAL) {
if (_battery_status.warning == battery_status_s::BATTERY_WARNING_CRITICAL) {
valid_altitude_max = _params.altitude_max * 0.5f;
}

if (_battery.warning == battery_status_s::BATTERY_WARNING_EMERGENCY) {
if (_battery_status.warning == battery_status_s::BATTERY_WARNING_EMERGENCY) {
valid_altitude_max = _params.altitude_max * 0.25f;
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/land_detector/MulticopterLandDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class MulticopterLandDetector : public LandDetector
uORB::Subscription _vehicle_local_position_setpoint_sub{ORB_ID(vehicle_local_position_setpoint)};

actuator_controls_s _actuator_controls {};
battery_status_s _battery {};
battery_status_s _battery_status {};
vehicle_control_mode_s _control_mode {};
sensor_bias_s _sensor_bias {};
vehicle_attitude_s _vehicle_attitude {};
Expand Down
2 changes: 1 addition & 1 deletion src/modules/land_detector/RoverLandDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bool RoverLandDetector::_get_maybe_landed_state()

bool RoverLandDetector::_get_landed_state()
{
if (!_arming.armed) {
if (!_actuator_armed.armed) {
return true;
}

Expand Down