Skip to main content

ins_nav

Actions Status PyPI - License PyPI - Python Version PyPI - Format PyPI

This library is written independent of any specific IMU. The idea is you pass in the appropriate measurements and error terms from your IMU and get the desired output.

This is still under heavy development

Reference Frames

  • ECI: Earth-centered Inertial is an inertial frame where Newton's laws of motion apply. It has its origin at the center of the Earth with:
    • x-axis in the direction of the vernal equinox
    • z-axis is parallel to the rotation of the Earth
    • y-axis completes the right-handed coordinate system
  • ECEF: Earth-centered, Earth-fixed has the same origin as ECI, but rotates with the Earth and the x-axis points towards the zero/prime meridian. The ECEF frame rotates at 7.2921E-5 rads/sec with respect to the ECI frame
  • LLA(H): Latitude, Longitude, Altitude(Height) is similar to the ECEF frame, but is the frame historically used for GPS navigation

WGS84

wgs = WGS84()

# here are a bunch of useful constants in WGS84 class
wgs.rf = 298.257223563
wgs.f = 1/self.rf
wgs.a = 6378137.0
wgs.b = self.a - self.a * self.f
wgs.e = np.sqrt(1 - (self.b ** 2 / self.a ** 2))
wgs.r = (2*self.a + self.b) / 3
wgs.rotation_period = 23*3600 + 56*60 + 4.09053
wgs.rate = 7.2921157e-5  # Rotation rate of Earth [rad/s]
wgs.sf = 1.2383e-3       # Schuller frequency

# translate ecef(x,y,z) <=> llh(lat,lon,alt)
wgs.ecef2llh(loc)
wgs.llh2ecef(loc)

wgs.gravity(lat)   # gravity changes by latitude[deg]
wgs.radius(lat)    # Earth's radius changes by latitude[deg]
wgs.haversine(a,b) # calculates distance between locations a and b

Navigation Frames

While ECEF can be used to navigate the globe, often, you only need to travel 100's of meters or kilometers. Thus a local navigational frame that is tangental to the curvature of the Earth is more useful (and intuitive). Two common ones are:

  • ENU: East North Up a local navigation frame, where up and the z-axis align, but clockwise right turns are negative
  • NED: North East Down a local navigation frame, where up and the z-axis are opposite, but the direction of right (clockwise) turns are in the positive direction and is the standard vehicle roll-pitch-yaw frame
ref = (40,-90,100) # origin of local frame (lat[deg], lon[deg], altitude[m])
frame = NavigationalFrame(ref)

# allof these will calculate position relative to your local
# frame origin
loc = [x,y,z]
frame.ecef2ned(loc)
frame.ecef2enu(loc)
frame.ned2ecef(loc)
frame.enu2ecef(loc)
frame.enu2ned(loc)
frame.ned2enu(loc)

Other Good Navigation Libraries

  • lat_lon_parser allows you to convert between measurements formats like -45 deg 12' 36.0 sec, 45.21 W, and -45.21 easily
  • nvector has a lot of capability
  • navpy appears to be simple grad student work but code is well referenced (BSD)
  • navigation does GPS navigation and way points

The MIT License (MIT)

Copyright (c) 2016 Kevin J. Walchko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for ins-nav 2023.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ins-nav 2023.7.2
File Size Uploaded
ins_nav-2023.7.2.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ins-nav 2023.7.2
File Interpreter ABI Platform
ins_nav-2023.7.2-py3-none-any.whl Python 3 none any Details

Total release size: 37.4 kB

Release files / ins_nav-2023.7.2.tar.gz

Download URL ins_nav-2023.7.2.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a73ef799e749d4a79979327f8439421098fe267fa5be607ac5c53e994364d917
BLAKE2b-256 checksum
How to use checksums
7aac6d105a01ddccad02c47adbf401e0532deb25d6f089339201278530afe042
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Darwin/21.6.0

Release files / ins_nav-2023.7.2-py3-none-any.whl

Download URL ins_nav-2023.7.2-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86d5823074dd77c81da4ba49de7174f7b1f3a71b9d833535e81e091a12fc4675
BLAKE2b-256 checksum
How to use checksums
8c839a17f2b46bcf4615d890ec4dd9953c9427825c6d4f6d1c1b2976036b0b05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Darwin/21.6.0

Release history Release notifications | RSS feed

This release

2023.7.2 This release

2 release files

0.6.0

2 release files

0.5.0

3 release files

0.0.4

3 release files

0.0.3

3 release files

0.0.2

3 release files

0.0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page