LIRRA  1.0.0
Loading...
Searching...
No Matches
rl_stl.evaluation.systems Namespace Reference

Classes

class  BlimpPatrolConfig
 
class  BlimpSim
 
class  BlimpSystem
 
class  DISim
 
class  DISystem
 
class  X2PatrolConfig
 
class  X2Sim
 
class  X2System
 

Functions

np.ndarray _descriptor (str spec, float level_value, cfg)
 
PatrolTask _task (str spec, cfg, float altitude)
 
 _ring_position (rng, PatrolTask task, float|None r_lo=None, float|None r_hi=None)
 
 _start_velocity (rng, p, v_max)
 
 get_system (SystemName name, str spec="theta", bool nominal_predicates=False, **kw)
 
dict run_episode (system, PatrolSetup setup, sup, np.ndarray x0, float seconds, int seed, str|None disturbance=None)
 

Variables

 SystemName = Literal["di", "x2", "blimp"]
 

Detailed Description

The three patrol benchmarks behind one interface: double integrator, Skydio X2, blimp.

A :class:`PatrolSystem` provides

* ``build(level)``: the :class:`~rl_stl.evaluation.patrol.PatrolSetup` (``f_syn``, receding
  I-STL problem with verified terminal set, tube, nominal patrol) for one uncertainty level;
* ``descriptor(level)``: what the policy observes about the uncertainty (the disturbance bound
  ``w_bar`` for the double integrator, the tracking-tube radius ``eps`` for the MuJoCo
  vehicles), never the realised disturbance;
* ``make_sim(setup, seed)``: the closed loop below the planner. Each planning step it receives
  the cached plan's nominal ``(x_hat_k, u_hat_k)`` and the supervisor command and returns the
  next measured ``f_syn`` state.

Double integrator: ``f_sim = f_syn + B w`` with ``w`` inside ``W`` and feedback
``u = u_hat + K (x - x_hat)`` (tube from ``W`` and ``K``, the guarantee's assumption holds).
X2 and blimp: MuJoCo ``f_sim``; the low-level tracker follows the ZOH-interpolated nominal
between planning points, and the tube is a constant empirical box ``eps`` on the planar
position (NAHS's choice), so ``K = 0`` at the planning level. Whether the realised tracking
error stays inside ``eps`` is measured and reported, not assumed.

Cube specs (``theta_plus``, ``phi_plus``): the signal is the 3-D position, the patrol runs on x,
y and z through six waypoints, the tube box covers x, y and z, and the workspace is
``|p_i| <= 2.5`` m on every axis. The MuJoCo vehicles fly the cube centred at
``altitude_plus`` (2.75 m, so the lowest workspace point is 0.25 m above the floor). The X2's
z bounds are raised to its planar ones (z carries patrol legs); the blimp keeps its physical z
thrust bounds and z speed limit and patrols z with its altitude PD gains.

Uncertain-predicate specs (``*_u``): the same builds with interval face predicates (bounds
``pred_offset``, ``pred_rotation`` in each config, equal at every uncertainty level) and wider terminal
face sets. ``nominal_predicates`` (config field, or ``get_system(..., nominal_predicates=True)``) is the
ablation that plans and checks with the exact predicates. The descriptor of a ``_u`` spec appends
``(pred_offset, pred_rotation)`` to the tube/disturbance bound, so the policy observes every
uncertainty bound (constant across levels: the feature is 1 after the ``w / w_max`` scaling).

Function Documentation

◆ _descriptor()

np.ndarray rl_stl.evaluation.systems._descriptor ( str  spec,
float  level_value,
  cfg 
)
protected
Observed uncertainty bound: the level per signal axis, plus ``(pred_offset, pred_rotation)`` for the
``_u`` specs.

◆ _ring_position()

rl_stl.evaluation.systems._ring_position (   rng,
PatrolTask  task,
float | None   r_lo = None,
float | None   r_hi = None 
)
protected
Position at radius ``[r_lo, r_hi]`` from the centre of ``S``: on a ring (2-D) or, for the cube
specs, a spherical shell (direction uniform on the sphere).

◆ _start_velocity()

rl_stl.evaluation.systems._start_velocity (   rng,
  p,
  v_max 
)
protected

◆ _task()

PatrolTask rl_stl.evaluation.systems._task ( str  spec,
  cfg,
float  altitude 
)
protected

◆ get_system()

rl_stl.evaluation.systems.get_system ( SystemName  name,
str   spec = "theta",
bool   nominal_predicates = False,
**  kw 
)
``nominal_predicates``: ``_u`` spec ablation (plan and check with the exact nominal predicates).

◆ run_episode()

dict rl_stl.evaluation.systems.run_episode (   system,
PatrolSetup  setup,
  sup,
np.ndarray  x0,
float  seconds,
int  seed,
str | None   disturbance = None 
)
Closed loop: supervisor at the planning rate, ``make_sim`` below it.

Variable Documentation

◆ SystemName

rl_stl.evaluation.systems.SystemName = Literal["di", "x2", "blimp"]