Specification for StarSensor class
1. Overview
1. functions
StarSensor
class simulates a star sensor.- The
StarSensor
class calculates and returns the observed quaternions and error flags.
2. files
star_sensor.cpp, star_sensor.hpp
: Definitions and declarations of the classstar_sensor.ini
: Initialization fileplot_star_sensor.py
: An example of a Python script to plot star sensor output
3. how to use
- Set the parameters in
star_sensor.ini
. - Create an instance by using the initialization function
InitStarSensor
- Use
Get*
function to get quaternion information.
2. Explanation of Algorithm
1. Update
- TBW
2. Judgement
1. EarthJudgement
- Calculate the angle $\theta_{ce}$ between the earth's center direction $\boldsymbol{r_{sc}}$ and the earth's edge direction $\boldsymbol{r_{se}}$. $R_e$ is the earth's radius.
- Calculate the angle $\theta_{es}$ between the sight direction $\boldsymbol{r_{sight}}$ and the earth's edge direction $\boldsymbol{r_{se}}$.
- Judge the STT error flag by comparing $\theta_{es}$ with the earth forbidden angle $\theta_{efa}$. If $\theta_{es} > \theta_{efa}$, the earth is completely outside the earth forbidden angle.
θce=arctan(|rse|Re)θcs=arccos(rse∗rsight)θes=θce−θcs
3. Results of verifications
1. verification of Earth judgement
1. overview
- Check that Earth judgement is performed correctly
2. conditions for the verification
- PropStepSec: 0.001
- StepTimeSec: 0.1
- EndTimeSec: 200
- Initial position [m] : [4.2164140100E+07,0,0]
- Initial velocity [m/s] : [0,3.074661E+03,0]
- ControlledAttitude
- main mode = EARTH_CENTER_POINTING: the pointing direction is determined by each case
- sub mode = SUN_POINTING: [0,0,1]
- STT quaternion from body frame to component frame: [0,0,0,1]
- Earth forbidden half-angle: 10deg
- The angle between the earth's center and edge direction: 8.6deg
3. results
- The angle between pointing direction and earth center = 15deg
- STT flag is always 1, since the angle $\theta_{es}$ between the sight direction and the earth's edge direction is 15 - 8.6 = 6.4deg < 10deg.
- The angle between pointing direction and earth center = 20deg
- STT flag is always 0, since the angle $\theta_{es}$ between the sight direction and the earth's edge direction is 20 - 8.6 = 11.4deg > 10deg.
- The angle between pointing direction and earth center = 30deg
- STT flag is always 0, since the angle $\theta_{es}$ between the sight direction and the earth's edge direction is 30 - 8.6 = 21.4deg > 10deg.
- The output result obtained by the default initial settings.
- The figure is generated by the Python script.