This is a Python package for getting easy access to tools needed to perform calculations and transformation related to guidance, navigation and control (GNC) tasks. It is based on the tools used in PythonVehicleSimulator and MSS Toolbox by Thor I. Fossen.
Coming soon
- Clone repo using
git clone git@github.com:rambech/gnc-tools.git - Enter the repo using
cd gnc-tools - Install package using
python3 -m pip install .
import gnc # Main library
import gnc.linalg as linalg # Linear algebra libraryimport numpy as np
import gnc
# Transforms
nu = np.array([2, 0, 0])
eta_dot = gnc.B2N(nu) # BODY to NED transformation
# Helpful functions
wp0 = [59.65918355434504, 10.62844055814729]
wp1 = [59.90875817046556, 10.71927031763238]
distance = gnc.distance_along_great_circle(wp0[0], wp0[1], wp1[0], wp1[1])import numpy as np
import gnc
A = np.array([
[2, 0, 0],
[1, 0, 3],
[7, 0, 5]
]) # Non-invertable matrix
# Inverting using Moore-Penrose pseudo-inverse
A_inv = gnc.linalg.moore_penrose(A)
# 3x3 skew-symmetric matrix
vector = np.array([1, 5, 3])
S = gnc.linalg.Smtrx(vector)import numpy as np
import gnc
# Conversion
radians = 2*np.pi
degrees = gnc.R2D(radians)
ragians = gnc.D2R(degrees)
speed_knots = 11
speed_ms = gnc.kts2ms(speed_knots)
speed_knots = gnc.ms2kts(speed_ms)
speed_kph = gnc.kts2kph(speed_knots)A full list of available functions and their description will be available at some point.