ADCS.CONOPS.goals.vector_goal module¶
- class ADCS.CONOPS.goals.vector_goal.Vector_Goal(boresight_name=None)[source]¶
Bases:
GoalAbstract base class for vector-alignment pointing goals.
This class specializes
Goalfor goals that align a specified spacecraft body-frame vector with a desired inertial-frame direction. Typical examples include aligning a sensor boresight with a target vector expressed in the ECI frame.Subclasses define a desired inertial direction \(\mathbf{v}_{\mathrm{ref}} \in \mathbb{R}^3\) as a function of the orbital state. The reference mapping takes the form
\[G_{\mathrm{vec}}(\mathcal{O}(t)) = \left( \mathbf{v}_{\mathrm{ref}}, \boldsymbol{\omega}_{\mathrm{ref}} \right)\]where \(\boldsymbol{\omega}_{\mathrm{ref}}\) is typically zero or defined by the subclass.
This class provides a common geometric error computation based on quaternion representations of vector alignment.
Subclasses must implement
to_ref().See also
Goal,Attitude_Goal- Parameters:
boresight_name (str | None)
- error(q, body_boresight, os0)[source]¶
Compute the vector-alignment attitude error.
Let \(\mathbf{v}_{b}\) be the normalized boresight vector expressed in the spacecraft body frame, and let \(\mathbf{v}_{\mathrm{ref}}\) be the desired inertial direction returned by
to_ref().The reference direction is transformed into the body frame using the direction cosine matrix derived from the current attitude quaternion \(\mathbf{q}\):
\[\mathbf{v}_{\mathrm{ref}}^{b} = \mathbf{R}(\mathbf{q})^{\mathsf{T}} \mathbf{v}_{\mathrm{ref}}\]A quaternion representing the shortest rotation that aligns \(\mathbf{v}_{b}\) with \(\mathbf{v}_{\mathrm{ref}}^{b}\) is then constructed.
For the nominal case, the error quaternion is
\[\begin{split}\mathbf{q}_{\mathrm{err}} = \frac{1}{\sqrt{2(1 + d)}} \begin{bmatrix} 1 + d \\ \mathbf{v}_{\mathrm{ref}}^{b} \times \mathbf{v}_{b} \end{bmatrix}\end{split}\]where
\[d = \mathbf{v}_{b}^{\mathsf{T}} \mathbf{v}_{\mathrm{ref}}^{b}\]In the singular case \(d \approx -1\), corresponding to a 180-degree misalignment, an arbitrary orthogonal rotation axis is selected.
The returned error vector is the vector part of the error quaternion, with sign chosen to enforce the shortest rotation.
- Parameters:
q (numpy.ndarray) – Current spacecraft attitude quaternion.
body_boresight (numpy.ndarray) – Boresight direction expressed in the spacecraft body frame.
os0 (Orbital_State) – Current orbital state.
- Returns:
Vector-alignment attitude error.
- Return type:
numpy.ndarray
- to_ref(os0)[source]¶
Generate a reference inertial direction and angular velocity.
Subclasses must implement this method to compute a desired inertial reference vector
\[\mathbf{v}_{\mathrm{ref}} \in \mathbb{R}^3\]based on the current orbital state. The returned vector is expected to be nonzero and will typically be normalized by the downstream error computation.
- Parameters:
os0 (Orbital_State) – Current orbital state.
- Returns:
Reference inertial direction and reference angular velocity.
- Return type:
Tuple[numpy.ndarray, numpy.ndarray]