Go to the documentation of this file.
7 int main(
int argc,
char *argv[]) {
24 printf(
"Allocate memory for the reference, state and controller structs...\n");
33 printf(
"Set some controller parameters, define dynamics and reference\n");
35 for (i = 0; i < 4 ; i++) commandm.
pData[i] = 0.0;
36 for (i = 0; i < 12 ; i++) filtermemm.
pData[i] = 0.0;
63 for (i = 0; i < 100; i++){
94 printf(
"Free allocated memory...\n");
100 free(filtermemm.
pData);
101 free(dutycyclem.
pData);
109 matrix_double_t Jm, iJm, Kwm, Cwm, Vim, y0m, y1m, y2m, y3m, commandm, filtermemm, dutycyclem;
114 printf(
"Allocate memory for the reference, state and controller structs...\n");
123 printf(
"Set some controller parameters, define dynamics and reference\n");
125 for (i = 0; i < 4 ; i++) commandm.
pData[i] = 0.0;
126 for (i = 0; i < 12 ; i++) filtermemm.
pData[i] = 0.0;
157 for ( i = 0; i < 3; i++ ) controller->
gain_ki[i] = 1.0;
173 for (i = 0; i < 100; i++){
221 printf(
"Free allocated memory...\n");
226 free(commandm.
pData);
227 free(filtermemm.
pData);
228 free(dutycyclem.
pData);
int update_attitude_FSF_SU2_robust(ref_state_qw_t *reference, dyn_state_qw_t *state, con_state_qw_fsf_t *controller)
Update using the continuous full state feedback (FSF) on SU(2)
void matrix_allocate(matrix_double_t *matrix, int numRows, int numCols)
Allocate memory for a matrix struct of given dimensions.
void matrix_zero(matrix_double_t *matrix)
Set all antries of a matrix to zero.
void cont_cross_product(matrix_double_t *inAm, matrix_double_t *inBm, matrix_double_t *outm)
Cross product operation, To be migrated to the cont_math stack.
int main(int argc, char *argv[])
Main program, facilitating memory checks and analysis of the code.
Matrix object used for all matrix manipulation.
void matrix_identity(matrix_double_t *matrix)
Set a square matrix to the identity matrix.
Reference signal structure for the attitude FSF on S(3) or SU(2)
Complete state of the attitude FSF on SO(3) or SU(2)
void matrix_set(matrix_double_t *mat, int row, int column, double value)
Set an entry of a matrix (irrespective of the used memory layout)
void matrix_define(matrix_double_t *matrix, int numRows, int numCols, double *data)
Define a matrix to use already allocated memory.
int update_attitude_references(matrix_double_t *commands, matrix_double_t *filterMemory, ref_state_qw_t *reference, double h)
Update the reference trajectory based on input commands.
Complete state of the attitude FOF on SO(3) or SU(2)
int update_attitude_FSF_SU2_discontinuous(ref_state_qw_t *reference, dyn_state_qw_t *state, con_state_qw_fsf_t *controller)
Update using the discontinuous full state feedback (FSF) on SU(2)
Dynamical states, assumed known in the attitude FSF on SO(3) or SU(2)
void example_attitude_FSF(void)
Example of how the attitude FSF controllers can be implemented.
int update_attitude_FSF_SU2_continuous(ref_state_qw_t *reference, dyn_state_qw_t *state, con_state_qw_fsf_t *controller)
Update using the continuous full state feedback (FSF) on SU(2)
int update_attitude_FSF_SO3_robust(ref_state_qw_t *reference, dyn_state_qw_t *state, con_state_qw_fsf_t *controller)
Update using the robust full state feedback (FSF) on SO(3)
int compute_power_distribution(con_state_qw_fsf_t *controller, matrix_double_t *dutyCycles)
Compute the desired rotor thrusts.
double globalDirections[9]
void example_attitude_FOF(void)
Example of how the attitude FOF controllers can be implemented.
int cont_normalize(matrix_double_t *vec)
Normalizes the vector.
int update_attitude_FOF_SO3_continuous_measurements(con_state_qw_fof_t *controller, matrix_double_t *y0m, matrix_double_t *y1m, matrix_double_t *y2m, matrix_double_t *y3m)
Help function used to update the measurements in the controller struct.
int update_attitude_FOF_SO3_continuous(ref_state_qw_t *reference, dyn_state_qw_t *state, con_state_qw_fof_t *controller, double dt)
Update using the continuous filtered outpot feedback (FOF) on SO(3)
int update_attitude_FSF_SO3_continuous(ref_state_qw_t *reference, dyn_state_qw_t *state, con_state_qw_fsf_t *controller)
Update using the continuous full state feedback (FSF) on SO(3)