|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | ControllerInitRequest |
| class | MeasurementRequest |
| class | NavStateRequest |
| class | CommandRequest |
| class | ControllerStepRequest |
| class | ControllerSimulateRequest |
| class | Layer2ControllerSimulateRequest |
| class | Layer2ConfigSimulateRequest |
Variables | |
| router = APIRouter(prefix="/api/control", tags=["control"]) | |
| _log = logging.getLogger(__name__) | |
| _PROJECT_ROOT = Path(__file__).resolve().parents[2] | |
| str | _CONFIGS_DIR = _PROJECT_ROOT / "configs" |
Controller endpoints for robust DDP thrust control.
|
protected |
``path`` (relative to ``base``) resolved, if it is a .yaml file under one of ``roots``; else 400/404.
Definition at line 48 of file control.py.
Referenced by _init_controller(), _simulate_from_layer2_config(), and simulate_from_layer2_config_stream().
|
protected |
Definition at line 321 of file control.py.
|
protected |
Definition at line 44 of file control.py.
Referenced by _simulate_from_layer2_config(), and simulate_from_layer2_config_stream().
|
protected |
A new controller for this session, reset; called through run_compute (under the lock).
Definition at line 73 of file control.py.
|
protected |
Definition at line 279 of file control.py.
References _confined_yaml(), and convert_numpy().
|
protected |
Definition at line 433 of file control.py.
References convert_numpy(), and max.
|
protected |
Definition at line 1172 of file control.py.
References _confined_yaml(), _engine_config_roots(), and _simulate_layer2_controller().
|
protected |
Definition at line 706 of file control.py.
References convert_numpy(), and max.
Referenced by _simulate_from_layer2_config().
| backend.routers.control.controller_step | ( | ControllerStepRequest | request, |
| UserSession | session = Depends(get_session) ) |
Execute one controller step. Off the event loop, one at a time per session: see "Off the loop" at the top.
Definition at line 313 of file control.py.
| backend.routers.control.convert_numpy | ( | obj | ) |
Recursively convert numpy types to Python native types, handling NaN and Inf.
Definition at line 99 of file control.py.
References convert_numpy().
Referenced by _init_controller(), _simulate_controller(), _simulate_layer2_controller(), convert_numpy(), get_controller_status(), simulate_from_layer2_config_stream(), simulate_layer2_controller_stream(), and upload_config_and_simulate().
| backend.routers.control.get_controller_status | ( | UserSession | session = Depends(get_session) | ) |
Get current controller status.
Definition at line 1790 of file control.py.
References convert_numpy().
| backend.routers.control.init_controller | ( | ControllerInitRequest | request, |
| UserSession | session = Depends(get_session) ) |
Initialize the robust DDP controller. Off the event loop, one at a time per session: see "Off the loop" at the top.
Definition at line 271 of file control.py.
| backend.routers.control.reset_controller | ( | UserSession | session = Depends(get_session) | ) |
Reset controller state.
Definition at line 688 of file control.py.
| backend.routers.control.safe_float | ( | val | ) |
Convert value to float, replacing NaN/Inf with None.
Definition at line 86 of file control.py.
Referenced by simulate_from_layer2_config_stream(), simulate_layer2_controller_stream(), and upload_config_and_simulate().
| backend.routers.control.simulate_controller | ( | ControllerSimulateRequest | request, |
| UserSession | session = Depends(get_session) ) |
Simulate controller over a time series. Off the event loop, one at a time per session: see "Off the loop" at the top.
Definition at line 425 of file control.py.
| backend.routers.control.simulate_from_layer2_config | ( | Layer2ConfigSimulateRequest | request, |
| UserSession | session = Depends(get_session) ) |
Run controller simulation from a Layer 2 config file by extracting thrust curve. Off the event loop, one at a time per session: see "Off the loop" at the top.
Definition at line 1164 of file control.py.
| backend.routers.control.simulate_from_layer2_config_stream | ( | Layer2ConfigSimulateRequest | request, |
| UserSession | session = Depends(get_session) ) |
Stream controller simulation from a Layer 2 config file in real-time.
Definition at line 1272 of file control.py.
References _confined_yaml(), _engine_config_roots(), convert_numpy(), max, and safe_float().
| backend.routers.control.simulate_layer2_controller | ( | Layer2ControllerSimulateRequest | request, |
| UserSession | session = Depends(get_session) ) |
Run controller simulation using Layer 2 optimized thrust curve as reference. Off the event loop, one at a time per session: see "Off the loop" at the top.
Definition at line 698 of file control.py.
| backend.routers.control.simulate_layer2_controller_stream | ( | Layer2ControllerSimulateRequest | request, |
| UserSession | session = Depends(get_session) ) |
Stream controller simulation in real-time using Layer 2 optimized thrust curve.
Definition at line 947 of file control.py.
References convert_numpy(), max, and safe_float().
| backend.routers.control.upload_config_and_simulate | ( | UploadFile | file = File(...), |
| float | dt = 0.01, | ||
| UserSession | session = Depends(get_session) ) |
Upload a Layer 2 config file and immediately run controller simulation.
Definition at line 1552 of file control.py.
References convert_numpy(), max, and safe_float().
|
protected |
Definition at line 41 of file control.py.
|
protected |
Definition at line 32 of file control.py.
|
protected |
Definition at line 40 of file control.py.
| backend.routers.control.router = APIRouter(prefix="/api/control", tags=["control"]) |
Definition at line 31 of file control.py.