celestia-gnss/README.md

207 lines
4.9 KiB
Markdown
Raw Normal View History

2022-05-20 22:54:55 -06:00
# Spacecruft Celestia GNSS
Celestia is a "real-time space simulation that lets you experience our
universe in three dimensions".
Celestia contains many celestial objects, but few that are man made, such
2022-05-20 22:54:55 -06:00
as Hubble. It has a TLE for the ISS, but it doesn't update it.
The present repo contains a script to import GNSS ("GPS") satellite
TLE files into Celestia. It could be easily updated for any other source
of TLEs.
2022-05-20 22:54:55 -06:00
![celestia-gnss-screenshot](pics/celestia-gnss-screenshot.png)
2022-05-20 22:54:55 -06:00
2022-05-21 20:32:46 -06:00
# Install celestia-gnss
Install thusly.
```
git clone https://spacecruft.org/spacecruft/celestia-gnss
cd celestia-gnss
sudo apt update
sudo apt install python3-pip
# Many ways to do python setup, here is one:
pip3 install --upgrade --user pip
# Make sure your path includes `~/.local/bin`, if not, add it.
which pip
# Should be ~/.local/bin/pip
pip install --user -r requirements.txt
```
# Run celestia-gnss
Example (crufty example, if you have perms):
2022-05-21 20:32:46 -06:00
```
./tle2ssc > /usr/share/celestia/extras-standard/gnss/gnss.ssc
2022-05-21 20:32:46 -06:00
```
# Use in Celestia
Then copy the satellites you want into your Celestia extras dir.
Crufty bad way to do it, example:
```
sudo cp -a extras/gnss/gnss.ssc /usr/share/celestia/extras-standard/
2022-05-21 20:32:46 -06:00
```
Each system, GPS, Galileo, Glonass, Beidou, or the GNSS files can
be used which include all four.
2022-05-21 20:32:46 -06:00
2022-05-20 22:54:55 -06:00
# See Also
## Spacecruft
2022-05-20 22:54:55 -06:00
Spacecruft:
* https://spacecruft.org/spacecruft/gnss-earth
* https://spacecruft.org/spacecruft/celestia
## Celestia
2022-05-20 22:54:55 -06:00
Upstream Celestia:
* https://celestia.space/
* https://github.com/CelestiaProject/Celestia
## TLE Conversion
2022-05-21 20:32:46 -06:00
TLE Conversion Spreadsheet by Grant Hutchison from July 2003.
2022-05-20 22:54:55 -06:00
* https://www.classe.cornell.edu/~seb/celestia/hutchison/spreadsheets.html
* https://www.classe.cornell.edu/~seb/celestia/hutchison/tle-xls.zip
## Solar System Catalog
*"Solar System Catalog" files are primarily used to define the objects which
can be found in a stellar system, such as planets, moons, asteroids, comets,
and spacecraft. They also have four other uses: they can define alternative
surface textures, locations on or near an object, and orbital reference points.
An SSC file can also edit objects which have been defined in other SSC catalog files.*
Info on `.ssc` files:
* https://www.classe.cornell.edu/~seb/celestia/creating-ssc-files.html
* https://en.wikibooks.org/wiki/Celestia/SSC_File
In Celestia name "Galileo" is used for the *other* spacecraft, not
for the EU GNSS. So the name used in development here adds `-gnss`,
ala, `galileo-gnss.ssc`, whereas the other GNSS don't.
2022-05-21 14:30:57 -06:00
Example `.ssc` file contents:
```
"1997-035A" "Sol/Earth" {
Class "spacecraft"
# Mesh
Radius 0.005
EllipticalOrbit {
Epoch 2459718.94467728
Period 0.49859567
SemiMajorAxis 26560.345
Eccentricity 0.0057297
Inclination 55.5062
AscendingNode 156.8049
ArgOfPericenter 51.2220
MeanAnomaly 309.3262
}
Obliquity 55.5062
EquatorAscendingNode 156.8049
RotationOffset 80.2289
# Orientation [ ]
}
```
## TLE Sources
Beidou (China)
* https://celestrak.com/NORAD/elements/beidou.txt
Galileo (Europe)
* https://celestrak.com/NORAD/elements/galileo.txt
Glonass (Russia)
* https://celestrak.com/NORAD/elements/glo-ops.txt
GNSS (All)
* https://celestrak.com/NORAD/elements/gnss.txt
GPS (USA)
* https://celestrak.com/NORAD/elements/gps-ops.txt
## Spice
Spice TLE:
"Evaluate NORAD two-line element data for earth orbiting spacecraft."
* https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/spicelib/evsgp4.html
2022-05-21 19:04:08 -06:00
## SGP4
SPG4
2022-05-21 19:04:08 -06:00
* https://pypi.org/project/sgp4/
2022-05-21 19:04:08 -06:00
## Skyfield
Skyfield
* https://rhodesmill.org/skyfield/earth-satellites.html
2022-05-20 22:54:55 -06:00
2022-05-21 01:30:30 -06:00
# 3D Models
Celestia uses an old 3D proprietary format from an old 3D application in
`.3ds` format. It also has it's own format `.cmod`.
2022-05-21 20:32:46 -06:00
## Galileo
Galileo 3D models are from the ESA:
* https://gssc.esa.int/education/galileo3d/
2022-05-21 01:30:30 -06:00
## 3D Model Conversion
Recent versions of Blender don't export `.3ds` format. But old versions
of Blender, such as 2.79b do work. Get an old version here:
2022-05-21 01:30:30 -06:00
* https://download.blender.org/release/Blender2.79/
Launch `blender`, import, export.
```
# Go to https://gssc.esa.int/education/galileo3d/
# and download the Galileo_3D.zip file.
# It generates a unique URL, afaict.
unzip Galileo_3D.zip
# Get old Blender
wget https://download.blender.org/release/Blender2.79/blender-2.79b-linux-glibc219-x86_64.tar.bz2
tar xf blender-2.79b-linux-glibc219-x86_64.tar.bz2
cd blender-2.79b-linux-glibc219-x86_64
./blender
```
Blender creates a new file on launch.
2022-05-21 12:39:21 -06:00
2022-05-21 01:30:30 -06:00
Go to `File --> Import --> Wavefront (.obj)`.
2022-05-21 12:39:21 -06:00
2022-05-21 01:30:30 -06:00
Import the file, such as `galileo.obj`.
2022-05-21 12:39:21 -06:00
2022-05-21 01:30:30 -06:00
Go to `File --> Export --> 3D Studio (.3ds)`.
2022-05-21 12:39:21 -06:00
2022-05-21 01:30:30 -06:00
Save the file, such as `galileo-gnss.3ds`.
2022-05-21 12:39:21 -06:00
The `galileo-gnss.3ds` file created this way didn't render in Celestia. `:(`
2022-05-21 20:32:46 -06:00
# Status
Alpha, under development.
2022-05-21 12:39:21 -06:00
Output works in Celestia. Orbits are not confirmed correct.
2022-05-20 22:54:55 -06:00
# License / Copyright
Upstream sources under their respective copyrights.
2022-05-20 22:54:55 -06:00
Copyright (C) 2022 Jeff Moe.
License: GPLv2 or any later version.