STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
fsw::control::ControllerLUT Class Reference

Controller LUT loader with multilinear interpolation. More...

#include <ControllerLUT.hpp>

Collaboration diagram for fsw::control::ControllerLUT:
[legend]

Classes

struct  Axis
struct  Output

Public Member Functions

 ControllerLUT ()=default
bool load (const std::string &path)
 Load LUT from binary file.
bool is_loaded () const
 True if a LUT is loaded and ready for evaluation.
bool evaluate (const std::map< std::string, double > &point, std::map< std::string, double > &out) const
 Evaluate LUT at the given point.

Private Attributes

std::vector< Axis > axes_
std::vector< Output > outputs_

Detailed Description

Controller LUT loader with multilinear interpolation.

Loads binary LUT exported by scripts/controller_lut/export_lut_for_fsw.py. Used to bypass DDP and output optimal control (u_safe_F, u_safe_O or duty_F, duty_O) for boolean solenoid actuation.

Definition at line 19 of file ControllerLUT.hpp.

Constructor & Destructor Documentation

◆ ControllerLUT()

fsw::control::ControllerLUT::ControllerLUT ( )
default

Member Function Documentation

◆ evaluate()

bool fsw::control::ControllerLUT::evaluate ( const std::map< std::string, double > & point,
std::map< std::string, double > & out ) const

Evaluate LUT at the given point.

Parameters
pointMap from axis name -> value (e.g. P_u_fuel, P_u_ox, thrust_desired)
outMap from output name -> interpolated value (e.g. u_safe_F, u_safe_O, duty_F, duty_O)
Returns
true if evaluation succeeded

Definition at line 104 of file ControllerLUT.cpp.

References axes_, outputs_, and result.

Referenced by engine.core.runner.PintleEngineRunner::evaluate_arrays().

◆ is_loaded()

bool fsw::control::ControllerLUT::is_loaded ( ) const
inline

True if a LUT is loaded and ready for evaluation.

Definition at line 27 of file ControllerLUT.hpp.

References axes_.

◆ load()

bool fsw::control::ControllerLUT::load ( const std::string & path)

Load LUT from binary file.

Returns false on error.

Definition at line 21 of file ControllerLUT.cpp.

References a, axes_, MAGIC, o, and outputs_.

Referenced by engine.layerx.measurements.MeasurementStore::get().

Member Data Documentation

◆ axes_

std::vector<Axis> fsw::control::ControllerLUT::axes_
private

Definition at line 52 of file ControllerLUT.hpp.

Referenced by evaluate(), is_loaded(), and load().

◆ outputs_

std::vector<Output> fsw::control::ControllerLUT::outputs_
private

Definition at line 53 of file ControllerLUT.hpp.

Referenced by evaluate(), and load().


The documentation for this class was generated from the following files: