ADCS.controller.saltro.saltro_controller module¶
SALTRO-based trajectory planning and tracking controller.
This module provides a controller wrapper around the saltro_py backend,
including:
trajectory planning over a J2000 time horizon,
conversion of ADCS goal definitions into SALTRO target arrays,
actuator-order remapping between Python and C++ conventions,
closed-loop trajectory tracking through the shared
Trajectorycontainer.
The implementation is designed to match the ADCS Controller interface while
delegating optimization to the SALTRO C++ backend.
- class ADCS.controller.saltro.saltro_controller.SALTRO(est_sat, planner_settings)[source]¶
Bases:
ControllerSALTRO trajectory planning and tracking controller.
This controller computes an optimized trajectory using the
saltro_pybackend and then tracks it via the sharedTrajectoryinterface.Relationship to ADCS framework¶
The class conforms to
Controllerand therefore integrates withADCS.simulate()using the standard controller hooks:calculate_trajectory()for planning,set_active_trajectory()for plan activation,find_u()for control evaluation at runtime.
Time and horizon model¶
Planning is performed over \([t_0, t_1]\) in J2000 centuries, where
\[t_1 = t_0 + T \cdot c_{\mathrm{sec}\rightarrow\mathrm{cent}},\]with duration \(T\) in seconds.
- param est_sat:
Estimated satellite model used for constraints and actuator definitions.
- type est_sat:
- param planner_settings:
SALTRO planner settings bundle.
- type planner_settings:
- calculate_trajectory(t_start, duration, x_0, os_0, goals, verbose=False)[source]¶
Compute an optimized trajectory using the SALTRO backend.
The method performs the following pipeline:
Build planner time grid in J2000 centuries.
Sample orbit and active goals at each grid point.
- Construct SALTRO target arrays:
quaternion targets \(q_{\mathrm{goal}} \in \mathbb{R}^{4\times N}\)
body boresight vectors \(b_{\mathrm{body}} \in \mathbb{R}^{3\times N}\)
Build C++ satellite model and call
saltro_py.trajOpt.- Reorder controls/gains from C++ actuator order (MTQ then RW) to
Python actuator order.
Return a
Trajectory.
Target encoding¶
Goals are expected in ADCS
to_refformat:Quaternion target: finite
[q0, q1, q2, q3].Vector target:
[nan, x, y, z].
- param t_start:
Planning start time in J2000 centuries.
- type t_start:
float
- param duration:
Planning horizon duration in seconds.
- type duration:
float
- param x_0:
Initial state vector.
- type x_0:
numpy.ndarray
- param os_0:
Initial orbital state.
- type os_0:
- param goals:
Goal timeline used for target generation.
- type goals:
GoalList- param verbose:
Enable planner progress prints.
- type verbose:
bool
- return:
Planned trajectory with states, controls, and gains.
- rtype:
- raises ValueError:
If pass configuration or target format is invalid.
- raises RuntimeError:
If SALTRO optimization fails.
- raises ImportError:
If
saltro_pycannot be imported.
- Parameters:
t_start (float)
duration (float)
x_0 (ndarray)
os_0 (Orbital_State)
goals (GoalList)
verbose (bool)
- Return type:
- find_u(x_hat, sens, est_sat, os_hat, goal=None, **kwargs)[source]¶
Compute control input from the active trajectory at current time.
The control command is generated by evaluating trajectory tracking at \(t = \mathrm{os\_hat.J2000}\):
\[u(t) = u_\mathrm{traj}(t, x_{\hat{}}).\]- Parameters:
x_hat (numpy.ndarray) – Estimated state vector.
sens (numpy.ndarray) – Sensor vector (accepted for interface compatibility).
est_sat (
EstimatedSatellite) – Estimated satellite (accepted for interface compatibility).os_hat (
Orbital_State) – Orbital state carrying the current J2000 time.goal (typing.Optional[
Goal]) – Active goal (accepted for interface compatibility).
- Returns:
Control vector in Python actuator ordering.
- Return type:
numpy.ndarray
- Raises:
RuntimeError – If no active trajectory is set or time is outside trajectory validity interval.
- set_active_trajectory(traj)[source]¶
Set the trajectory used by
find_u()for runtime tracking.- Parameters:
traj (
Trajectory) – Active trajectory object containing times, states, controls, and gains.- Returns:
None
- Return type:
None
- Parameters:
est_sat (EstimatedSatellite)
planner_settings (PlannerSettings)