mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 20:00:35 +08:00
ThrowLaunch: check ThrowMode parameter to skip takoff in MulticopterPositionControl
Signed-off-by: Michał Barciś <mbarcis@mbarcis.net>
This commit is contained in:
committed by
Matthias Grob
parent
9d455d5f1f
commit
6800a448b0
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user