Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GNC Tools

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.

Installation

pip install

Coming soon

Install from source

  1. Clone repo using git clone git@github.com:rambech/gnc-tools.git
  2. Enter the repo using cd gnc-tools
  3. Install package using python3 -m pip install .

Usage

Import

import gnc # Main library
import gnc.linalg as linalg # Linear algebra library

GNC functions

import 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])

Linear algebra

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)

Mathematics shortcuts

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)

Full function list

A full list of available functions and their description will be available at some point.

About

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.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages