StarSensor
class simulates a star sensor.- The
StarSensor
class calculates and returns the observed quaternions and error flags.
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
- Set the parameters in
star_sensor.ini
. - Create an instance by using the initialization function
InitStarSensor
- Use
Get*
function to get quaternion information.
- TBW
- 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.
- Check that Earth judgement is performed correctly
- 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
- 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.
- STT flag is always 1, since the angle
- 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.
- STT flag is always 0, since the angle
- 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.
- STT flag is always 0, since the angle
- The output result obtained by the default initial settings.
- The figure is generated by the Python script.