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 Trajectory container.

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: Controller

SALTRO trajectory planning and tracking controller.

This controller computes an optimized trajectory using the saltro_py backend and then tracks it via the shared Trajectory interface.

Relationship to ADCS framework

The class conforms to Controller and therefore integrates with ADCS.simulate() using the standard controller hooks:

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:

EstimatedSatellite

param planner_settings:

SALTRO planner settings bundle.

type planner_settings:

PlannerSettings

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:

  1. Build planner time grid in J2000 centuries.

  2. Sample orbit and active goals at each grid point.

  3. 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}\)

  4. Build C++ satellite model and call saltro_py.trajOpt.

  5. Reorder controls/gains from C++ actuator order (MTQ then RW) to

    Python actuator order.

  6. Return a Trajectory.

Target encoding

Goals are expected in ADCS to_ref format:

  • 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:

Orbital_State

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:

Trajectory

raises ValueError:

If pass configuration or target format is invalid.

raises RuntimeError:

If SALTRO optimization fails.

raises ImportError:

If saltro_py cannot be imported.

Parameters:
Return type:

Trajectory

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: