diff --git a/src/assets/altitude-icon.svg b/src/assets/altitude-icon.svg new file mode 100644 index 000000000..769f4f7ae --- /dev/null +++ b/src/assets/altitude-icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/components/MiniWidgetInstantiator.vue b/src/components/MiniWidgetInstantiator.vue index abb89e896..67ec25e87 100644 --- a/src/components/MiniWidgetInstantiator.vue +++ b/src/components/MiniWidgetInstantiator.vue @@ -1,4 +1,7 @@ + + + @@ -36,6 +39,7 @@ import { toRefs } from 'vue' import { type MiniWidget, MiniWidgetType } from '@/types/miniWidgets' +import AltitudeIndicator from './mini-widgets/RelativeAltitudeIndicator.vue' import ArmerButton from './mini-widgets/ArmerButton.vue' import BaseCommIndicator from './mini-widgets/BaseCommIndicator.vue' import BatteryIndicator from './mini-widgets/BatteryIndicator.vue' diff --git a/src/components/mini-widgets/RelativeAltitudeIndicator.vue b/src/components/mini-widgets/RelativeAltitudeIndicator.vue new file mode 100644 index 000000000..852ebe248 --- /dev/null +++ b/src/components/mini-widgets/RelativeAltitudeIndicator.vue @@ -0,0 +1,26 @@ + + + + + + {{ round(altitude, 2).toFixed(2) }} + m + + Alt (Rel) + + + + + + \ No newline at end of file diff --git a/src/libs/vehicle/ardupilot/ardupilot.ts b/src/libs/vehicle/ardupilot/ardupilot.ts index 9e1f3e7f8..38e509685 100644 --- a/src/libs/vehicle/ardupilot/ardupilot.ts +++ b/src/libs/vehicle/ardupilot/ardupilot.ts @@ -54,7 +54,7 @@ export type ArduPilot = ArduPilotVehicle * Generic ArduPilot vehicle */ export abstract class ArduPilotVehicle extends Vehicle.AbstractVehicle { - _altitude = new Altitude({ msl: 0 }) + _altitude = new Altitude({ msl: 0, rel: 0}) _attitude = new Attitude({ roll: 0, pitch: 0, yaw: 0 }) _communicationDropRate = 0 _communicationErrors = 0 @@ -269,6 +269,8 @@ export abstract class ArduPilotVehicle extends Vehicle.AbstractVehicle} init diff --git a/src/types/miniWidgets.ts b/src/types/miniWidgets.ts index 0f3cb78f9..3743f5e70 100644 --- a/src/types/miniWidgets.ts +++ b/src/types/miniWidgets.ts @@ -3,6 +3,7 @@ * The enum value is equal to the component's filename, without the '.vue' extension */ export enum MiniWidgetType { + AltitudeIndicator = 'AltitudeIndicator', ArmerButton = 'ArmerButton', BaseCommIndicator = 'BaseCommIndicator', BatteryIndicator = 'BatteryIndicator',