LIRRA  1.0.0
Loading...
Searching...
No Matches
rl_stl.policies.nominal Namespace Reference

Classes

class  AxisPD
 
class  ClockReference
 
class  PatrolPD
 

Detailed Description

Nominal mission controller of the NAHS patrol: PD toward the current waypoint.

NAHS (`nominal_controller.py:80-93, 164-173`) flies a PD law toward the corners
``(0, r), (r, 0), (0, -r), (-r, 0)`` and switches to the next corner inside ``waypoint_tol``.
Straight legs between corners cut through ``S`` (the midpoint of the first leg is inside),
so the nominal mission violates the specification; the synthesis deviates from it
minimally. The same law, written on the synthesis model ``f_syn``, generates the nominal
reference ``(x_nom, u_nom)`` of every synthesis request and the mission reward of the learned
policy, in one of two forms:

* ``rerooted`` (:meth:`PatrolPD.rollout`): the PD law rolled out from the state the plan is
  rooted at, with the waypoint index advanced on the realised trajectory. Falling behind
  costs nothing, because the reference falls behind too, and the waypoint switch (after which
  the reference cuts through ``S``) happens only when the vehicle reaches the waypoint. A
  long-horizon learner minimises this cost by parking just outside the waypoint tolerance.
* ``clock`` (:class:`ClockReference`): the PD patrol rolled out once from the episode's
  initial state, indexed by absolute step. A plan rooted at step ``r`` tracks
  ``x_nom(r), .., x_nom(r + N)``, so falling behind keeps costing. Its inputs saturate at
  ``input_scale`` times the input bounds: a reference flown at the bounds leaves the planner no
  headroom to catch up after a detour around ``S``, and the phase lag then grows without
  bound (the blimp's PD patrol is saturated 91% of the time).

The controller is generic over axis blocks: for each patrol axis ``a`` (the two planar axes of
(24)/(25), or x, y, z for the cube specs) it commands ``u_a = clip(kp (p_ref_a - p_a) - kd v_a)``;
extra regulated axes (altitude, yaw) use the same law toward fixed set-points. Any number of
waypoints is cycled (4 for the square, 6 for the cube).