qgroundcontrol icon indicating copy to clipboard operation
qgroundcontrol copied to clipboard

Feature: Add QML-configurable gimbal max speed and deadzones

Open Niki-dev12 opened this issue 7 months ago • 6 comments

Title:

Add QML-configurable gimbal max speed and yaw/pitch deadzone settings

Description

This PR adds new joystick configuration features to allow runtime adjustment of: Gimbal pitch and yaw max speed, using a single gimbalMaxSpeed parameter exposed to QML Deadzone control for pitch and yaw gimbal axes via gimbalPitchDeadzone and gimbalYawDeadzone Enable/disable axis-based gimbal control (gimbalAxisEnabled)

This allows users to fine-tune gimbal behavior without recompiling, which is especially useful when mapping joystick axes for dynamic camera control.

Changes include:

Q_PROPERTY bindings for the three settings
Persistent saving and loading through _saveSettings() and _loadSettings()
Updated _handleAxis() to apply speed scaling and deadzone filtering
Optional offset for gimbal pitch and yaw to avoid zero drift

Test Steps

Launch QGC with a joystick connected
Use a QML debug view or a settings panel to:
    Set gimbalMaxSpeed (e.g., 30–160)
    Adjust gimbalPitchDeadzone or gimbalYawDeadzone
    Toggle gimbalAxisEnabled
Observe how gimbal responsiveness changes accordingly
Confirm values persist between sessions

Tested in:

Real drone running ardupilot with gimbal
Ubuntu 22 and Zorro 

Checklist:

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Niki-dev12 avatar Aug 10 '25 20:08 Niki-dev12

Could you look at the GimbalController and see if you can use that instead of changing Vehicle?

HTRamsey avatar Aug 14 '25 16:08 HTRamsey

This is starting to look good.

Have you thought about the case where we don't have control over the gimbal yet and need to acquire it?

I suggest handling this in a follow up PR, since it feels a bit out of scope for the changes in this one.

Niki-dev12 avatar Sep 11 '25 11:09 Niki-dev12

Could you remove the extra .txt & .cmake files?

HTRamsey avatar Oct 10 '25 06:10 HTRamsey

Could you remove the extra .txt & .cmake files?

Yes I will do that. Thanks for pointing it out.

Niki-dev12 avatar Oct 10 '25 11:10 Niki-dev12

So I've been going through the state of Joystick Config/Calibration. It's quite a mess and needs a consistent rework. I'm going to do that in the next couple days which is gonna hammer this pull. I'll take care of it myself though by integrating.modifying your work into the new code. So leave this open for now. And I'll pull code from it and move it to the new stuff as I make progress.

DonLakeFlyer avatar Oct 20 '25 01:10 DonLakeFlyer

So I've been going through the state of Joystick Config/Calibration. It's quite a mess and needs a consistent rework. I'm going to do that in the next couple days which is gonna hammer this pull. I'll take care of it myself though by integrating.modifying your work into the new code. So leave this open for now. And I'll pull code from it and move it to the new stuff as I make progress.

Thanks a lot for the update. I will leave the PR open as suggested and will follow your progress.

Niki-dev12 avatar Oct 21 '25 07:10 Niki-dev12

Hi @DonLakeFlyer is there any update from your side on this?

eMrazSVK avatar Dec 11 '25 13:12 eMrazSVK

Sorry, lost track of this. Working on it now...

DonLakeFlyer avatar Dec 11 '25 16:12 DonLakeFlyer