Commit 22166a11 authored by Stefan Dunca's avatar Stefan Dunca

Custom Example: Fix gimbal state getting out of the limits. Fix palette button...

Custom Example: Fix gimbal state getting out of the limits. Fix palette button not working if not in thermal mode. Increase zoom buttons
parent 4b15d5bc
......@@ -85,7 +85,7 @@ Item {
//---------------------------------------------------------------------
//-- Quick Thermal Modes
Item {
id: backgroundRect
id: thermalBackgroundRect
width: buttonsRow.width + (ScreenTools.defaultFontPixelWidth * 4)
height: buttonsRow.height + (ScreenTools.defaultFontPixelHeight)
visible: _irPaletteFact && QGroundControl.videoManager.hasThermal || _camera.vendor === "NextVision"
......@@ -143,14 +143,12 @@ Item {
// Thermal palette options
CustomQuickButton {
checkable: false
enabled: thermalFull.checked || thermalPip.checked
width: buttonSize
height: buttonSize
visible: _irPaletteFact
iconSource: "/custom/img/thermal-palette.svg"
onClicked: {
if(_irPaletteFact) {
thermalPalettes.open()
}
thermalPalettes.open()
}
}
}
......@@ -466,7 +464,7 @@ Item {
visible: _hasZoom
mainColor: qgcPal.window
contentColor: qgcPal.text
fontPointSize: ScreenTools.defaultFontPointSize * 1.25
fontPointSize: ScreenTools.defaultFontPointSize * 1.75
zoomLevelVisible: false
zoomLevel: _hasZoom ? _camera.zoomLevel : NaN
anchors.horizontalCenter: parent.horizontalCenter
......@@ -942,7 +940,7 @@ Item {
id: thermalPalettes
width: Math.min(mainWindow.width * 0.666, ScreenTools.defaultFontPixelWidth * 40)
height: mainWindow.height * 0.5
modal: true
//modal: true
focus: true
parent: Overlay.overlay
x: Math.round((mainWindow.width - width) * 0.5)
......@@ -980,6 +978,12 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
_irPaletteFact.value = index
if(thermalBackgroundRect.visible) {
if(_camera.thermalMode !== QGCCameraControl.THERMAL_PIP && _camera.thermalMode !== QGCCameraControl.THERMAL_FULL) {
_camera.thermalMode = QGCCameraControl.THERMAL_FULL
}
}
thermalPalettes.close()
}
}
......
......@@ -563,8 +563,11 @@ Item {
//console.info("error: " + pitch_angle_error + "; angle_state: " + pitch_angle)
pitch = pitch_setpoint
yaw += stick.xAxis * gimbalControl.speedMultiplier
yaw = clamp(yaw, -180, 180)
pitch = clamp(pitch, -45, 45)
pitch = clamp(pitch, -90, 45)
pitch_angle = clamp(pitch_angle, -90, 45)
//console.info("P: " + pitch + "; Y: " + yaw)
activeVehicle.gimbalControlValue(pitch, yaw);
gimbalControl._currentYaw = yaw
......@@ -572,7 +575,7 @@ Item {
gimbalControl.time_last_seconds = time_current_seconds
} else {
yaw += stick.xAxis * gimbalControl.speedMultiplier
var hackedYaw = yaw + (stick.xAxis * gimbalControl.speedMultiplier * 25)
var hackedYaw = yaw + (stick.xAxis * gimbalControl.speedMultiplier * 50)
pitch += pitch_stick * gimbalControl.speedMultiplier
hackedYaw = clamp(hackedYaw, -180, 180)
yaw = clamp(yaw, -180, 180)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment