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

component/mavsdk: use mavlink v2 headers

parent 363f4bba
...@@ -13,7 +13,7 @@ parts = ...@@ -13,7 +13,7 @@ parts =
[c-astral-headers] [c-astral-headers]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/c-astral-c-library repository = https://lab.nexedi.com/nexedi/c-astral-c-library
revision = v1.0 revision = v2.0
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
[gcc] [gcc]
...@@ -33,8 +33,7 @@ path = ${mavsdk-source:location} ...@@ -33,8 +33,7 @@ path = ${mavsdk-source:location}
cmake = ${cmake:location}/bin/cmake cmake = ${cmake:location}/bin/cmake
pre-configure = pre-configure =
${git:location}/bin/git submodule update --init --recursive ${git:location}/bin/git submodule update --init --recursive
cp -r ${c-astral-headers:location}/* ${mavsdk-source:location}/src/third_party/mavlink/include/mavlink/v2.0/ cp -r ${c-astral-headers:location}/mavlink/v2.0/* ${mavsdk-source:location}/src/third_party/mavlink/include/mavlink/v2.0/
sed -i 's#common/mavlink.h#CAstral/mavlink.h#' ${mavsdk-source:location}/src/core/mavlink_include.h
configure-command = configure-command =
${:cmake} ${:cmake}
configure-options = configure-options =
......
This diff is collapsed.
...@@ -26,7 +26,7 @@ md5sum = 1ff50063f5a54712a0bc0ff38fa74630 ...@@ -26,7 +26,7 @@ md5sum = 1ff50063f5a54712a0bc0ff38fa74630
[main] [main]
filename = main.js filename = main.js
md5sum = d0bfcc79cdd7c1e5b8f5d264cc59074e md5sum = 21217f85fdab2f6307e3edc6ba74d0b6
[pubsub] [pubsub]
filename = pubsub.js filename = pubsub.js
...@@ -34,4 +34,4 @@ md5sum = 1555496ad591a31a845f33488d5c335d ...@@ -34,4 +34,4 @@ md5sum = 1555496ad591a31a845f33488d5c335d
[worker] [worker]
filename = worker.js filename = worker.js
md5sum = e4b4ca3bde1a21f1dbfc4ff7fa3b872c md5sum = 9167a47913658d395a328f67b5a80d36
...@@ -36,10 +36,10 @@ import { open, exit } from "std"; ...@@ -36,10 +36,10 @@ import { open, exit } from "std";
// to prevent it to finish (and so, exit the quickjs process) // to prevent it to finish (and so, exit the quickjs process)
worker = new Worker("{{ worker_script }}"); worker = new Worker("{{ worker_script }}");
function quit(is_a_drone, exit_code) { function quit(is_a_drone, shutdown, exit_code) {
stopPubsub(); stopPubsub();
if (is_a_drone) { if (is_a_drone) {
stop(); stop(shutdown);
} }
exit(exit_code); exit(exit_code);
} }
...@@ -141,10 +141,10 @@ import { open, exit } from "std"; ...@@ -141,10 +141,10 @@ import { open, exit } from "std";
can_update = true; can_update = true;
} else if (type === 'exited') { } else if (type === 'exited') {
worker.onmessage = null; worker.onmessage = null;
quit(configuration.isADrone, e.data.exit); quit(configuration.isADrone, !configuration.isASimulation, e.data.exit);
} else { } else {
console.log('Unsupported message type', type); console.log('Unsupported message type', type);
quit(configuration.isADrone, 1); quit(configuration.isADrone, !configuration.isASimulation, 1);
} }
}; };
}(arm, console, exit, open, scriptArgs, setTimeout, start, stop, stopPubsub, }(arm, console, exit, open, scriptArgs, setTimeout, start, stop, stopPubsub,
......
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */ /*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*global console, getAltitude, getAltitudeRel, getInitialAltitude, getLatitude, /*global console, getAltitude, getAltitudeRel, getInitialAltitude, getLatitude,
getLongitude, getYaw, execUserScript, initPubsub, landed, loiter, setAirspeed, getLongitude, getYaw, execUserScript, initPubsub, loiter, setAirspeed,
setMessage, setTargetCoordinates, std, triggerParachute, Drone, Worker*/ setMessage, setTargetCoordinates, std, triggerParachute, Drone, Worker*/
import { import {
Drone, Drone,
...@@ -14,7 +14,6 @@ import { ...@@ -14,7 +14,6 @@ import {
getLongitude, getLongitude,
getYaw, getYaw,
initPubsub, initPubsub,
landed,
loiter, loiter,
setAirspeed, setAirspeed,
setMessage, setMessage,
...@@ -24,7 +23,7 @@ import * as std from "std"; ...@@ -24,7 +23,7 @@ import * as std from "std";
import { Worker } from "os"; import { Worker } from "os";
(function (console, getAltitude, getAltitudeRel, getInitialAltitude, (function (console, getAltitude, getAltitudeRel, getInitialAltitude,
getLatitude, getLongitude, getYaw, initPubsub, landed, loiter, getLatitude, getLongitude, getYaw, initPubsub, loiter,
setAirspeed, setMessage, setTargetCoordinates, std, triggerParachute, setAirspeed, setMessage, setTargetCoordinates, std, triggerParachute,
Drone, Worker) { Drone, Worker) {
// Every script is evaluated per drone // Every script is evaluated per drone
...@@ -58,7 +57,6 @@ import { Worker } from "os"; ...@@ -58,7 +57,6 @@ import { Worker } from "os";
getSpeed: getAirspeed, getSpeed: getAirspeed,
getClimbRate: getClimbRate, getClimbRate: getClimbRate,
id: configuration.id, id: configuration.id,
landed: landed,
loiter: loiter, loiter: loiter,
sendMsg: function (msg, id) { sendMsg: function (msg, id) {
if (id === undefined) { id = -1; } if (id === undefined) { id = -1; }
...@@ -136,5 +134,5 @@ import { Worker } from "os"; ...@@ -136,5 +134,5 @@ import { Worker } from "os";
} }
}; };
}(console, getAltitude, getAltitudeRel, getInitialAltitude, getLatitude, }(console, getAltitude, getAltitudeRel, getInitialAltitude, getLatitude,
getLongitude, getYaw, initPubsub, landed, loiter, setAirspeed, setMessage, getLongitude, getYaw, initPubsub, loiter, setAirspeed, setMessage,
setTargetCoordinates, std, triggerParachute, Drone, Worker)); setTargetCoordinates, std, triggerParachute, Drone, Worker));
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