Bart found out that the current definition, as used by U. Fechner and L. Fagiano is not well suited for control purposes.
You can find a different definition here: https://github.com/OpenSourceAWE/SymbolicAWEModels.jl/blob/v3-kite/examples/heading_gate.jl
The old definition should not be deleted so that results can be compared using both the old and the correct definitions.
The following code could be used as a starting point, but the nomenclature needs to be adapted:
"""Wind frame heading by projecting body x-axis onto wind-perpendicular plane."""
function wind_frame_heading(R_body_x, wind_vel)
wind_norm = wind_vel / norm(wind_vel)
minus_e_x = -R_body_x
proj_on_wind = dot(minus_e_x, wind_norm) * wind_norm
e_x_perp = minus_e_x - proj_on_wind
wind_cross_z = [wind_norm[2], -wind_norm[1], 0.0]
heading_x = dot(e_x_perp, wind_cross_zt
heading_z = e_x_perp[3]
heading = atan(heading_x, heading_z)
return heading
end
R_body_x is the x vector of the rotation matrix from the world to the body reference frame.
The world reference frame is the ENU reference frame.
wind_vel is the velocity vector of the wind in ENU reference frame under the assumption that the z component is zero.
Bart found out that the current definition, as used by U. Fechner and L. Fagiano is not well suited for control purposes.
You can find a different definition here: https://github.com/OpenSourceAWE/SymbolicAWEModels.jl/blob/v3-kite/examples/heading_gate.jl
The old definition should not be deleted so that results can be compared using both the old and the correct definitions.
The following code could be used as a starting point, but the nomenclature needs to be adapted:
R_body_xis the x vector of the rotation matrix from the world to the body reference frame.The world reference frame is the ENU reference frame.
wind_velis the velocity vector of the wind in ENU reference frame under the assumption that the z component is zero.