Skip to content

Commit

Permalink
Merge branch 'main' into pr-fw_ctrl_api
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanBapst authored Jan 8, 2025
2 parents 8405fa3 + 585e5d1 commit 4544dec
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/modules/navigator/mission_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,8 @@ class MissionBase : public MissionBlock, public ModuleParams
mission_item_s _last_camera_trigger_item {};
mission_item_s _last_speed_change_item {};

DEFINE_PARAMETERS(
(ParamFloat<px4::params::MIS_DIST_1WP>) _param_mis_dist_1wp,
DEFINE_PARAMETERS_CUSTOM_PARENT(
ModuleParams,
(ParamInt<px4::params::MIS_MNT_YAW_CTL>) _param_mis_mnt_yaw_ctl
)

Expand Down
2 changes: 1 addition & 1 deletion src/modules/navigator/mission_block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ void MissionBlock::startPrecLand(uint16_t land_precision)
_navigator->get_precland()->set_mode(PrecLandMode::Opportunistic);
_navigator->get_precland()->on_activation();

} else { //_mission_item.land_precision == 2
} else if (_mission_item.land_precision == 2) {
_navigator->get_precland()->set_mode(PrecLandMode::Required);
_navigator->get_precland()->on_activation();
}
Expand Down
6 changes: 4 additions & 2 deletions src/modules/navigator/rtl_direct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void RtlDirect::on_active()
updateAltToAvoidTerrainCollisionAndRepublishTriplet(_mission_item);
}

if (_rtl_state == RTLState::LAND && _param_rtl_pld_md.get() > 0) {
if (_rtl_state == RTLState::LAND && _mission_item.land_precision > 0) {
// Need to update the position and type on the current setpoint triplet.
_navigator->get_precland()->on_active();

Expand Down Expand Up @@ -369,7 +369,9 @@ void RtlDirect::set_rtl_item()

_mission_item.land_precision = _param_rtl_pld_md.get();

startPrecLand(_mission_item.land_precision);
if (_mission_item.land_precision > 0) {
startPrecLand(_mission_item.land_precision);
}

mavlink_log_info(_navigator->get_mavlink_log_pub(), "RTL: land at destination\t");
events::send(events::ID("rtl_land_at_destination"), events::Log::Info, "RTL: land at destination");
Expand Down
7 changes: 7 additions & 0 deletions src/modules/navigator/rtl_mission_fast_reverse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ void RtlMissionFastReverse::handleLanding(WorkItemType &new_work_item_type)
_mission_item.altitude = _home_pos_sub.get().alt;
_mission_item.altitude_is_relative = false;
_navigator->reset_position_setpoint(pos_sp_triplet->previous);

_mission_item.land_precision = _param_rtl_pld_md.get();

if (_mission_item.land_precision > 0) {
startPrecLand(_mission_item.land_precision);
new_work_item_type = WorkItemType::WORK_ITEM_TYPE_PRECISION_LAND;
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/modules/navigator/rtl_mission_fast_reverse.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,8 @@ class RtlMissionFastReverse : public RtlBase
bool _in_landing_phase{false};

uORB::SubscriptionData<home_position_s> _home_pos_sub{ORB_ID(home_position)}; /**< home position subscription */
DEFINE_PARAMETERS_CUSTOM_PARENT(
RtlBase,
(ParamInt<px4::params::RTL_PLD_MD>) _param_rtl_pld_md
)
};
1 change: 1 addition & 0 deletions src/modules/navigator/rtl_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ PARAM_DEFINE_INT32(RTL_CONE_ANG, 45);
* RTL precision land mode
*
* Use precision landing when doing an RTL landing phase.
* This setting does not apply for RTL destinations planned as part of a mission.
*
* @value 0 No precision landing
* @value 1 Opportunistic precision landing
Expand Down

0 comments on commit 4544dec

Please sign in to comment.