File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class Gimbal : public FactGroup
5151 void setAbsolutePitch (float absPitch) { absolutePitch ()->setRawValue (absPitch); }
5252 void setBodyYaw (float yaw) { bodyYaw ()->setRawValue (yaw); }
5353 void setAbsoluteYaw (float absYaw) { absoluteYaw ()->setRawValue (absYaw); }
54- void setDeltaYaw (float delta) { deltaYaw ()->setRawValue (delta); }
54+ void setDeltaYaw (float delta) { deltaYaw ()->setRawValue (delta); _receivedDeltaYaw = true ; }
5555 void setDeviceId (uint id) { deviceId ()->setRawValue (id); }
5656 void setManagerCompid (uint id) { managerCompid ()->setRawValue (id); }
5757
@@ -65,7 +65,7 @@ class Gimbal : public FactGroup
6565 void setCapabilityFlags (uint32_t flags);
6666 bool supportsRetract () const { return (_capabilityFlags & GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT ) != 0 ; }
6767 bool supportsYawLock () const { return (_capabilityFlags & GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK ) != 0 ; }
68- bool hasDeltaYaw () { return ! qIsNaN ( deltaYaw ()-> rawValue (). toFloat ()) ; }
68+ bool hasDeltaYaw () { return _receivedDeltaYaw ; }
6969
7070signals:
7171 void pitchRateChanged ();
@@ -85,6 +85,7 @@ class Gimbal : public FactGroup
8585 bool _receivedGimbalManagerInformation = false ;
8686 bool _receivedGimbalManagerStatus = false ;
8787 bool _receivedGimbalDeviceAttitudeStatus = false ;
88+ bool _receivedDeltaYaw = false ;
8889 bool _isComplete = false ;
8990 bool _neutral = false ;
9091 uint32_t _capabilityFlags = 0 ; // GIMBAL_MANAGER_CAP_FLAGS
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ void GimbalController::_handleGimbalDeviceAttitudeStatus(const mavlink_message_t
242242
243243 const float deltaYawDeg = qRadiansToDegrees (attitude_status.delta_yaw );
244244 // Extension field: unsent decodes as 0.0, so ignore 0 until a value proves support.
245- if (! qIsNaN ( gimbal->deltaYaw ()-> rawValue (). toFloat () ) || attitude_status.delta_yaw != 0 .0f ) {
245+ if (gimbal->hasDeltaYaw ( ) || attitude_status.delta_yaw != 0 .0f ) {
246246 gimbal->setDeltaYaw (deltaYawDeg);
247247 }
248248
You can’t perform that action at this time.
0 commit comments