From dc373e3aa3b77e2c06cdfe4941c14c41df8093bb Mon Sep 17 00:00:00 2001
From: Chris <kristiansen@goas.no>
Date: Tue, 6 Feb 2024 10:13:40 +0000
Subject: [PATCH] dont return on non 1 vid

---
 src/libs/vehicle/ardupilot/ardupilot.ts | 2 +-
 src/libs/vehicle/ardupilot/ardurover.ts | 2 +-
 src/libs/vehicle/vehicle-factory.ts     | 1 +
 src/stores/mainVehicle.ts               | 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/libs/vehicle/ardupilot/ardupilot.ts b/src/libs/vehicle/ardupilot/ardupilot.ts
index f6afc23fb..c4b0ab4cf 100644
--- a/src/libs/vehicle/ardupilot/ardupilot.ts
+++ b/src/libs/vehicle/ardupilot/ardupilot.ts
@@ -180,7 +180,7 @@ export abstract class ArduPilotVehicle<Modes> extends Vehicle.AbstractVehicle<Mo
 
     const { system_id, component_id } = mavlink_message.header
 
-    if (system_id != 1 || component_id != 1) {
+    if (component_id != 1) {
       return
     }
 
diff --git a/src/libs/vehicle/ardupilot/ardurover.ts b/src/libs/vehicle/ardupilot/ardurover.ts
index 69d4fc787..45af4f23f 100644
--- a/src/libs/vehicle/ardupilot/ardurover.ts
+++ b/src/libs/vehicle/ardupilot/ardurover.ts
@@ -70,7 +70,7 @@ export class ArduRover extends ArduPilotVehicle<CustomMode> {
    */
   onMAVLinkPackage(mavlink: Package): void {
     const { system_id, component_id } = mavlink.header
-    if (system_id != 1 || component_id !== 1) {
+    if (component_id !== 1) {
       return
     }
 
diff --git a/src/libs/vehicle/vehicle-factory.ts b/src/libs/vehicle/vehicle-factory.ts
index 264f38bff..eff8937c8 100644
--- a/src/libs/vehicle/vehicle-factory.ts
+++ b/src/libs/vehicle/vehicle-factory.ts
@@ -102,6 +102,7 @@ function createVehicleFromMessage(message: Uint8Array): void {
   if (heartbeat.autopilot.type !== MavAutopilot.MAV_AUTOPILOT_ARDUPILOTMEGA) {
     console.warn(`Vehicle not supported: ${system_id}/${component_id}: ${heartbeat.autopilot.type}`)
   }
+  console.info("vid: ", system_id)
 
   switch (heartbeat.mavtype.type) {
     case MavType.MAV_TYPE_SUBMARINE:
diff --git a/src/stores/mainVehicle.ts b/src/stores/mainVehicle.ts
index 76d9d0031..e08bf4b27 100644
--- a/src/stores/mainVehicle.ts
+++ b/src/stores/mainVehicle.ts
@@ -332,7 +332,7 @@ export const useMainVehicleStore = defineStore('main-vehicle', () => {
       Object.assign(genericVariables, newGenericVariablesState)
     })
     mainVehicle.value.onMAVLinkMessage.add(MAVLinkType.HEARTBEAT, (pack: Package) => {
-      if (pack.header.system_id != 1 || pack.header.component_id != 1) {
+      if (pack.header.component_id != 1) {
         return
       }