ThrowLaunch: check ThrowMode parameter to skip takoff in MulticopterPositionControl

Signed-off-by: Michał Barciś <mbarcis@mbarcis.net>
This commit is contained in:
Michał Barciś
2023-11-03 17:37:05 +04:00
committed by Matthias Grob
parent 9d455d5f1f
commit 6800a448b0
6 changed files with 13 additions and 11 deletions
@@ -43,6 +43,7 @@ void MulticopterThrowLaunch::update(const bool armed)
if (_param_com_throw_en.get()) {
if (_vehicle_local_position_sub.updated()) {
vehicle_local_position_s vehicle_local_position{};
if (_vehicle_local_position_sub.copy(&vehicle_local_position)) {
_last_velocity = matrix::Vector3f(vehicle_local_position.vx, vehicle_local_position.vy, vehicle_local_position.vz);
}
@@ -56,9 +56,10 @@ public:
/**
* @return false if feature disabled or already flying
*/
bool isThrowLaunchInProgress() const {
bool isThrowLaunchInProgress() const
{
return _throw_launch_state != ThrowLaunchState::DISABLED
&& _throw_launch_state != ThrowLaunchState::FLYING;
&& _throw_launch_state != ThrowLaunchState::FLYING;
}
bool isReadyToThrow() const { return _throw_launch_state == ThrowLaunchState::ARMED; }