breve_core_controller — BreveCoreController (shared base-attitude/breve methods)
Purpose
The shared intermediate controller base that holds the methods base_controller and
breve_controller used to carry as byte-identical copies. The EE/arm leaves these methods call
are overridden per-subclass (Template Method), so one shared template yields both the base-only
diagnostic path and the full coordinated path. Extracted 2026-06-22 from a clone-detector finding,
proven byte-identical (all 5 baselinesmax_abs_diff = 0.000e+00).
Role in the system
extendscom_controller (CC_Controller, the per-step control loop +Γᵀforce map).- Parent of base_controller (
BaseController, base-only diagnostic) and breve_controller
(BreveController, the live workhorse) — the chain is nowCC_Controller → BreveCoreController → {Base, Breve}. - Not selected by
controller.nameand never instantiated alone — it has no__init__; both subclasses’
constructors setself.g,self.traj, dynamics, etc. before any shared method runs. - Dynamics (
Γ,M̆,C̆,s_min_G) come fromutils/robot.pyasself.dyn.*.
Inputs / Outputs
- In:
State(q, v, dynamics cache), baseDesired(CoM + base attitude), config gains,s_min_G. - Out: base reduced torque
τ_b⊕, the stacked task error/Jacobian (x̃,J_x), and the reduced
step-integration derivatives (omega_b_dot,nu_e_oplus_dot). The EE/arm specifics are delegated to the
subclass leaves (zero in base_controller, full in breve_controller).
Key methods
compute_tau_b_oplus— base attitude PD torque, derate-scaled + saturated —GNC/breve_core_controller.py:84all_control_terms— chainssuper()’s CoM terms + the breve step-integration derivatives —:97_apply_step_state_update— integrate(omega_b, nu_e_oplus)one step with saturation (chainssuper()) —:108conditioning_scale— the single γ ramp ons_min_G(Option A) —:80x_b_tilde/J_xb/x_b_tilde_dot— base attitude error, its Jacobian, its rate —:51/:62/:57x_tilde/J_x— stacked[base; EE]task error & 9×9 Jacobian (call the per-subclassx_e_rhs/J_xeleaves) —:68/:72v_breve_damping_error— stacked[omega_b_err; nu_e_err](calls the per-subclass damping leaves) —:76build_desired_for_step/_build_base_desired_for_step— base reference builder (the base path; breve_controller overridesbuild_desired_for_stepto add the EE goal) —:43/:38_loop_sync_uses_update_views— returnsFalse(vsCC_Controller’sTrue) for both subclasses —:34
Footguns
Editing here changes BOTH controllers — verify against all 5 baselines
Every method here is shared by base_controller and breve_controller. The 13 methods were moved
verbatim;validate_base_baseline.py+ the fourvalidate_ee_*reproduce atmax_abs_diff = 0.000e+00
(checked, not re-pinned — per GNC hard rules). Any logic change is a behaviour change to the whole
control chain. (generated_reports/GNC/controller_twin_extraction.md)
The EE/arm leaves are deliberately NOT defined here (Template Method)
x_e_rhs,J_xe,omega_b_damping_error,nu_e_damping_error,arm_breve_gains,rhs_feedforward,
v_breve_dot,RHS34b,calc_posture,reconstruct_generalized_velocityare the forks — each
subclass supplies its own (zeroed in Base, full in Breve). The shared methods call them viaself.*, so a
shared method’s behaviour IS the subclass’s. Do not add a default leaf here without checking both paths.
Never instantiated alone — no
__init__
BreveCoreControllerrelies on the subclass__init__having setself.g(gains),self.traj
(guidance), and the dynamics cache. Constructing it directly wouldAttributeErrorthe moment
compute_tau_b_oplusreadsself.g.base.K.
_loop_sync_uses_update_views = Falseis effectively inert in the loopBoth subclasses override
CC_Controller’sTruetoFalse, but_sync_loop_stateignores the flag in
the loop (it always refreshes dynamics + breve views). Kept here to preserve intent, not for a live effect.
Pseudocode (the shared template, one base-path step)
build_desired_for_step(t) → _build_base_desired_for_step(t) # base ref; Breve overrides to add the EE goal
τ_b⊕ = compute_tau_b_oplus(des) # attitude PD, γ-scaled, saturated
x̃ = x_tilde(des) = [x_b_tilde ; x_e_rhs] # x_e_rhs LEAF → 0 (Base) / full EE (Breve)
J_x = block9(J_xb, J_xe) # J_xe LEAF → 0 (Base) / full (Breve)
all_control_terms: super().CoM terms ; v̆_dot = v_breve_dot(st, des) # v_breve_dot LEAF (per-subclass)
step.omega_b_dot, step.nu_e_oplus_dot ← saturate(v̆_dot)
_apply_step_state_update: super() ; integrate (omega_b, nu_e_oplus) with saturation
Equations & references
Key equations mirrored from current_sota — the math source of truth; see there for derivations.
Compact base+EE control law (the shared all_control_terms form) — §4.2, eq (4.7):
Impedance-derate ramp (conditioning_scale) — §6.3, eq (6.4):
References:
- Coordinated control + working eq (§4.4–4.12): current_sota > 4.
- Singularity / derate stack (§6): current_sota > 6 · eq↔code in
generated_reports/GNC/cross_check.md. - Extraction rationale + byte-identity proof:
generated_reports/GNC/controller_twin_extraction.md.
Related
com_controller · base_controller · breve_controller · terminology · current_sota · circumcentroidal_control · speed_gain_derate