LIRRA  1.0.0
Loading...
Searching...
No Matches
API Reference

The rl_stl package lives in src/rl_stl/. It keeps simulation, synthesis dynamics, STL, synthesis, policies and the supervisor in separate modules. The JAX-native parts (MuJoCo Playground, MJX, Brax, the proposer and the differentiable check) never call the host-side Gurobi solver from inside a batched, JIT-compiled loop.

Module Overview

rl_stl.synthesis: the synthesis program and the check

Module Description
istl.py Receding fixed-horizon interval-STL synthesis (NAHS (16)) with Gurobi: RecedingProblem, History, persistent models per first window (RecedingISTL, ISTLCache)
check.py Independent check of a candidate plan against the receding I-STL constraints: check_plan, interval_robustness, precompiled windows for a fast runtime check
terminal.py Verified control-invariant terminal sets: polygon algebra, pre_set, max_control_invariant, verify_invariant, patrol_terminal_set
tube.py Error tubes: disturbance_tube for \(e^+ = (A + BK)e + Gw\), constant_tube for the NAHS-style constant box
common.py Shared Gurobi environment and the solver status enum

rl_stl.supervisor: the runtime loop

Module Description
receding.py RecedingSupervisor: proposal, check, cached-plan execution and delay-compensated fallback. Plan holds the nominal plan with its root, error age and terminal face, extended past \(N\) by the terminal controller

rl_stl.policies: proposers and controllers

Module Description
segment.py Learned segment proposer: observation features, squash into the tightened input box, patrol_certificate (the differentiable margin \(c\), \(c \ge 0\) iff the plan passes the check), SegmentPolicy, LearnedProposer
nominal.py Nominal mission controller of the patrol: PD toward the current waypoint
ppo_checkpoint.py Config schema and policy loader for the X2 hover PPO runs

rl_stl.stl: specifications and robustness

Module Description
nahs.py Patrol task: the square S, formulas (24) and (25), receding window specification
robustness.py Independent STL robustness evaluation and online (prefix) interval semantics
jax_robustness.py Compiles stlpy formulas into jittable JAX robustness functions, plus the capped hinge penalty
specs.py STL specifications built with stlpy

rl_stl.dynamics: planning models \(f_{\mathrm{syn}}\)

Module Description
linear.py Discrete-time linear synthesis models (zero-order-hold double integrators) and helpers
quadrotor_fsyn.py Reduced-order synthesis model for the Skydio X2: 3-D double integrator

rl_stl.envs: simulation models \(f_{\mathrm{sim}}\)

Module Description
skydio_x2/model.py Skydio X2 simulation model from MuJoCo Menagerie
skydio_x2/ctbr.py Normalized collective-thrust-and-body-rate action interface: rate loop with gyroscopic feedforward, X-configuration allocation, prioritized desaturation
skydio_x2/tracker.py Outer-loop tracker from a planning-model reference (position, velocity, acceleration) to a CTBR action
skydio_x2/host_sim.py Host-side MuJoCo X2 simulation driven through the CTBR interface
skydio_x2/hover.py MuJoCo Playground (MJX/JAX) hover task for the X2
skydio_x2/frames.py Rotation and frame conventions
blimp/model.py MuJoCo blimp matched to the NAHS BlimpSim model, and its planning model
patrol_plan.py Planning-level patrol environment in pure JAX for PPO fine-tuning of the proposer

rl_stl.evaluation: benchmarks and measurement

Module Description
systems.py The three patrol benchmarks (double integrator, X2, blimp) behind one interface, and run_episode: the supervisor at the planning rate, the simulator below it
patrol.py Patrol experiment builders and the double-integrator closed loop
energy.py CPU energy measurement with Intel RAPL: EnergyMeter, benchmark

rl_stl.utils

Module Description
config.py YAML configuration files loaded into frozen dataclasses
provenance.py Run directories with resolved config, seeds, git revision, versions and hardware
device.py CPU/GPU switch for JAX, MJX and Brax
plotting.py Matplotlib defaults for publication figures (TrueType fonts, never Type 3)
render.py MuJoCo video helpers

Generated Documentation

Doxygen also extracts the docstrings of every module, class and function. Use the search box, or start from a package: synthesis, supervisor, policies, stl, dynamics, envs, evaluation.