From 62061dcb32261ff8c2e012b439f6081f5a239f23 Mon Sep 17 00:00:00 2001 From: Arturo Manzoli Date: Fri, 13 Mar 2026 08:35:51 -0300 Subject: [PATCH 1/2] store: mission: migrate home marker position from map components to mission store Signed-off-by: Arturo Manzoli --- src/components/widgets/Map.vue | 8 +++++++- src/stores/mainVehicle.ts | 5 ++++- src/stores/mission.ts | 2 ++ src/views/MissionPlanningView.vue | 8 +++++++- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/widgets/Map.vue b/src/components/widgets/Map.vue index f6ca838650..0ff1140200 100644 --- a/src/components/widgets/Map.vue +++ b/src/components/widgets/Map.vue @@ -242,7 +242,6 @@ const router = useRouter() const map = shallowRef() const zoom = ref(missionStore.userLastMapZoom ?? missionStore.defaultMapZoom) const mapCenter = ref(missionStore.userLastMapCenter ?? missionStore.defaultMapCenter) -const home = ref() const mapId = computed(() => `map-${widget.value.hash}`) const showButtons = computed(() => isMouseOver.value || downloadMenuOpen.value) const mapReady = ref(false) @@ -263,6 +262,13 @@ const downloadMenuOpen = ref(false) const missionItemsInVehicle = ref([]) const missionSeqToMarkerSeq = shallowRef>({}) +const home = computed({ + get: () => missionStore.homeMarkerPosition, + set: (value: WaypointCoordinates | undefined) => { + missionStore.homeMarkerPosition = value + }, +}) + const glassMenuCssVars = computed(() => ({ '--glass-background': interfaceStore.globalGlassMenuStyles.backgroundColor, '--glass-filter': interfaceStore.globalGlassMenuStyles.backdropFilter, diff --git a/src/stores/mainVehicle.ts b/src/stores/mainVehicle.ts index bf129fd5c9..a8d298dcfc 100644 --- a/src/stores/mainVehicle.ts +++ b/src/stores/mainVehicle.ts @@ -464,7 +464,9 @@ export const useMainVehicleStore = defineStore('main-vehicle', () => { if (mainVehicle.value.firmware() !== Vehicle.Firmware.ArduPilot) { throw new Error('Home waypoint retrieval is only supported for ArduPilot vehicles.') } - return await mainVehicle.value.fetchHomeWaypoint() + const homeWaypoint = await mainVehicle.value.fetchHomeWaypoint() + missionStore.homeMarkerPosition = homeWaypoint.coordinates + return homeWaypoint } /** @@ -478,6 +480,7 @@ export const useMainVehicleStore = defineStore('main-vehicle', () => { throw new Error('No vehicle available to set home waypoint.') } await mainVehicle.value.setHomeWaypoint(coordinate, height) + missionStore.homeMarkerPosition = coordinate } /** diff --git a/src/stores/mission.ts b/src/stores/mission.ts index 2f08c723b6..b85a7b58e4 100644 --- a/src/stores/mission.ts +++ b/src/stores/mission.ts @@ -53,6 +53,7 @@ export const useMissionStore = defineStore('mission', () => { ) const mapDownloadMissionFromVehicle = ref<(() => Promise) | null>(null) const mapClearMapDrawing = ref<(() => void) | null>(null) + const homeMarkerPosition = ref(undefined) const { showDialog } = useInteractionDialog() @@ -469,5 +470,6 @@ export const useMissionStore = defineStore('mission', () => { vehiclePositionHistory, isVehiclePositionHistoryPersistent, clearVehicleHistory, + homeMarkerPosition, } }) diff --git a/src/views/MissionPlanningView.vue b/src/views/MissionPlanningView.vue index 16178c912e..4303e25041 100644 --- a/src/views/MissionPlanningView.vue +++ b/src/views/MissionPlanningView.vue @@ -735,7 +735,6 @@ const downloadMissionFromVehicle = async (): Promise => { const planningMap = shallowRef() const mapCenter = ref(missionStore.userLastMapCenter ?? missionStore.defaultMapCenter) -const home = ref(undefined) const zoom = ref(missionStore.userLastMapZoom ?? missionStore.defaultMapZoom) const followerTarget = ref(undefined) const currentWaypointAltitude = ref(0) @@ -790,6 +789,13 @@ let measureTextEl: HTMLDivElement | null = null const surveyAreaMarkers = shallowRef>({}) const liveSurveyAreaMarker = shallowRef(null) +const home = computed({ + get: () => missionStore.homeMarkerPosition, + set: (value: WaypointCoordinates | undefined) => { + missionStore.homeMarkerPosition = value + }, +}) + const glassMenuCssVars = computed(() => ({ '--glass-background': interfaceStore.globalGlassMenuStyles.backgroundColor, '--glass-filter': interfaceStore.globalGlassMenuStyles.backdropFilter, From 9378c3c95597e1d404dbe6d0f711650d973492af Mon Sep 17 00:00:00 2001 From: Arturo Manzoli Date: Wed, 11 Mar 2026 07:35:46 -0300 Subject: [PATCH 2/2] widgets: compassHUD: add home marker reference to HUD Signed-off-by: Arturo Manzoli --- src/components/widgets/CompassHUD.vue | 230 ++++++++++++++++++-------- 1 file changed, 165 insertions(+), 65 deletions(-) diff --git a/src/components/widgets/CompassHUD.vue b/src/components/widgets/CompassHUD.vue index aad0d725c7..265805fb08 100644 --- a/src/components/widgets/CompassHUD.vue +++ b/src/components/widgets/CompassHUD.vue @@ -2,7 +2,7 @@
-
+
+
+ +