COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
sutra_controller_generic_linear< Tcomp, Tout > Class Template Reference

this class provides the controller_generic features to COMPASS More...

#include <sutra_controller_generic_linear.h>

Inheritance diagram for sutra_controller_generic_linear< Tcomp, Tout >:
Collaboration diagram for sutra_controller_generic_linear< Tcomp, Tout >:

Public Member Functions

bool polc ()
 
bool modal ()
 
int n_slope_buffers ()
 
int n_states ()
 
int n_state_buffers ()
 
int n_modes ()
 
int n_iir_in ()
 
int n_iir_out ()
 
 sutra_controller_generic_linear ()=delete
 
 sutra_controller_generic_linear (CarmaContext *context, int nslope, int nslopes_buffers, int nactu, int nstates, int nstates_buffers, int nmodes, int niir_in, int niir_out, float delay, bool polc, bool is_modal, SutraDms *dms, int *idx_dms, int ndm, int *idx_centro, int ncentro)
 
 ~sutra_controller_generic_linear ()
 
string get_type ()
 
string get_commandlaw ()
 
int set_matA (float *A, int i)
 
int set_matL (float *L, int i)
 
int set_matK (float *K)
 
int set_matD (float *D)
 
int set_matF (float *F)
 
int set_iir_a (float *iir_a, int i)
 
int set_iir_b (float *iir_b, int i)
 
int set_polc (bool p)
 
int comp_polc ()
 
int comp_com ()
 !!! YOU MUST set d_centroids before calling it!!!! More...
 
int recursion ()
 
int innovation ()
 
int modal_projection ()
 
int filter_iir_in ()
 
int filter_iir_out ()
 
- Public Member Functions inherited from SutraController< Tcomp, Tout >
 SutraController (CarmaContext *context, int nslope, int nactu, float delay, SutraDms *dms, int *idx_dms, int ndm, int *idx_centro, int ncentro)
 
virtual ~SutraController ()
 
int nactu ()
 
int nslope ()
 
cublasHandle_t cublas_handle ()
 
void init_voltage ()
 
int set_centroids_ref (Tcomp *centroids_ref)
 
int add_perturb_voltage (string name, float *perturb, int N)
 
int set_perturb_voltage (string name, float *perturb, int N)
 
int remove_perturb_voltage (string name)
 
int reset_perturb_voltage ()
 
int enable_perturb_voltage (string name)
 
int disable_perturb_voltage (string name)
 
int set_com (float *com, int nElem)
 
int set_open_loop (int open_loop_status, bool rst=true)
 
int clip_commands ()
 
int comp_voltage ()
 
int comp_latency ()
 
int set_delay (float delay)
 
int set_volt_min (float volt_min)
 
int set_volt_max (float volt_max)
 
int set_val_max (float val_max)
 
int set_gain (float gain)
 
int reset_coms ()
 
int command_delay ()
 
int add_perturb ()
 
int comp_polc (CarmaObj< Tcomp > &sk, CarmaObj< Tcomp > &iMat, CarmaObj< Tcomp > &ol_meas)
 Compute the open loop measurements and effective commands. More...
 

Public Attributes

std::unique_ptr< CarmaObj< Tcomp > > d_x_now
 vector used for state calcs More...
 
std::unique_ptr< CarmaObj< Tcomp > > d_s_now
 vector used for slope calcs More...
 
std::unique_ptr< CarmaObj< Tcomp > > d_u_now
 vector used for modal calcs More...
 
std::deque< CarmaObj< Tcomp > * > d_circular_x
 circ buffer states More...
 
std::deque< CarmaObj< Tcomp > * > d_circular_s
 circ buffer slopes More...
 
std::deque< CarmaObj< Tcomp > * > d_circular_u_in
 circ buffer iir inputs More...
 
std::deque< CarmaObj< Tcomp > * > d_circular_u_out
 circ buffer iir output More...
 
std::vector< CarmaObj< Tcomp > * > d_matA
 list of A matrices (recursions) More...
 
std::vector< CarmaObj< Tcomp > * > d_matL
 list of L matrices (innovations) More...
 
std::unique_ptr< CarmaObj< Tcomp > > d_matK
 K matrix (state to modes) More...
 
std::unique_ptr< CarmaObj< Tcomp > > d_matD
 D matrix (interaction matrix) More...
 
std::unique_ptr< CarmaObj< Tcomp > > d_matF
 F matrix (mode to actu) More...
 
std::vector< CarmaObj< Tcomp > * > d_iir_a
 list of iir 'a' vectors (outputs) More...
 
std::vector< CarmaObj< Tcomp > * > d_iir_b
 list of iir 'b' vectors (inputs) More...
 
- Public Attributes inherited from SutraController< Tcomp, Tout >
CarmaContextcurrent_context
 
int device
 
int open_loop
 
Tcomp delay
 
Tcomp gain
 
float volt_min
 
float volt_max
 
int nactus
 
int nslopes
 
Tout val_max
 
Tcomp a
 
Tcomp b
 
Tcomp c
 
vector< SutraDm * > d_dmseen
 
CarmaObj< Tcomp > * d_centroids
 
CarmaObj< Tcomp > * d_centroids_padded
 
CarmaObj< Tcomp > * d_com
 
CarmaObj< Tcomp > * d_com_padded
 
CarmaObj< Tcomp > * d_com_clipped
 
CarmaObj< Tout > * d_voltage
 
CarmaObj< Tcomp > * d_com1
 
vector< int > centro_idx
 
std::deque< CarmaObj< Tcomp > * > d_circular_coms
 
map< string, tuple< CarmaObj< Tcomp > *, int, bool > > d_perturb_map
 
cudaStream_t mainStream
 

Additional Inherited Members

- Protected Attributes inherited from SutraController< Tcomp, Tout >
mutex comp_voltage_mutex
 

Detailed Description

template<typename Tcomp, typename Tout>
class sutra_controller_generic_linear< Tcomp, Tout >

this class provides the controller_generic features to COMPASS

Author
COMPASS Team https://github.com/ANR-COMPASS
Version
5.4.4
Date
2022/01/24

Definition at line 26 of file sutra_controller_generic_linear.h.

Constructor & Destructor Documentation

◆ sutra_controller_generic_linear() [1/2]

template<typename Tcomp , typename Tout >
sutra_controller_generic_linear< Tcomp, Tout >::sutra_controller_generic_linear ( )
delete

◆ sutra_controller_generic_linear() [2/2]

template<typename Tcomp , typename Tout >
sutra_controller_generic_linear< Tcomp, Tout >::sutra_controller_generic_linear ( CarmaContext context,
int  nslope,
int  nslopes_buffers,
int  nactu,
int  nstates,
int  nstates_buffers,
int  nmodes,
int  niir_in,
int  niir_out,
float  delay,
bool  polc,
bool  is_modal,
SutraDms dms,
int *  idx_dms,
int  ndm,
int *  idx_centro,
int  ncentro 
)

◆ ~sutra_controller_generic_linear()

template<typename Tcomp , typename Tout >
sutra_controller_generic_linear< Tcomp, Tout >::~sutra_controller_generic_linear ( )

Member Function Documentation

◆ comp_com()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::comp_com ( )
virtual

!!! YOU MUST set d_centroids before calling it!!!!

Implements SutraController< Tcomp, Tout >.

◆ comp_polc()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::comp_polc ( )

◆ filter_iir_in()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::filter_iir_in ( )

◆ filter_iir_out()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::filter_iir_out ( )

◆ get_commandlaw()

template<typename Tcomp , typename Tout >
string sutra_controller_generic_linear< Tcomp, Tout >::get_commandlaw ( )

◆ get_type()

template<typename Tcomp , typename Tout >
string sutra_controller_generic_linear< Tcomp, Tout >::get_type ( )
virtual

◆ innovation()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::innovation ( )

◆ modal()

template<typename Tcomp , typename Tout >
bool sutra_controller_generic_linear< Tcomp, Tout >::modal ( )

Definition at line 50 of file sutra_controller_generic_linear.h.

◆ modal_projection()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::modal_projection ( )

◆ n_iir_in()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::n_iir_in ( )

Definition at line 55 of file sutra_controller_generic_linear.h.

◆ n_iir_out()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::n_iir_out ( )

Definition at line 56 of file sutra_controller_generic_linear.h.

◆ n_modes()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::n_modes ( )

Definition at line 54 of file sutra_controller_generic_linear.h.

◆ n_slope_buffers()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::n_slope_buffers ( )

Definition at line 51 of file sutra_controller_generic_linear.h.

◆ n_state_buffers()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::n_state_buffers ( )

Definition at line 53 of file sutra_controller_generic_linear.h.

◆ n_states()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::n_states ( )

Definition at line 52 of file sutra_controller_generic_linear.h.

◆ polc()

template<typename Tcomp , typename Tout >
bool sutra_controller_generic_linear< Tcomp, Tout >::polc ( )

Definition at line 49 of file sutra_controller_generic_linear.h.

◆ recursion()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::recursion ( )

◆ set_iir_a()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::set_iir_a ( float *  iir_a,
int  i 
)

◆ set_iir_b()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::set_iir_b ( float *  iir_b,
int  i 
)

◆ set_matA()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::set_matA ( float *  A,
int  i 
)

◆ set_matD()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::set_matD ( float *  D)

◆ set_matF()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::set_matF ( float *  F)

◆ set_matK()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::set_matK ( float *  K)

◆ set_matL()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::set_matL ( float *  L,
int  i 
)

◆ set_polc()

template<typename Tcomp , typename Tout >
int sutra_controller_generic_linear< Tcomp, Tout >::set_polc ( bool  p)

Member Data Documentation

◆ d_circular_s

template<typename Tcomp , typename Tout >
std::deque<CarmaObj<Tcomp> *> sutra_controller_generic_linear< Tcomp, Tout >::d_circular_s

circ buffer slopes

Definition at line 63 of file sutra_controller_generic_linear.h.

◆ d_circular_u_in

template<typename Tcomp , typename Tout >
std::deque<CarmaObj<Tcomp> *> sutra_controller_generic_linear< Tcomp, Tout >::d_circular_u_in

circ buffer iir inputs

Definition at line 64 of file sutra_controller_generic_linear.h.

◆ d_circular_u_out

template<typename Tcomp , typename Tout >
std::deque<CarmaObj<Tcomp> *> sutra_controller_generic_linear< Tcomp, Tout >::d_circular_u_out

circ buffer iir output

Definition at line 65 of file sutra_controller_generic_linear.h.

◆ d_circular_x

template<typename Tcomp , typename Tout >
std::deque<CarmaObj<Tcomp> *> sutra_controller_generic_linear< Tcomp, Tout >::d_circular_x

circ buffer states

Definition at line 62 of file sutra_controller_generic_linear.h.

◆ d_iir_a

template<typename Tcomp , typename Tout >
std::vector<CarmaObj<Tcomp>*> sutra_controller_generic_linear< Tcomp, Tout >::d_iir_a

list of iir 'a' vectors (outputs)

Definition at line 73 of file sutra_controller_generic_linear.h.

◆ d_iir_b

template<typename Tcomp , typename Tout >
std::vector<CarmaObj<Tcomp>*> sutra_controller_generic_linear< Tcomp, Tout >::d_iir_b

list of iir 'b' vectors (inputs)

Definition at line 74 of file sutra_controller_generic_linear.h.

◆ d_matA

template<typename Tcomp , typename Tout >
std::vector<CarmaObj<Tcomp>*> sutra_controller_generic_linear< Tcomp, Tout >::d_matA

list of A matrices (recursions)

Definition at line 67 of file sutra_controller_generic_linear.h.

◆ d_matD

template<typename Tcomp , typename Tout >
std::unique_ptr<CarmaObj<Tcomp> > sutra_controller_generic_linear< Tcomp, Tout >::d_matD

D matrix (interaction matrix)

Definition at line 70 of file sutra_controller_generic_linear.h.

◆ d_matF

template<typename Tcomp , typename Tout >
std::unique_ptr<CarmaObj<Tcomp> > sutra_controller_generic_linear< Tcomp, Tout >::d_matF

F matrix (mode to actu)

Definition at line 71 of file sutra_controller_generic_linear.h.

◆ d_matK

template<typename Tcomp , typename Tout >
std::unique_ptr<CarmaObj<Tcomp> > sutra_controller_generic_linear< Tcomp, Tout >::d_matK

K matrix (state to modes)

Definition at line 69 of file sutra_controller_generic_linear.h.

◆ d_matL

template<typename Tcomp , typename Tout >
std::vector<CarmaObj<Tcomp>*> sutra_controller_generic_linear< Tcomp, Tout >::d_matL

list of L matrices (innovations)

Definition at line 68 of file sutra_controller_generic_linear.h.

◆ d_s_now

template<typename Tcomp , typename Tout >
std::unique_ptr<CarmaObj<Tcomp> > sutra_controller_generic_linear< Tcomp, Tout >::d_s_now

vector used for slope calcs

Definition at line 59 of file sutra_controller_generic_linear.h.

◆ d_u_now

template<typename Tcomp , typename Tout >
std::unique_ptr<CarmaObj<Tcomp> > sutra_controller_generic_linear< Tcomp, Tout >::d_u_now

vector used for modal calcs

Definition at line 60 of file sutra_controller_generic_linear.h.

◆ d_x_now

template<typename Tcomp , typename Tout >
std::unique_ptr<CarmaObj<Tcomp> > sutra_controller_generic_linear< Tcomp, Tout >::d_x_now

vector used for state calcs

Definition at line 58 of file sutra_controller_generic_linear.h.


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