Commit 04bcd923 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

software/js-drone: fix unserializable position

Workaround for https://github.com/bellard/quickjs/issues/315 .
parent dc3596bb
...@@ -46,4 +46,4 @@ md5sum = 3bbb0f80b644d86784aab99b03e88c2f ...@@ -46,4 +46,4 @@ md5sum = 3bbb0f80b644d86784aab99b03e88c2f
[worker] [worker]
_update_hash_filename_ = drone-scripts/worker.js.jinja2 _update_hash_filename_ = drone-scripts/worker.js.jinja2
md5sum = 2afbc5c18a453404f6c60e874f592577 md5sum = f3ad1e74bdb977c9444713f14a2ea6fe
...@@ -80,7 +80,15 @@ import { evalScript, fdopen, loadFile, open } from "std"; ...@@ -80,7 +80,15 @@ import { evalScript, fdopen, loadFile, open } from "std";
{% if isADrone -%} {% if isADrone -%}
getAltitudeAbs: getAltitude, getAltitudeAbs: getAltitude,
getClimbRate: getClimbRate, getClimbRate: getClimbRate,
getCurrentPosition: getPosition, getCurrentPosition: function () {
const position = getPosition();
return {
latitude: position.latitude,
longitude: position.longitude,
altitude: position.altitude,
timestamp: position.timestamp
};
},
getInitialAltitude: getInitialAltitude, getInitialAltitude: getInitialAltitude,
gpsIsOk: gpsIsOk, gpsIsOk: gpsIsOk,
getMaxCommandFrequency: getMaxCommandFrequency, getMaxCommandFrequency: getMaxCommandFrequency,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment