Agent Controllers
CellularSheaves.ControlSheaves.AgentControllers.AgentState — Type
AgentState <: AbstractAgentStateHolds the current state vector x, an AbstractTikhonovFilter (either position or joint position/velocity), LQR gain K_lqr, discrete system matrices (Ad, Bd), and dynamics model dyn.
CellularSheaves.ControlSheaves.AgentControllers.PlanarQuadrotorDynamics — Type
PlanarQuadrotorDynamics <: AbstractAgentDynamics6D Planar Quadrotor dynamics. State x = [y, z, theta, ydot, zdot, theta_dot]
CellularSheaves.ControlSheaves.AgentControllers.QuadrotorDynamics — Type
QuadrotorDynamics <: AbstractAgentDynamics10D Quadrotor dynamics linearized around hover. State x = [x, y, z, phi, theta, xdot, ydot, zdot, phidot, theta_dot]
CellularSheaves.ControlSheaves.AgentControllers._default_initial_position — Method
_default_initial_position(dyn::AbstractAgentDynamics, i::Int) -> Vector{Float64}Default "airstrip" starting position for agent i when no explicit initial position is supplied: agents are lined up along the first position coordinate at a fixed spacing, at a common hover altitude (the last position coordinate). This is deliberately distinct from the target formation so that convergence into formation is visible in a simulation.
CellularSheaves.ControlSheaves.AgentControllers.initial_state — Method
initial_state(dyn::AbstractAgentDynamics, position::AbstractVector)
initial_state(dyn::AbstractAgentDynamics, position::AbstractVector, velocity::AbstractVector)
initial_state(dyn::AbstractAgentDynamics, position::AbstractVector, velocity::AbstractVector, acceleration::AbstractVector)Constructs a full state vector for dynamics model dyn starting at world position (length position_indices(dyn)), with velocity (length velocity_indices(dyn), defaults to rest) and acceleration (defaults to steady/zero). When acceleration is supplied, the initial attitude is trimmed using the same flat-output feedforward formula used by step_agent!, so agents seeded with the trajectory's initial acceleration start already banked into the turn instead of level.
CellularSheaves.ControlSheaves.AgentControllers.position_indices — Method
position_indices(dyn::QuadrotorDynamics) -> 1:3
position_indices(dyn::PlanarQuadrotorDynamics) -> 1:2Returns the position state indices in the full state vector for the given agent dynamics.
CellularSheaves.ControlSheaves.AgentControllers.solve_dare — Method
solve_dare(A, B, Q, R)Solves the Discrete Algebraic Riccati Equation for LQR gain.
CellularSheaves.ControlSheaves.AgentControllers.state_dim — Method
state_dim(dyn::QuadrotorDynamics) -> 10
state_dim(dyn::PlanarQuadrotorDynamics) -> 6Returns the full state vector dimension for the given agent dynamics.
CellularSheaves.ControlSheaves.AgentControllers.step_agent! — Method
step_agent!(w::AgentState, qstar_target::Vector{Float64}, dt::Float64)Steps standard feedback agent dynamics using position-only reference filtering.
CellularSheaves.ControlSheaves.AgentControllers.step_agent! — Method
step_agent!(w::AgentState, qstar_target::Vector{Float64}, qstar_dot_target::Vector{Float64}, dt::Float64)Steps feedback agent dynamics using joint reference position AND reference velocity filtering. Reference velocity is mapped into the state velocity components, eliminating tracking lag via standard LQR feedback.
CellularSheaves.ControlSheaves.AgentControllers.step_agent! — Method
step_agent!(w::AgentState, qstar_target::Vector{Float64}, qstar_dot_target::Vector{Float64}, qstar_ddot_target::Vector{Float64}, dt::Float64)Steps agent dynamics using position, velocity, and acceleration references. Calculates acceleration-based attitude references (pitch/roll angles) and feedforward thrust, enabling exact differential flatness trajectory tracking without lag.
CellularSheaves.ControlSheaves.AgentControllers.velocity_indices — Method
velocity_indices(dyn::QuadrotorDynamics) -> 6:8
velocity_indices(dyn::PlanarQuadrotorDynamics) -> 4:5Returns the velocity state indices in the full state vector for the given agent dynamics.