paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Paparazzi-devel] python wrappers for Paparazzi algebra and geodetic mat


From: Felix Ruess
Subject: [Paparazzi-devel] python wrappers for Paparazzi algebra and geodetic math lib
Date: Thu, 15 Jan 2015 17:39:16 +0100

Hi all,

since I've already been asked about this, a short notice on the Python wrappers for the Paparazzi math lib that we now have in master:

You need to install swig2.0
$ sudo apt-get install swig2.0
build the wrappers
$ cd $PAPARAZZI_SRC/sw/lib/python/pprz_math
$ make

Make sure python will find the modules by either adding $PAPARAZZI_SRC/sw/lib/python to your PYTHONPATH or adding it to sys.path at runtime of the script.
E.g. to play around with it in ipython:
$ PYTHONPATH=$PAPARAZZI_SRC/sw/lib/python:$PYTHONPATH ipython

You can then import the modules or parts in the usual way, e.g.:
from pprz_math.geodetic import *
from pprz_math.algebra import FloatEulers, FloatVect3, FloatQuat, FloatRMat
and do some stuff with it:
utm_origin = UtmCoor_d(north=377349, east=4824583, alt=147, zone=31)
print("origin %s" % utm_origin)
lla_origin = utm_origin.to_lla()
ecef_origin = lla_origin.to_ecef()
ltp_origin = ecef_origin.to_ltp_def()
print(ltp_origin)

v = FloatVect3(16,32,64)
R = FloatEulers(phi=radians(90)).to_rmat()
v2 = FloatVect3(1,2,3) + R * v
See also https://github.com/paparazzi/paparazzi/pull/1066
Pull requests with improvements are of course welcome ;-)

Cheers, Felix

reply via email to

[Prev in Thread] Current Thread [Next in Thread]