Skip to content

Commit

Permalink
dont return on non 1 vid
Browse files Browse the repository at this point in the history
  • Loading branch information
goasChris committed Feb 6, 2024
1 parent 170f444 commit dc373e3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libs/vehicle/ardupilot/ardupilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion src/libs/vehicle/ardupilot/ardurover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions src/libs/vehicle/vehicle-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/stores/mainVehicle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit dc373e3

Please sign in to comment.