Index
AerialVehicles.SynthesizePolynomialTrajectory
AerialVehicles.build_initial_conditions
AerialVehicles.build_quad_dynamics
AerialVehicles.geometric_force_controller
AerialVehicles.quad_simulator
AerialVehicles.quadrotor_RtoQuat
AerialVehicles.quadrotor_dynamics!
AerialVehicles.run_quadrotor_sim
Docstrings
AerialVehicles
AerialVehicles.SynthesizePolynomialTrajectory
— MethodSynthesizePolynomialTrajectory(t, prx, pry, prz, pyaw, Ta)
Function to synthesize polynomial trajectories given optimal polynomial coefficients from JuliaSimControl
Arguments:
-t
: Current time -prx
: Optimal polynomial coefficients for x direction motion of the quadrotor -pry
: Optimal polynomial coefficients for y direction motion of the quadrotor -prz
: Optimal polynomial coefficients for z direction motion of the quadrotor -pryaw
: Optimal polynomial coefficients for yaw direction of the quadrotor -Ta
: Input array of time values to take between two waypoints
AerialVehicles.build_initial_conditions
— Methodx0_vec = build_initial_conditions(x, v, R, ω; quad_mtk = quad_mtk, func_sys = func_sys)
Takes the FunctionSystem and ODESystem for the Quadrotor and builds the initial conditions vector
Output:
-x0_vec
: Vector of initial conditions for the built model of the Quadrotor Input: -quad_mtk
: MTK ODESystem model of the quadrotor -func_sys
: JuliaSimControl FunctionSystem of the quadrotor dynamics -x
: Vector of the initial position of the Quadrotor -v
: Vector of the initial velocity of the Quadrotor -R
: Initial rotatiional matrix for orientation of the Quadrotor -ω
: Vector of the initial rotational velocity of the Quadrotor
AerialVehicles.build_quad_dynamics
— Methodfunc_sys,mtk_quad = build_quad_dynamics(QuadModel)
Takes the parameters of the Quadrotor model and builds the FunctionSystem and ODESystem for the Quadrotor
Output:
-func_sys
: JuliaSimControl FunctionSystem of the quadrotor dynamics -mtk_quad
: MTK ODESystem model of the quadrotor Input: -QuadModel
: Quadrotor Model struct
AerialVehicles.geometric_force_controller
— MethodT = geometric_force_controller(xdes, x, v, R, QuadModel, ControlGains)
Thrust generating feedback control function for Quadrotor
Output:
-T
: Thrust control Input: -xdes
: Desired state and derivatives (up to 3rd order) -x
: Position state vector -v
: Velocity state vector -R
: Rotational matrix orientation of the Quadrotor -QuadModel
: Quadrotor Model struct -ControlGains
: Control Gains struct
AerialVehicles.quad_simulator
— Methodquad_simulator(
time_arr,
x_arr,
y_arr,
z_arr,
quat_arr;
model = quad,
mat = carbon,
quad_scale = 0.5,
limit_scene = Rect(Vec3f(-0.1, -0.1, 0), Vec3f(0.5, 0.5, 0.5)),
)
Function to run animation of the simulation of the Quadrotor on GLMakie
Arguments:
-time_arr
: Time steps as an SparseArrays -x_arr
: x coordinates of the quadrotor for given timearr -`yarr: y coordinates of the quadrotor for given time_arr -
zarr`: z coordinates of the quadrotor for given timearr -quat_arr
: Array of quaternion orientations for quadrotor -model
: Model of quadrotor to be used (.stl or .obj files preferred) -mat
`: Matcap material for the model
AerialVehicles.quadrotor_RtoQuat
— Methodquadrotor_RtoQuat(R_arr)
Function to compute quaternion equivalent, given the rotation matrix of the Quadrotor Arguments: -R_arr
: Rotation matrix data of the Quadrotor
AerialVehicles.quadrotor_dynamics!
— Methodquadrotor_dynamics!(dxu, xu, p, t, func_sys)
Function to compute derivative of the state vector of the Quadrotor Arguments: -dxu
: Derivative of the combined state and control vector of the Quadrotor -xu
: Combined state and control vector of the Quadrotor -p
: Parameters of the Quadrotor -t
: Current time scalar -func_sys
: JuliaSimControl FunctionSystem of the quadrotor dynamics
AerialVehicles.run_quadrotor_sim
— Methodstate_arr = run_quadrotor_sim(
tn,
n,
x0_vec,
quad_sim::Function,
func_sys::FunctionSystem,
QuadModel,
GeometricControllers,
ControlGains,
generate_trajectory::Function,
)
Runs the simulation of the Quadrotor with trajectory optimizer and gives the values of the state vector at discrete time instants
Output:
-state_arr
: State vector at specified (tn) instances of time Input: -tn
: Discrete sample time -n
: Number of discrete time samples the Quadrotor is simulated -x0_vec
: Vector of initial conditions for the built model of the Quadrotor -quad_sim
: Function to compute derivative of the state vector of the Quadrotor