Source code for ADCS.CONOPS.goals.vector_goals.sun_goal
__all__ = ["Sun_Goal"]
import numpy as np
from typing import Tuple
from ADCS.CONOPS.goals import Vector_Goal
from ADCS.orbits.orbital_state import Orbital_State
from ADCS.helpers.math_helpers import normalize
[docs]
class Sun_Goal(Vector_Goal):
r"""
Sun-pointing vector goal.
This goal commands alignment with the spacecraft-to-Sun inertial direction
:math:`\mathbf{s}_{ECI}`:
.. math::
\hat{\mathbf{s}} = \frac{\mathbf{s}_{ECI}}{\|\mathbf{s}_{ECI}\|}, \qquad
\mathbf{r}_{goal} = \hat{\mathbf{s}}.
Over typical ADCS control horizons (seconds to hours), the Sun direction is treated
as inertially fixed, so the feed-forward reference angular velocity is set to zero:
.. math::
\boldsymbol{\omega}_{ref} = \mathbf{0}.
"""
[docs]
def to_ref(self, os0: Orbital_State) -> Tuple[np.ndarray, np.ndarray]:
sun_vec = os0.get_sun_eci()
sun_vec = normalize(sun_vec)
w_ref = np.zeros(3)
r_ref = np.empty((4,))
r_ref[0] = np.nan
r_ref[1:] = sun_vec
return r_ref, w_ref