AerialVehicleControl.jl
cont_attitude_FOF_SO3_continuous.c File Reference
Include dependency graph for cont_attitude_FOF_SO3_continuous.c:

Go to the source code of this file.

Functions

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. More...
 
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) More...
 
int attitude_FOF_SO3_continuous_simulate_observer (matrix_double_t *Qm, matrix_double_t *Wm, matrix_double_t *deltaQm, matrix_double_t *deltaWm, double dt)
 Help function to simulate the attitude observer dynamics. More...
 
int attitude_FOF_SO3_continuous_cross_terms (matrix_double_t *YAm, matrix_double_t *YBm, matrix_double_t *gainm, matrix_double_t *outm)
 Help function used to compute the innovation terms in the controller. More...
 

Function Documentation

◆ attitude_FOF_SO3_continuous_cross_terms()

int attitude_FOF_SO3_continuous_cross_terms ( matrix_double_t YAm,
matrix_double_t YBm,
matrix_double_t gainm,
matrix_double_t outm 
)

Help function used to compute the innovation terms in the controller.

The gains are stored in an input array on the form gain = [k1,...,kN], and the directions are similarly stored as YA = [yA1,...,YAN], and YA = [yB1,...,YBN], and the function evaluate sthe weighted cross-product sum on the form.

out = sum_{i = 1}^N k_i * S(yAi) * yBi

where S(*) denotes the hat map on SO(3), while checking for dimensionality errors and verifying that the gains are postrictly positive.

Parameters
[in]YAm- Input directions (3xN) dimensional
[in]YBm- Input directions (3xN) dimensional
[in]gainm- Controller gains (1xN) dimensional
[out]outm- Function output,
Returns
status - 1 if successful, 0 otherwise

Definition at line 293 of file cont_attitude_FOF_SO3_continuous.c.

◆ attitude_FOF_SO3_continuous_simulate_observer()

int attitude_FOF_SO3_continuous_simulate_observer ( matrix_double_t Qm,
matrix_double_t Wm,
matrix_double_t deltaQm,
matrix_double_t deltaWm,
double  dt 
)

Help function to simulate the attitude observer dynamics.

d(Q)/dt = Q * [ deltaQ / 2 ]_{SU(2)}^{\^} d(W)/dt = deltaW

For simplicity, take a first order euler method and let

Q(t + dt) = Q(t) * expm(dt * [ deltaQ(t) / 2 ]_{SU(2)}^{\^}) W(t + dt) = W(t) + dt * deltaW(t)

Parameters
[in]Qm- Attitude configured on SU(2)
[in]Wm- Attitude rates configured on R^3
[in]deltaQm- Time derivative of the signal Qm (one parameter group, R^3)
[in]deltaWm- Time derivative of the signal Wm (on R^3)
[in]dt- Propagates the continuous time dynamics dt [s] ahead a first order euler method. This should eventually be replaced by a Crouch-Grossman method.
Returns
status - 1 if successful, 0 otherwise

Definition at line 245 of file cont_attitude_FOF_SO3_continuous.c.

◆ update_attitude_FOF_SO3_continuous()

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)

This function takes the states of the reference dynamics in "reference" structure, as well as the current states of the system in the "state" structure, and the controller settings/memory in the "controller" structure, and updates the torque fields in the controller for actuation, as well as the observer states and relevant distances based on this information.

Parameters
[in]reference- State of the reference dynamics
[in]state- State of the system dynamics
[in,out]controller- State of the controller, updated by the call
[in]dt- Time since the previous controller update [s]
Returns
status - 1 if successful, 0 otherwise

Definition at line 44 of file cont_attitude_FOF_SO3_continuous.c.

◆ update_attitude_FOF_SO3_continuous_measurements()

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.

This is only required when calling the function from Julia, where the structs are immutable, but for safety reasons, it is best to set the measurements using this function instead of direct manipulation of the controller struct memory.

Parameters
[in]controller- The Controlle robject
[in]y0m- Gyroscopic measurement
[in]y1m- Directional measurement, corresponding to v1
[in]y2m- Directional measurement, corresponding to v2
[in]y3m- Directional measurement, corresponding to v3
Returns
status - 1 if successful, 0 otherwise

Definition at line 10 of file cont_attitude_FOF_SO3_continuous.c.