Add CBF-CLF-SOCP safety filters for the execution layer - #86
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
===========================================
+ Coverage 52.17% 62.47% +10.29%
===========================================
Files 76 86 +10
Lines 8475 9114 +639
===========================================
+ Hits 4422 5694 +1272
+ Misses 4053 3420 -633 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jpfairbanks
left a comment
There was a problem hiding this comment.
This is almost there. Just a few follow up questions and some type hierarchy redesign in the inline comments.
| @info "Building Documenter.jl docs" | ||
| makedocs( | ||
| modules=[CellularSheaves, CellularSheaves.ControlSheaves, CellularSheaves.ControlSheaves.Tikhonov, CellularSheaves.ControlSheaves.AgentControllers, CellularSheaves.ControlSheaves.DistributedLayeredControl, CellularSheaves.ControlSheaves.Layered, CellularSheaves.ControlSheaves.NestedSystems, CellularSheaves.ControlSheaves.NestedDSL, CellularSheaves.ControlSheaves.NestedDSL.NestedDSLTerm, CellularSheaves.ControlSheaves.NestedDSL.NestedDSLParser, CellularSheaves.ControlSheaves.NestedDSL.NestedDSLValidator, CellularSheaves.ControlSheaves.NestedDSL.NestedDSLLowering, CellularSheaves.ControlSheaves.MultiAgentTracking, CellularSheaves.ControlSheaves.MultiAgentTracking.QuadraticCosts, CellularSheaves.ControlSheaves.CoordinationBenchmarks, CellularSheaves.AsynchSheaves, CellularSheaves.SheafInterface, CellularSheaves.NetworkSheaves.EuclideanSheaves, CellularSheaves.NetworkSheaves.GraphHomomorphisms, CellularSheaves.NetworkSheaves.SheafMorphisms, CellularSheaves.NetworkSheaves.Pushforwards, CellularSheaves.NetworkSheaves.Pushouts, CellularSheaves.NetworkSheaves.CellularSheafParser, CellularSheaves.BlockSparseArrays, CellularSheaves.NetworkSheaves.PotentialSheaves, CellularSheaves.NetworkSheaves.TrajectorySheaves, CellularSheaves.NetworkSheaves.DistributedSolve, CellularSheaves.NetworkSheaves.Formations, CellularSheaves.ControlSheaves.TrackingDSL, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLTerm, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLParser, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLValidator, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLResolver, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLLowering, CellularSheaves.IPM], | ||
| modules=[CellularSheaves, CellularSheaves.ControlSheaves, CellularSheaves.ControlSheaves.Tikhonov, CellularSheaves.ControlSheaves.AgentControllers, CellularSheaves.ControlSheaves.SafetyFilters, CellularSheaves.ControlSheaves.DistributedLayeredControl, CellularSheaves.ControlSheaves.Layered, CellularSheaves.ControlSheaves.NestedSystems, CellularSheaves.ControlSheaves.NestedDSL, CellularSheaves.ControlSheaves.NestedDSL.NestedDSLTerm, CellularSheaves.ControlSheaves.NestedDSL.NestedDSLParser, CellularSheaves.ControlSheaves.NestedDSL.NestedDSLValidator, CellularSheaves.ControlSheaves.NestedDSL.NestedDSLLowering, CellularSheaves.ControlSheaves.MultiAgentTracking, CellularSheaves.ControlSheaves.MultiAgentTracking.QuadraticCosts, CellularSheaves.ControlSheaves.CoordinationBenchmarks, CellularSheaves.AsynchSheaves, CellularSheaves.SheafInterface, CellularSheaves.NetworkSheaves.EuclideanSheaves, CellularSheaves.NetworkSheaves.GraphHomomorphisms, CellularSheaves.NetworkSheaves.SheafMorphisms, CellularSheaves.NetworkSheaves.Pushforwards, CellularSheaves.NetworkSheaves.Pushouts, CellularSheaves.NetworkSheaves.CellularSheafParser, CellularSheaves.BlockSparseArrays, CellularSheaves.NetworkSheaves.PotentialSheaves, CellularSheaves.NetworkSheaves.TrajectorySheaves, CellularSheaves.NetworkSheaves.DistributedSolve, CellularSheaves.NetworkSheaves.Formations, CellularSheaves.ControlSheaves.TrackingDSL, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLTerm, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLParser, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLValidator, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLResolver, CellularSheaves.ControlSheaves.TrackingDSL.TrackingDSLLowering, CellularSheaves.IPM], |
There was a problem hiding this comment.
let's break this list into separate lines to make diffs easier to review.
| """ | ||
| CBFCLFParams(; kwargs...) | ||
|
|
||
| Tuning for the usual composition of one [`StabilityTerm`](@ref), one [`SafetyTerm`](@ref), |
There was a problem hiding this comment.
What happens for multiple agent formations where each agent needs to have multiple safety filters, one for each near-agent?
| `result.certified` is `false`, so a caller can count uncertified steps rather than silently | ||
| treating them as safe. Applications that must never apply an uncertified command should | ||
| inspect `result` and take their own fallback action. | ||
| """ |
| err isa InterruptException && rethrow() | ||
| nothing | ||
| end | ||
| end |
There was a problem hiding this comment.
I think the logic of the comment doesn't match the code. You are swallowing up all errors except for interrupt exceptions (which is how julia handles ^C and pkill)
| particular — but not for the horizontal axes of a quadrotor, where this error is still | ||
| raised. The remaining remedies are a reference governor, filtering the commanded | ||
| acceleration of a differentially flat parameterization, or a higher-order barrier. | ||
| """ |
There was a problem hiding this comment.
Do we have a solution for this that allows quadrotors? or can we do quadrotors with the braking barrier as long as we don't try to impose constraints on the angular components?
| B = vcat(zeros(n, n), Matrix{Float64}(I, n, n)) | ||
| eye = Matrix{Float64}(I, 2n, 2n) | ||
| return ControlAffineModel(x -> A * x, x -> B, eye[1:n, :], eye[(n + 1):(2n), :]) | ||
| end |
There was a problem hiding this comment.
This definitely needs another method where you specify the nonzero blocks of A and B. and the symplectic structure gets padded on there for you. This is the free double integrator on n position variables. There are no constraints on the motion, except that they be written in Darboux coordinates for R^2n.
It should create another subtype of AbstractControlAffine <: AbstractAgentDynamics.
We should have SingleIntegrator <: AbstractControlAffine and DoubleIntegrator <: AbstractControlAffine and AbstractControlAffine <: AbstractAgentDynamics
Adds a local CBF-CLF-SOCP safety filter (
ControlSheaves.SafetyFilters).docs/literate/layered/escort_cbf_clf.jlCellularSheaves.jlso ControlSheaves can see it, load-order only