add lat/long to takeoff/land cmds

This commit is contained in:
dave 2018-09-26 23:01:40 -04:00
parent c60c1e53ec
commit 13719ec22f
1 changed files with 5 additions and 0 deletions

View File

@ -743,6 +743,8 @@ script
{ {
case NAV_TAKEOFF: case NAV_TAKEOFF:
goto_pos = buzzuav_closures::getgoto(); goto_pos = buzzuav_closures::getgoto();
cmd_srv.request.param5 = cur_pos.latitude;
cmd_srv.request.param6 = cur_pos.longitude;
cmd_srv.request.param7 = goto_pos[2]; cmd_srv.request.param7 = goto_pos[2];
cmd_srv.request.command = buzzuav_closures::getcmd(); cmd_srv.request.command = buzzuav_closures::getcmd();
if (!armstate) if (!armstate)
@ -766,6 +768,9 @@ script
break; break;
case NAV_LAND: case NAV_LAND:
cmd_srv.request.param5 = cur_pos.latitude;
cmd_srv.request.param6 = cur_pos.longitude;
cmd_srv.request.param7 = 0.0;
cmd_srv.request.command = buzzuav_closures::getcmd(); cmd_srv.request.command = buzzuav_closures::getcmd();
if (current_mode != "LAND" && setmode) if (current_mode != "LAND" && setmode)
{ {