Skip to content

Commit

Permalink
Ignore "Ok(xxx)" result messages from mavlink2rest
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Nov 16, 2023
1 parent db88ade commit 991bab3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libs/vehicle/ardupilot/ardupilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,13 @@ export abstract class ArduPilotVehicle<Modes> extends Vehicle.AbstractVehicle<Mo
try {
mavlink_message = JSON.parse(text_message) as Package
} catch (error) {
const pattern = /Ok\((\d+)\)/
const match = pattern.exec(text_message)
if (match) {
const number: string = match[1]
console.debug(`Ok result from mavlink2rest: ${number}`)
return
}
console.error(`Failed to parse mavlink message: ${text_message}`)
return
}
Expand Down

0 comments on commit 991bab3

Please sign in to comment.