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

Set loiter parameter mandatory

parent 12bcca0c
......@@ -457,11 +457,9 @@ static JSValue js_mavsdk_triggerParachute(JSContext *ctx, JSValueConst thisVal,
static JSValue js_mavsdk_loiter(JSContext *ctx, JSValueConst thisVal,
int argc, JSValueConst *argv)
{
double radius = 100;
if (argc > 0) {
double radius;
if (JS_ToFloat64(ctx, &radius, argv[0]))
return JS_EXCEPTION;
}
return JS_NewInt32(ctx, mavsdk_loiter((float)radius));
}
......@@ -605,7 +603,7 @@ static const JSCFunctionListEntry js_mavsdk_funcs[] = {
JS_CFUNC_DEF("takeOff", 0, js_mavsdk_takeOff ),
JS_CFUNC_DEF("takeOffAndWait", 0, js_mavsdk_takeOffAndWait ),
JS_CFUNC_DEF("triggerParachute", 0, js_mavsdk_triggerParachute ),
JS_CFUNC_DEF("loiter", 0, js_mavsdk_loiter ),
JS_CFUNC_DEF("loiter", 1, js_mavsdk_loiter ),
JS_CFUNC_DEF("setAirspeed", 1, js_mavsdk_setAirspeed ),
JS_CFUNC_DEF("setAltitude", 1, js_mavsdk_setAltitude ),
JS_CFUNC_DEF("setTargetCoordinates", 3, js_mavsdk_setTargetCoordinates ),
......
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