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..09b62aff3 100644 --- a/src/components/MiniWidgetInstantiator.vue +++ b/src/components/MiniWidgetInstantiator.vue @@ -1,4 +1,7 @@ + + + @@ -43,6 +46,7 @@ import DepthIndicator from './mini-widgets/DepthIndicator.vue' import JoystickCommIndicator from './mini-widgets/JoystickCommIndicator.vue' import MiniVideoRecorder from './mini-widgets/MiniVideoRecorder.vue' import ModeSelector from './mini-widgets/ModeSelector.vue' +import RelativeAltitudeIndicator from './mini-widgets/RelativeAltitudeIndicator.vue' import SatelliteIndicator from './mini-widgets/SatelliteIndicator.vue' import VeryGenericIndicator from './mini-widgets/VeryGenericIndicator.vue' import ViewSelector from './mini-widgets/ViewSelector.vue' diff --git a/src/components/mini-widgets/RelativeAltitudeIndicator.vue b/src/components/mini-widgets/RelativeAltitudeIndicator.vue new file mode 100644 index 000000000..f006fd321 --- /dev/null +++ b/src/components/mini-widgets/RelativeAltitudeIndicator.vue @@ -0,0 +1,24 @@ + + + + + + {{ round(altitude, 2).toFixed(2) }} + m + + Alt (Rel) + + + + + diff --git a/src/libs/vehicle/ardupilot/ardupilot.ts b/src/libs/vehicle/ardupilot/ardupilot.ts index 9e1f3e7f8..febc9006d 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..c5710d868 100644 --- a/src/types/miniWidgets.ts +++ b/src/types/miniWidgets.ts @@ -7,6 +7,7 @@ export enum MiniWidgetType { BaseCommIndicator = 'BaseCommIndicator', BatteryIndicator = 'BatteryIndicator', DepthIndicator = 'DepthIndicator', + RelativeAltitudeIndicator = 'RelativeAltitudeIndicator', VeryGenericIndicator = 'VeryGenericIndicator', JoystickCommIndicator = 'JoystickCommIndicator', MiniVideoRecorder = 'MiniVideoRecorder',