Skip to main content

ConvexAdjointGradients

Struct ConvexAdjointGradients 

Source
pub struct ConvexAdjointGradients {
    pub objective: f64,
    pub d_q0: DVec,
    pub d_v0: DVec,
    pub d_ctrl: Vec<DVec>,
    pub d_inertia: Vec<[f64; 10]>,
    pub d_friction: f64,
    pub d_restitution: f64,
}
Expand description

Everything one unified backward pass produces.

Fields§

§objective: f64

The objective at the nominal rollout.

§d_q0: DVec

dJ/dq0 (length nq).

§d_v0: DVec

dJ/dv0 (length nv).

§d_ctrl: Vec<DVec>

dJ/du_t per step (each length nv).

§d_inertia: Vec<[f64; 10]>

dJ/dπ per body, canonical packing [m, cx, cy, cz, Ixx, Iyy, Izz, Ixy, Ixz, Iyz].

§d_friction: f64

dJ/dμ — the friction coefficient of ConvexContactRollout::material.

One scalar, not one per contact, because the rollout applies a single material to every body; this is the total derivative with respect to that shared coefficient.

Only sliding contacts contribute. A sticking contact sits strictly inside the cone, so moving the cone boundary does not move the solution, and a separating one carries no impulse. So a trajectory that never slips reports exactly 0 here — a real property of Coulomb friction rather than a missing term, and one a finite difference reproduces exactly.

§d_restitution: f64

dJ/de — the restitution coefficient of ConvexContactRollout::material, likewise a single shared scalar.

Zero for any trajectory whose contacts all approach below ContactSolverConfig::restitution_threshold, where the low-speed ramp has taken the effective restitution to zero — again a genuine flat region of the model, not an omission.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.