BenDB3199 / Attitude_from_quaternions

The code takes in quaternions and a timestamp along with TLE data from the OPS-SAT and outputs satellite attitude information like roll, pitch, yaw and angle to nadir.
0 stars 0 forks source link

Remove dependency with the Skyfield package #7

Closed georgeslabreche closed 3 years ago

georgeslabreche commented 3 years ago

Skyfield dependency is too large. Replace the dependency with something more lightweight.

We have the ephem package installed, you can calculate stuff with it using the TLE file we have on board: https://pypi.org/project/ephem/

WE also have the sgp4 package ready to be uplinked and installed but we have yet to follow through with it: https://pypi.org/project/sgp4/

With the sgp4 package we can project the spacecraft's position and velocity, this is also achieved by using the TLE file as a reference. It works great but the only reason we have not uplinked it yet is because we wanted to make sure this was not something that can already be achieved with the ephem package. Maybe this is something you'd like to investigate further?

BenDB3199 commented 3 years ago

For calculating the nadir vector the ephem package is sufficient. Therefore the skyfield dependency is removed. But I can not find a function that has anything to do with calculating the velocity. For calculating the velocity we would either need to take two positions and calculate the velocity via distance/time or derive it from the TLE ourselves. For the second option, we could have a look at the source code of the sgp4 package and just copy the functions we need. What do you think?

georgeslabreche commented 3 years ago

@BenDB3199 why copy the source code and not just use the sgp4 package directly?

Also, if you don't tag me in these comments then I don't get a notification and will miss them!

BenDB3199 commented 3 years ago

@georgeslabreche I think we already talked about this via E-Mail. We will just use the spg4 package. The comment was primarily me thinking about possible alternatives but as the spg4 package poses no problem, all those alternatives are simply worse.