1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00
LibrePilot/flight/Modules/FlightPlan/lib/uavobjects.py
vassilis d7fd8a3bcd Flight/FlightPlan: Enable Python VM and test flightplan execution. From now on a Python executable needs to be in the system path as it is used in the Makefile.
A test script is statically linked (will eventually be uploaded by the GCS and stored in the VM), it can be found under: Modules/FlightPlan/flightplans/test.py

To start the script send the FlightPlanControl object with the Start command, to stop send the Stop or Kill commands.

Next release will be the OpenPilot python libraries and access to UAVObjects from the script.



git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2480 ebee16cc-31ac-478f-84a7-5cbb03baadba
2011-01-19 03:34:01 +00:00

28 lines
479 B
Python

"""__NATIVE__
#include "openpilot.h"
#include "flightplanstatus.h"
"""
def FlightPlanStatusUpdate(val):
"""__NATIVE__
pPmObj_t pobj;
FlightPlanStatusData status;
FlightPlanStatusGet(&status);
pobj = NATIVE_GET_LOCAL(0);
if ( OBJ_GET_TYPE(pobj) == OBJ_TYPE_INT )
status.Debug1 = ((pPmInt_t) pobj)->val;
else if ( OBJ_GET_TYPE(pobj) == OBJ_TYPE_FLT )
status.Debug1 = ((pPmFloat_t) pobj)->val;
FlightPlanStatusSet(&status);
return PM_RET_OK;
"""
pass