API Reference
This page lists the main APIs of Rible by functional module, auto-generated from docstrings.
Coordinates
Rible.add_joint_forces_jacobian! Function
add_joint_forces_jacobian!(jacobian, coords, ...)Get joint forces jacobian.
sourceRible.build_joint_cache Function
build_joint_cache(coords, ...)Build joint cache for coordinate system.
sourceRible.cartesian_frame2coords Method
Convert Cartesian frame to coordinates.
cartesian_frame2coords(coords, frame) -> Tuple{Any, Any}Rible.find_angular_velocity Method
Find angular velocity from coordinates and velocities.
find_angular_velocity(coords, q, q̇) -> AnyRible.find_independent_free_idx Method
find_independent_free_idx(coords, ...)Find independent free indices.
sourceRible.find_local_angular_velocity Method
find_local_angular_velocity(coords, q, q̇)Find local angular velocity from coordinates and velocities.
sourceRible.find_rotation Method
Find rotation matrix from coordinates.
find_rotation(coords, q) -> AnyRible.get_cstr_idx Method
Return the indices of intrinsic constraints for the given coordinates.
get_cstr_idx(coords) -> Vector{Int64}Rible.get_joint_jacobian! Function
get_joint_jacobian!(jacobian, coords, ...)Get joint constraint jacobian.
sourceRible.get_joint_velocity_jacobian! Function
get_joint_velocity_jacobian!(jacobian, coords, ...)Get joint velocity jacobian.
sourceRible.get_joint_violations! Function
get_joint_violations!(violations, coords, ...)Get joint constraint violations.
sourceRible.get_num_of_local_dims Method
Return the number of local dimensions.
get_num_of_local_dims(coords) -> AnyRible.kinetic_energy_coords Function
kinetic_energy_coords(coords, ...)Calculate kinetic energy from coordinates.
sourceRible.to_local_coords Method
Transform global coordinates to local coordinates.
to_local_coords(coords, r̄) -> AnyRible.to_position Method
Get position from coordinates and local parameters.
to_position(coords, q, c) -> AnyRible.to_position_jacobian Method
Get position Jacobian with respect to coordinates.
to_position_jacobian(coords, q, c) -> AnyRible.to_velocity_jacobian Method
Get velocity Jacobian with respect to coordinates and velocities.
to_velocity_jacobian(coords, q, q̇, c) -> AnyRible.CoordinatesState Type
Coordinates State Type.
mutable struct CoordinatesState{T, qT, sT, pT, cT} <: Rible.AbstractCoordinatesStateRible.PresFreeCoordinates Type
PresFreeCoordinates wrapper.
struct PresFreeCoordinates{N, T} <: Rible.AbstractCoordinates{N, T}Rible.PresFreeCoordinatesState Type
Nonminimal Coordinates State Type.
mutable struct PresFreeCoordinatesState{T, qT, qviewT, pT, sT} <: Rible.AbstractCoordinatesStateRible.get_free_idx Method
Return free indices of natural coordinates.
get_free_idx(nmcs, pres_idx) -> AnyRible.InnerContactCoordinatesState Type
ContactState Type.
struct InnerContactCoordinatesState{S<:Rible.AbstractCoordinatesState, CT} <: Rible.AbstractCoordinatesStateRible.MonoContactCoordinatesState Type
ContactState Type.
struct MonoContactCoordinatesState{S<:Rible.AbstractCoordinatesState, CT} <: Rible.AbstractCoordinatesStateRible.Anchor Type
Anchor — geometric attachment point for joints.
Holds the resolved position and axes for translation/rotation constraints, independent of loci indexing.
struct Anchor{bodyType, posType, trlAxesType, rotAxesType}body::Any: Bodyposition::Any: Position of the anchor in body-local frametrl_axes::Any: Translational constraint axesrot_axes::Any: Rotational constraint axes
Rible.Anchor Method
Anchor(body, position, axes)Direct geometry — same axes for translation and rotation.
sourceRible.Anchor Method
Anchor(body, position_pid::Integer, axes_pid::Integer)Resolve position and axes from potentially different loci.
sourceRible.Anchor Method
Anchor(body, pid::Integer)Construct from a single locus — position and axes all come from body.prop.loci[pid].
Rible.Anchor Method
Anchor(sig::Signifier)Bridge from a Signifier — resolve geometry from the locus it identifies.
sourceRible.Hen2Egg Type
Hen 2 Egg
struct Hen2Egg{henType, eggType}hen::Any: hen/parent/predecessoregg::Any: egg/child/successor
Rible.Signifier Type
Signifier — identity of a measurement point on a body.
Used by gauges/capta to index into body.state.loci_states[pid].
struct Signifier{bodyType}body::Any: Signifier of bodypid::Int64: Index of the locus
Rible.skew Method
skew(w::AbstractVector)Return the skew-symmetric matrix (also known as cross product matrix) corresponding to the 3D vector w.
The skew-symmetric matrix S satisfies S*v = w × v for any vector v, where × denotes the cross product.
Arguments
w::AbstractVector: A 3D vector [w₁, w₂, w₃]
Returns
A 3×3 skew-symmetric matrix of the form:
[ 0 -w₃ w₂] [ w₃ 0 -w₁] [-w₂ w₁ 0]
Rible.swapcols! Method
Swap two columns
swapcols!(X::AbstractMatrix, i::Integer, j::Integer)Rible.cartesian_to_angular_velocity Method
cartesian_to_angular_velocity(x, y, vx, vy)Computes angular velocity ω = dθ/dt given Cartesian position and velocity. Assumes θ = atan(y, x). Formula: ω = (x_vy - y_vx) / (x^2 + y^2)
sourceRible.NCF.NC Type
Natural Coordinates
N: dimension of space M: local dimension of natural coordinates T: floating point type L: number of coordinates
struct NC{N, M, T, L, NCOORDS, NCOORDS2} <: Rible.AbstractNonminimalCoordinates{N, T}Rible.NCF.NC2D Type
2D Natural Coordinates.
struct NC{2, M, T, L, NCOORDS, NCOORDS2} <: Rible.AbstractNonminimalCoordinates{2, T}Rible.NCF.NC2D2C Type
2D 2-component (point-like) Natural Coordinates.
struct NC{2, 0, T, 0, 2, 4} <: Rible.AbstractNonminimalCoordinates{2, T}Rible.NCF.NC2D4C Type
2D 4-component (bar-like) Natural Coordinates.
struct NC{2, 1, T, 2, 4, 16} <: Rible.AbstractNonminimalCoordinates{2, T}Rible.NCF.NC2D6C Type
2D 6-component (rigid body) Natural Coordinates.
struct NC{2, 2, T, 4, 6, 36} <: Rible.AbstractNonminimalCoordinates{2, T}Rible.NCF.NC3D Type
3D Natural Coordinates.
struct NC{3, M, T, L, NCOORDS, NCOORDS2} <: Rible.AbstractNonminimalCoordinates{3, T}Rible.NCF.NC3D12C Type
3D 12-component (rigid body) Natural Coordinates.
struct NC{3, 3, T, 9, 12, 144} <: Rible.AbstractNonminimalCoordinates{3, T}Rible.NCF.NC3D3C Type
3D 3-component (point-like) Natural Coordinates.
struct NC{3, 0, T, 0, 3, 9} <: Rible.AbstractNonminimalCoordinates{3, T}Rible.NCF.NC3D6C Type
3D 6-component (bar-like) Natural Coordinates.
struct NC{3, 1, T, 3, 6, 36} <: Rible.AbstractNonminimalCoordinates{3, T}Rible.get_num_of_coords Method
Return the number of coordinates.
get_num_of_coords(_::LNCData{N, M, T, L}) -> AnyRible.get_num_of_dims Method
Return the dimension of space.
get_num_of_dims(_::LNCData{N, M, T, L}) -> AnyRible.get_num_of_dof Method
Return the number of degrees of freedom
get_num_of_dof(nmcs::NC) -> AnyRible.get_num_of_intrinsic_cstr Method
Return the number of constraints.
get_num_of_intrinsic_cstr(
_::NC{2, 0, T, 0, 2, 4} where T
) -> Int64Rible.get_num_of_local_dims Method
Return local dimension of natural coordinates.
get_num_of_local_dims(_::LNCData{N, M, T, L}) -> AnyRible.NCF.NC1P2V Method
Return 2D rigid bodies natural coordinates, using 1 basic point and 2 base vectors.
NC1P2V(ri::AbstractArray{T, 1}; ...) -> NC
NC1P2V(ri::AbstractArray{T, 1}, origin_position; ...) -> NC
NC1P2V(
ri::AbstractArray{T, 1},
origin_position,
α;
cstr_idx
) -> NCRible.NCF.NC1P3V Method
Return 3D rigid bodies natural coordinates, using 1 basic point and 3 base vectors
NC1P3V(ri::AbstractArray{T, 1}; ...) -> NC
NC1P3V(ri::AbstractArray{T, 1}, origin_position; ...) -> NC
NC1P3V(
ri::AbstractArray{T, 1},
origin_position,
R;
cstr_idx
) -> NCRible.NCF.NC1P3V Method
Return 3D rigid bodies natural coordinates, using 1 basic point and 3 base vectors.
NC1P3V(
ri::AbstractArray{T, 1},
u::AbstractArray{T, 1},
v::AbstractArray{T, 1},
w::AbstractArray{T, 1};
...
) -> NC
NC1P3V(
ri::AbstractArray{T, 1},
u::AbstractArray{T, 1},
v::AbstractArray{T, 1},
w::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC1P3V(
ri::AbstractArray{T, 1},
u::AbstractArray{T, 1},
v::AbstractArray{T, 1},
w::AbstractArray{T, 1},
origin_position,
R;
cstr_idx
) -> NCRible.NCF.NC2D1P Method
Return 2D point mass natural coordinates.
NC2D1P(ri::AbstractArray{T, 1}; cstr_idx) -> NCRible.NCF.NC2D1P1V Method
Return 2D rigid bar natural coordinates, using 1 basic point and 1 base vector.
NC2D1P1V(
ri::AbstractArray{T, 1},
u::AbstractArray{T, 1};
...
) -> NC
NC2D1P1V(
ri::AbstractArray{T, 1},
u::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC2D1P1V(
ri::AbstractArray{T, 1},
u::AbstractArray{T, 1},
origin_position,
α;
cstr_idx
) -> NCRible.NCF.NC2D2P Method
Return 2D rigid bar natural coordinates, starting from two points.
NC2D2P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1};
...
) -> NC
NC2D2P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC2D2P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
origin_position,
α;
cstr_idx
) -> NCRible.NCF.NC2P1V Method
Return 2D rigid bodies natural coordinates, using 2 basic points and 1 base vector.
NC2P1V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1};
...
) -> NC
NC2P1V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC2P1V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
origin_position,
α;
cstr_idx
) -> NCRible.NCF.NC2P2V Method
Return 3D rigid bodies natural coordinates, using 2 basic points and 2 base vectors.
NC2P2V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
v::AbstractArray{T, 1},
w::AbstractArray{T, 1};
...
) -> NC
NC2P2V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
v::AbstractArray{T, 1},
w::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC2P2V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
v::AbstractArray{T, 1},
w::AbstractArray{T, 1},
origin_position,
R;
cstr_idx
) -> NCRible.NCF.NC2P2V Method
Return 3D rigid bodies natural coordinates, using 2 basic points and 2 base vectors.
NC2P2V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1};
...
) -> NC
NC2P2V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC2P2V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
origin_position,
R;
cstr_idx
) -> NCRible.NCF.NC3D1P Method
Return 3D point mass natural coordinates.
NC3D1P(ri::AbstractArray{T, 1}; cstr_idx) -> NCRible.NCF.NC3D1P1V Method
Return 3D rigid bar natural coordinates.
NC3D1P1V(
ri::AbstractArray{T, 1},
u::AbstractArray{T, 1};
...
) -> NC
NC3D1P1V(
ri::AbstractArray{T, 1},
u::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC3D1P1V(
ri::AbstractArray{T, 1},
u::AbstractArray{T, 1},
origin_position,
R;
cstr_idx
) -> NCRible.NCF.NC3D2P Method
Return 3D rigid bar natural coordinates, starting from two points.
NC3D2P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1};
...
) -> NC
NC3D2P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC3D2P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
origin_position,
R;
cstr_idx
) -> NCRible.NCF.NC3P Method
Return 2D rigid bodies natural coordinates, using 3 basic points
NC3P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
rk::AbstractArray{T, 1};
...
) -> NC
NC3P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
rk::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC3P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
rk::AbstractArray{T, 1},
origin_position,
α;
cstr_idx
) -> NCRible.NCF.NC3P1V Method
Return 3D rigid bodies natural coordinates, using 3 basic points and 1 base vector.
NC3P1V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
rk::AbstractArray{T, 1};
...
) -> NC
NC3P1V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
rk::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC3P1V(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
rk::AbstractArray{T, 1},
origin_position,
R;
cstr_idx
) -> NCRible.NCF.NC4P Method
Return 3D rigid bodies natural coordinates, using 4 basic points
NC4P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
rk::AbstractArray{T, 1},
rl::AbstractArray{T, 1};
...
) -> NC
NC4P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
rk::AbstractArray{T, 1},
rl::AbstractArray{T, 1},
origin_position;
...
) -> NC
NC4P(
ri::AbstractArray{T, 1},
rj::AbstractArray{T, 1},
rk::AbstractArray{T, 1},
rl::AbstractArray{T, 1},
origin_position,
R;
cstr_idx
) -> NCRible.NCF.get_conversion_core Method
!!!!!!!!!
get_conversion_core(np, nv) -> Matrix{Int64}Rible.NCF.get_conversion_to_std Method
!!!!!!!!!
get_conversion_to_std(ndim, np, nv) -> AnyRible.cartesian_frame2coords Method
Return rigid body natural coordinates
cartesian_frame2coords(
nmcs::Union{NC2D2C, NC3D3C, NC2D{0, T, 0, 2, 4} where T, NC3D{0, T, 0, 3, 9} where T},
origin_frame
) -> Tuple{Any, Any}Rible.to_local_coords Method
Return transformation matrix。
to_local_coords(nmcs::NC, r̄) -> AnyRible.NCF.make_∂Aq̇∂q_forwarddiff Method
Return the ForwardDiff results for ∂Aq̇∂q
make_∂Aq̇∂q_forwarddiff(
Φq,
nq,
nλ
) -> Rible.NCF.var"#∂Aq̇∂q#make_∂Aq̇∂q_forwarddiff##0"Rible.cstr_function! Function
Return 2D or 3D intrinsic cstr(s) for point mass.
cstr_function!(
ret,
nmcs::Union{NC2D2C, NC3D3C, NC2D{0, T, 0, 2, 4} where T, NC3D{0, T, 0, 3, 9} where T},
q::AbstractVector
)
cstr_function!(
ret,
nmcs::Union{NC2D2C, NC3D3C, NC2D{0, T, 0, 2, 4} where T, NC3D{0, T, 0, 3, 9} where T},
q::AbstractVector,
deforms
)Rible.cstr_function! Method
Return 2D or 3D intrinsic cstr(s) for rigid bars.
cstr_function!(
ret::AbstractArray{T, 1},
nmcs::NC{2, 1, T, 2, 4, 16},
q::AbstractArray{T, 1}
) -> Any
cstr_function!(
ret::AbstractArray{T, 1},
nmcs::NC{2, 1, T, 2, 4, 16},
q::AbstractArray{T, 1},
d::StaticArraysCore.SArray{Tuple{1}, T, 1, 1}
) -> AnyRible.cstr_function! Method
Return 2D intrinsic cstr(s) , for rigid bodies.
cstr_function!(
ret::AbstractArray{T, 1},
nmcs::NC{2, 2, T, 4, 6, 36} where T,
q::AbstractArray{T, 1}
) -> Any
cstr_function!(
ret::AbstractArray{T, 1},
nmcs::NC{2, 2, T, 4, 6, 36} where T,
q::AbstractArray{T, 1},
d::StaticArraysCore.SArray{Tuple{3}, T, 1, 3}
) -> AnyRible.cstr_function! Method
Return 3D intrinsic cstr(s) , for rigid bodies.
cstr_function!(
ret::AbstractArray{T, 1},
nmcs::NC{3, 3, T, 9, 12, 144} where T,
q::AbstractArray{T, 1}
) -> Any
cstr_function!(
ret::AbstractArray{T, 1},
nmcs::NC{3, 3, T, 9, 12, 144} where T,
q::AbstractArray{T, 1},
d::StaticArraysCore.SArray{Tuple{6}, T, 1, 6}
) -> AnyRible.cstr_jacobian! Method
Return 2D or 3D Jacobian matrix for point mass.
cstr_jacobian!(
ret,
nmcs::Union{NC2D2C, NC3D3C, NC2D{0, T, 0, 2, 4} where T, NC3D{0, T, 0, 3, 9} where T},
jac,
q::AbstractVector
)Rible.cstr_jacobian! Method
Return 2D or 3D Jacobian matrix for rigid bars.
cstr_jacobian!(
ret::AbstractArray{T, 2},
nmcs::NC{2, 1, T, 2, 4, 16},
jac::AbstractArray{T, 2},
q::AbstractArray{T, 1}
) -> AbstractMatrixRible.cstr_jacobian! Method
Return 2D Jacobian matrix , for rigid bodies.
cstr_jacobian!(
ret::AbstractArray{T, 2},
nmcs::NC{2, 2, T, 4, 6, 36} where T,
jac::AbstractArray{T, 2},
q::AbstractArray{T, 1}
) -> AbstractMatrixRible.cstr_jacobian! Method
Return 2D or 3D Jacobian matrix for rigid bars.
cstr_jacobian!(
ret::AbstractArray{T, 2},
nmcs::NC{3, 1, T, 3, 6, 36},
jac::AbstractArray{T, 2},
q::AbstractArray{T, 1}
) -> AbstractMatrixRible.cstr_jacobian! Method
Return 3D Jacobian matrix , for rigid bodies.
cstr_jacobian!(
ret::AbstractArray{T, 2},
nmcs::NC{3, 3, T, 9, 12, 144} where T,
jac::AbstractArray{T, 2},
q::AbstractArray{T, 1}
) -> AbstractMatrixRible.nullspace_mat Method
Return nullspace matrix
nullspace_mat(nmcs::NC{2, 1, T, 2, 4, 16} where T, q) -> AnyBodies
Rible.AbstractBodyState Type
Abstract interface for body states.
abstract type AbstractBodyState{N, T}Rible.AbstractFeaturizer Type
AbstractFeaturizerTransforms the extracted state x into a feature vector φ.
sourceRible.AbstractStateExtractor Type
AbstractStateExtractorExtracts specific quantities of interest (x) from the robot state.
sourceRible.AbstractTimeBasis Type
AbstractTimeBasisAbstract type for time-dependent basis functions.
sourceRible.InertiaCache Type
Inertia cache for storing mass matrices and related quantities.
mutable struct InertiaCache{MType, JType, GType}Rible.add_cstr_forces_jacobian! Function
add_cstr_forces_jacobian!(ret, coords, λ)Get constraint forces jacobian.
sourceRible.apply_field! Function
apply_field!(F, body, field, q)Apply field forces to the body.
sourceRible.cstr_forces_jacobian Function
cstr_forces_jacobian(coords, λ)Get constraint forces jacobian.
sourceRible.cstr_forces_jacobian! Function
cstr_forces_jacobian!(ret, coords, λ)Get constraint forces jacobian.
sourceRible.cstr_function! Function
cstr_function(ret, coords, q, d)Evaluate constraint functions.
sourceRible.cstr_velocity_jacobian Function
cstr_velocity_jacobian(coords, q̇)Get constraint velocity jacobian.
sourceRible.cstr_velocity_jacobian! Function
cstr_velocity_jacobian!(ret, coords, q̇)Get constraint velocity jacobian.
sourceRible.field_jacobian! Function
field_jacobian!(∂F̌∂q̌, body, field, q)Calculate field force jacobian.
sourceRible.get_num_of_coords Function
get_num_of_coords(coords)Return the total number of coordinates.
sourceRible.get_num_of_dims Function
get_num_of_dims(coords)Return the spatial dimension of the coordinate system.
sourceRible.get_num_of_dof Function
get_num_of_dof(coords)Return the number of degrees of freedom.
sourceRible.get_num_of_intrinsic_cstr Function
get_num_of_intrinsic_cstr(coords)Return the number of intrinsic constraints.
sourceRible.make_cstr_function Function
make_cstr_function(coords, ...)Make constraint function.
sourceRible.make_cstr_jacobian Function
make_cstr_jacobian(coords, ...)Make constraint jacobian.
sourceRible.RigidBody Type
Rigid Body Type
struct RigidBody{N, M, T, L, coordsType, cacheType, meshType} <: Rible.AbstractRigidBody{N, T}prop::RigidBodyProperty: Rigid Body Propertystate::RigidBodyState: Rigid Body Statecoords::Any: Coordinates Statecache::Any: Cachemesh::Any: Rigid Body Mesh
Rible.RigidBodyCache Type
Rigid Body Cache Type.
struct RigidBodyCache{CType, cacheType, jacType} <: Rible.AbstractBodyCacheCo::AnyCg::AnyCps::Vectorinertia_cache::Anyjac_cache::Any
Rible.RigidBodyProperty Type
Rigid Body Property Type
struct RigidBodyProperty{N, T, L} <: Rible.AbstractRigidBodyProperty{N, T}contactable::Bool: Is able to make contact with?visible::Bool: Is visible?id::Int64: id. Unique in a systemtype::Symbol: Type or name.mass::Any: Massinertia::StaticArraysCore.SMatrix{N, N} where N: Inertiamass_locus::Locus: Centroid in local frameloci::Array{Locus{N, T, L}, 1} where {N, T, L}: Anchor points in local frame
Rible.RigidBodyProperty Method
Rigid Body Property Constructor
RigidBodyProperty(
id::Integer,
contactable::Bool,
mass,
inertia_input,
mass_locus::Locus{N, T, L};
...
) -> RigidBodyProperty
RigidBodyProperty(
id::Integer,
contactable::Bool,
mass,
inertia_input,
mass_locus::Locus{N, T, L},
loci::Vector{<:Locus};
visible,
type
) -> RigidBodyPropertyRible.RigidBodyState Type
Rigid Body State Mutable Type.
mutable struct RigidBodyState{N, M, T, L} <: Rible.AbstractRigidBodyState{N, T}origin_frame::Rible.CartesianFrame: Origin of local framemass_locus_state::Rible.LocusState: Position of mass center in global frameloci_states::Array{Rible.LocusState{N, M, T, L}, 1} where {N, M, T, L}: Positions of anchor points in global frame
Rible.RigidBodyState Method
Rigid Body State Constructor
RigidBodyState(
prop::RigidBodyProperty{N, T},
origin_position_input,
rotation_input,
origin_velocity_input,
angular_velocity_input
) -> RigidBodyStatesource
Rible.body_state2coords_state Function
body_state2coords_state(state, coords)Convert body state to coordinate state.
sourceRible.kinetic_energy Function
kinetic_energy(body, inst_state)Calculate kinetic energy of the body.
sourceRible.lazy_update_state! Function
lazy_update_state!(state, coords, cache, prop, inst_state)Update only position and velocity (lazy update).
sourceRible.potential_energy_field Function
potential_energy_field(body, field, inst_state)Calculate potential energy from field.
sourceRible.potential_energy_strain Function
potential_energy_strain(body)Calculate strain potential energy.
sourceRible.strain! Function
strain!(F, prop, coords, state, cache)Calculate strain from body state.
sourceRible.stretch_loci! Function
stretch_loci!(coords, cache, prop, inst_state)Update transformation matrices from deformation parameters.
sourceRible.update_inertia_cache! Function
update_inertia_cache!(cache, coords, prop, inst_state)Update inertia-related cache.
sourceRible.update_loci_states! Function
update_loci_states!(state, coords, cache, prop, inst_state)Update loci states using cached transformation matrices.
sourceRible.update_state! Function
update_state!(state, coords, cache, prop, inst_state)Update full state including rotation and angular velocity.
sourceRible.update_transformations! Function
update_transformations!(coords, cache, state, prop, inst_state)Update transformation matrices from coordinates.
sourceRible.clear_forces! Method
Clear Rigid Body Forces and torques.
clear_forces!(body::Rible.AbstractRigidBody) -> AnyRible.kinetic_energy Method
Return Rigid Body kinetic energy.
kinetic_energy(body::Rible.AbstractRigidBody{2, T}) -> AnyRible.kinetic_energy Method
Return Rigid Body kinetic energy.
kinetic_energy(body::Rible.AbstractRigidBody{3, T}) -> AnyRible.potential_energy_field Method
Return Rigid Body gravity potential energy.
potential_energy_field(
body::RigidBody,
field::Rible.Gravity,
q
) -> AnyRible.potential_energy_strain Method
Return Rigid Body Strain potential energy.
potential_energy_strain(
body::Rible.AbstractRigidBody
) -> AnyStructure, Constraints, and Connectivity
Rible.get_accels Method
Return system generalized accelerations.
get_accels(st::Rible.AbstractStructure) -> AnyRible.get_auxiliary Method
Return system auxiliary variables.
get_auxiliary(st::Rible.AbstractStructure) -> AnyRible.get_coords Method
Return system generalized coordinates.
get_coords(st::Rible.AbstractStructure) -> AnyRible.get_d Method
Return the violation vector (deformations or joint violations) for the entire structure.
get_d(st::Rible.AbstractStructure) -> AnyRible.get_free_accels Method
Return system free accelerations.
get_free_accels(st::Rible.AbstractStructure) -> AnyRible.get_free_coords Method
Return system free coordinates.
get_free_coords(st::Rible.AbstractStructure) -> AnyRible.get_free_velocs Method
Return system free velocities.
get_free_velocs(st::Rible.AbstractStructure) -> AnyRible.get_initial Method
Return the initial state of the structure, including coordinates, velocities, and parameters.
get_initial(st::Rible.AbstractStructure)Rible.get_multipliers Method
Return system Lagrange multipliers.
get_multipliers(st::Rible.AbstractStructure) -> AnyRible.get_num_of_cstr Method
Return the system's number of constraints.
get_num_of_cstr(st::Rible.AbstractStructure) -> AnyRible.get_num_of_dims Method
Return System dimensions
get_num_of_dims(st::Rible.AbstractStructure) -> AnyRible.get_params Method
Build the system parameters vector from bodies and apparatuses.
get_params(
bodies,
appars,
cnt::Rible.AbstractConnectivity
) -> AnyRible.get_params Method
Get the parameters of a specific locus (identified by body ID and locus ID) from the structure.
get_params(st::Rible.AbstractStructure, bodyid, pid) -> AnyRible.get_params Method
Return system parameters (e.g., loci coordinates).
get_params(st::Rible.AbstractStructure) -> AnyRible.get_pres_accels Method
Return system prescribed accelerations.
get_pres_accels(st::Rible.AbstractStructure) -> AnyRible.get_pres_coords Method
Return system prescribed coordinates.
get_pres_coords(st::Rible.AbstractStructure) -> AnyRible.get_pres_velocs Method
Return system prescribed velocities.
get_pres_velocs(st::Rible.AbstractStructure) -> AnyRible.get_velocs Method
Return system generalized velocities.
get_velocs(st::Rible.AbstractStructure) -> AnyRible.Structure Type
Structure Type.
struct Structure{BodyType, TenType, CntType, StateType, CRType, CacheType} <: Rible.AbstractStructure{BodyType, TenType, CntType}Rible.Structure Method
Structure Constructor.
Structure(
bodies,
apparatuses,
cnt::Rible.AbstractConnectivity
) -> Structure{_A, _B, CntType, StateType, CRType, CacheType} where {_A, _B, CntType<:Union{Connectivity, Rible.PresFreeConnectivity}, StateType<:Union{Rible.StructureState{sysT, msT} where {sysT<:CoordinatesState, msT<:(Vector)}, Rible.StructureState{sysT, msT} where {sysT<:Rible.PresFreeCoordinatesState, msT<:(Vector)}}, CRType<:(NamedTuple{(:activated_bits, :persistent_bits, :friction_coefficients, :restitution_coefficients, :gaps), <:Tuple{BitVector, BitVector, Any, Any, Vector}}), CacheType<:Union{Rible.StructureCache{InertiaCache{MType, JType, SparseArrays.SparseMatrixCSC{Float64, Int64}}} where {MType<:(SparseArrays.SparseMatrixCSC{Tv, Int64} where Tv), JType<:(SparseArrays.SparseMatrixCSC{Tv, Int64} where Tv)}, Rible.StructureCache{InertiaCache{MType, JType, GType}} where {MType<:(SparseArrays.SparseMatrixCSC{Tv, Int64} where Tv), JType<:(SparseArrays.SparseMatrixCSC{Tv, Int64} where Tv), GType<:(SparseArrays.SparseVector{Tv, Int64} where Tv)}}}Rible.StructureState Type
StructureState Type.
struct StructureState{sysT, msT} <: Rible.AbstractStructureStateRible.StructureState Method
State Constructor.
StructureState(
bodies,
apparatuses,
cnt::Connectivity
) -> Rible.StructureState{sysT, msT} where {sysT<:CoordinatesState, msT<:(Vector)}Rible.VizStructure Type
VizStructure Type.
struct VizStructure{BodyType, TenType, CntType, StateType, CacheType} <: Rible.AbstractStructure{BodyType, TenType, CntType}Rible.check_jacobian_singularity Method
check constraints jacobian singularity
check_jacobian_singularity(
st::Rible.AbstractStructure
) -> AnyRible.kinetic_energy Method
Return System Kinetic energy
kinetic_energy(st::Rible.AbstractStructure) -> AnyRible.mechanical_energy Function
Return System mechanical_energy
mechanical_energy(
st::Rible.AbstractStructure
) -> NamedTuple{(:T, :V, :E), <:Tuple{Any, Any, Any}}
mechanical_energy(
st::Rible.AbstractStructure,
field
) -> NamedTuple{(:T, :V, :E), <:Tuple{Any, Any, Any}}Rible.potential_energy_field Function
Return System potential energy
potential_energy_field(st::Rible.AbstractStructure) -> Any
potential_energy_field(
st::Rible.AbstractStructure,
field
) -> AnyRible.Connectivity Type
Constructor for the standard Connectivity type.
Connectivity(
bodies;
...
) -> Connectivity{Vector{Vector{Int64}}}
Connectivity(
bodies,
apparatuses;
sharing_matrix
) -> Connectivity{Vector{Vector{Int64}}}Rible.Connectivity Type
Standard Rigid Body Connectivity Type.
struct Connectivity{id2idxType} <: Rible.AbstractConnectivitynum_of_bodies::Int64num_of_apparatuses::Int64num_of_joint_apparatuses::Int64num_of_force_apparatuses::Int64num_of_full_coords::Int64num_of_intrinsic_cstr::Int64num_of_extrinsic_cstr::Int64num_of_cstr::Int64num_of_dof_unconstrained::Int64num_of_dof::Int64num_of_aux_var::Int64sys_full_coords_idx::Vector{Int64}bodyid2sys_full_coords::Anybodyid2sys_intrinsic_cstr_idx::Anybodyid2sys_dof_idx::Anyapparid2sys_extrinsic_cstr_idx::Anyapparid2sys_aux_var_idx::Anybodyid2sys_locus_id::Vector{Vector{Int64}}: body's loci' idx to System's loci' idxsys_locus_id2sig::Vector{Signifier{Int64}}: System's loci' idx to Signifiersys_locus_id2coords_idx::Vector{Vector{Int64}}: System's loci' idx to System's loci' coords' idxbodyid2sys_loci_coords_idx::Vector{Vector{Int64}}: body's loci' idx to System's loci' coords' idxnum_of_sys_loci::Int64: Number of the System's locinum_of_sys_loci_coords::Int64: Number of the System's loci' coordsnum_of_body_params::Int64num_of_appar_params::Int64num_of_params::Int64apparid2params_idx::Vector{Vector{Int64}}apparid2sys_full_coords_idx::Vector{Vector{Int64}}
Rible.build_mass_matrices Method
Return System mass matrices
build_mass_matrices(
structure::Rible.AbstractStructure
) -> NamedTuple{(:M, :M⁻¹, :M̌, :M̌⁻¹, :Ḿ, :M̄), <:NTuple{6, Any}}Rible.gen_force_para_jacobian! Function
gen_force_para_jacobian!(∂Q∂c,appar::Apparatus,st,q,q̇,t, s=nothing)Compute the Jacobian of the generalized force w.r.t. the structual parameters.
sourceRible.auxi_function! Method
Compute and store the auxiliary variables of the entire structure into ret.
auxi_function!(
ret,
structure::Rible.AbstractStructure,
inst_state::Rible.AbstractCoordinatesState
)Rible.auxi_function Method
Return the auxiliary variables of the entire structure.
auxi_function(
structure::Rible.AbstractStructure,
inst_state::Rible.AbstractCoordinatesState
) -> AnyRible.auxi_jacobian! Method
Compute and store the Jacobian matrices of the structure's auxiliary function.
auxi_jacobian!(
∂S∂q,
∂S∂s,
structure::Rible.AbstractStructure,
inst_state::Rible.AbstractCoordinatesState
) -> AnyRible.auxi_jacobian! Method
auxi_jacobian!(
∂S∂q,
∂S∂s,
appar::Rible.Apparatus,
cnt::Rible.AbstractConnectivity,
q,
s
) -> AnyCompute and store the Jacobian matrices w.r.t. the free coordinates and auxiliary variables of the auxiliary function of an apparatus.
Arguments
∂S∂q: Output matrix for partial derivatives w.r.t. free coordinates∂S∂s: Output matrix for partial derivatives w.r.t. auxiliary variablesappar: The apparatusstructure: The mechanical structureq: Current generalized coordinatess: Current auxiliary variables
Rible.switch! Method
switch!(st::AbstractStructure, inst_state::AbstractCoordinatesState)Switch the representation of a structure's apparatuses based on the current configuration q and auxiliary variables s.
The representation include the auxilary functions and hyper parameters of the apparatuses, but does not include the state of the apparatuses.
This function is usually used to prepare the structure for the next time step.
Arguments
st::AbstractStructure: The structure to updateq: Current configuration coordinatess: Current auxiliary variables
Rible.switch! Method
switch!(appar::Apparatus, structure::AbstractStructure, q, s)Switch the representation of an apparatus based on the current configuration q and auxiliary variables s.
The representation include the auxilary functions and hyper parameters of the apparatuses, but does not include the state of the apparatuses.
This function is usually used to prepare the structure for the next time step.
Arguments
appar::Apparatus: The apparatus to updatestructure::AbstractStructure: The parent structureq: Current configuration coordinatess: Current auxiliary variables for this apparatus
Rible.apply_field! Method
apply_field!(
structure::Rible.AbstractStructure,
field::Rible.AbstractField
) -> AnyRible.field_jacobian! Method
field_jacobian!(
∂F∂q,
structure::Rible.AbstractStructure,
field::Rible.AbstractField
) -> AnyRible.update_apparatuses! Method
Update apparatuses of a structure
update_apparatuses!(
structure::Rible.AbstractStructure,
s::AbstractArray{T, 1}
) -> AnyRible.PresFreeConnectivity Type
Constructor for the PresFreeConnectivity type.
PresFreeConnectivity(
bodies;
...
) -> Rible.PresFreeConnectivity{Vector{Int64}, Vector{Vector{Int64}}}
PresFreeConnectivity(
bodies,
apparatuses;
sharing_matrix
) -> Rible.PresFreeConnectivity{Vector{Int64}, Vector{Vector{Int64}}}Rible.PresFreeConnectivity Type
Prescribed-Free Rigid Body Connectivity Type.
struct PresFreeConnectivity{idxType, id2idxType} <: Rible.AbstractConnectivitynum_of_bodies::Int64num_of_apparatuses::Int64num_of_joint_apparatuses::Int64num_of_force_apparatuses::Int64num_of_full_coords::Int64num_of_free_coords::Int64num_of_pres_coords::Int64num_of_intrinsic_cstr::Int64num_of_extrinsic_cstr::Int64num_of_cstr::Int64num_of_dof_unconstrained::Int64num_of_dof::Int64num_of_aux_var::Int64sys_free_coords_idx::Anysys_pres_coords_idx::Anybodyid2sys_full_coords::Anybodyid2sys_free_coords::Anybodyid2sys_pres_coords::Anybodyid2sys_intrinsic_cstr_idx::Anybodyid2sys_dof_idx::Anyapparid2sys_extrinsic_cstr_idx::Anyapparid2sys_full_coords_idx::Anyapparid2sys_aux_var_idx::Anybodyid2sys_locus_id::Vector{Vector{Int64}}: body's loci' idx to System's loci' idxsys_locus_id2sig::Vector{Signifier{Int64}}: System's loci' idx to Signifiersys_locus_id2coords_idx::Vector{Vector{Int64}}: System's loci' idx to System's loci' coords' idxbodyid2sys_loci_coords_idx::Vector{Vector{Int64}}: body's loci' idx to System's loci' coords' idxnum_of_sys_loci::Int64: Number of the System's locinum_of_sys_loci_coords::Int64: Number of the System's loci' coordsnum_of_body_params::Int64num_of_appar_params::Int64num_of_params::Int64apparid2params_idx::Vector{Vector{Int64}}
Rible.StructureState Method
Build a StructureState from bodies, apparatuses, and a PresFreeConnectivity.
StructureState(
bodies,
apparatuses,
cnt::Rible.PresFreeConnectivity
) -> Rible.StructureState{sysT, msT} where {sysT<:Rible.PresFreeCoordinatesState, msT<:(Vector)}Force Elements, Joints, and Generalized Forces
Rible.proto_joint_apparatus Method
A prototype joint is defined for a Hen2Egg.
Translation uses either the axis on Hen or on Egg.
Rotation uses the axis on Egg, because the local angular velocity is defined relative to Egg.
The order of translation and rotation matters!
proto_joint_apparatus(
id,
hen2egg,
force,
joint_type::Symbol
) -> Rible.Apparatus{jointType, forceType, cacheType} where {jointType<:(Rible.PrototypeJoint{_A, Vector{Int64}, _B, cacheType} where {_A, _B, cacheType<:(NamedTuple{(:relative_core, :transformations, :halves, :hessians, :joint_q, :joint_work, :trf_work, :num_of_coords_hen, :num_of_coords_egg), <:Tuple{Any, Any, Vector, Vector, Any, Any, Vector, Any, Any}})}), forceType<:Rible.AbstractForce, cacheType<:(Rible.ApparatusCache{_A, AType, _B, FType, _C, _D, _E, cacheType} where {_A, AType<:(SparseArrays.SparseMatrixCSC{Tv, Int64} where Tv), _B, FType<:(SparseArrays.SparseMatrixCSC{Tv, Int64} where Tv), _C, _D, _E, cacheType<:(NamedTuple{(:J, :DJ), <:Tuple{Any, Any}})})}Rible.DistanceSpringDamperState Method
DistanceSpringDamperState(
restlen,
direction
) -> Rible.DistanceSpringDamperStateRible.TorsionalSpringDamper Method
TorsionalSpringDamper(
rest_angle,
k;
...
) -> Rible.TorsionalSpringDamper
TorsionalSpringDamper(
rest_angle,
k,
c;
slack
) -> Rible.TorsionalSpringDamperCreate a torsional spring damper with specified rest angle, stiffness k, and optional damping coefficient c.
Arguments
rest_angle::T: The rest angle of the spring in radiansk::T: Spring stiffness coefficientc=zero(k): Optional damping coefficient, defaults to 0slack=false: If true, spring only generates torque when angle > rest_angle
Returns
TorsionalSpringDamper: A torsional spring damper force element
Rible.TorsionalSpringDamperState Method
TorsionalSpringDamperState(
rest_angle
) -> Rible.TorsionalSpringDamperState{T} where T<:RealRible.DistanceSpringDamper2D Method
DistanceSpringDamper2D(
restlen,
k;
...
) -> Rible.DistanceSpringDamper
DistanceSpringDamper2D(
restlen,
k,
c;
slack
) -> Rible.DistanceSpringDamperRible.DistanceSpringDamper3D Method
DistanceSpringDamper3D(
restlen,
k;
...
) -> Rible.DistanceSpringDamper
DistanceSpringDamper3D(
restlen,
k,
c;
slack
) -> Rible.DistanceSpringDamperRible.update! Function
update!(sd::Rible.TorsionalSpringDamper, angle) -> Any
update!(
sd::Rible.TorsionalSpringDamper,
angle,
angular_velocity
) -> AnyRible.BodyJoint Type
Joint that represents the body's own degrees of freedom (unconstrained).
struct BodyJoint{T, bodyType} <: Rible.AbstractJointnum_of_cstr::Int64body::Any
Rible.FixedPointJoint Type
Joint that fixes a point on a body in space.
struct FixedPointJoint{T, N, bodyType} <: Rible.AbstractJointbody::Anynum_of_cstr::Int64A::Matrixr̄o::StaticArraysCore.SVector{N, T} where {T, N}ro::StaticArraysCore.SVector{N, T} where {T, N}
Rible.LinearJoint Type
Linear constraint joint.
struct LinearJoint{T, bodyType} <: Rible.AbstractJointbody::Anynum_of_cstr::Int64A::Matrixviolations::Vector
Rible.PrototypeJoint Type
Generic joint prototype used for standard joint types.
struct PrototypeJoint{hen2eggType, maskType, valueType, cacheType, posType} <: Rible.AbstractJointhen2egg::Anynum_of_cstr::Int64num_of_dof::Int64mask_1st::Anymask_2nd::Anymask_3rd::Anymask_4th::Anyviolations::Anycache::Anyloci_position_hen::Anyloci_position_egg::Any
Rible.gen_force! Method
gen_force!(inst_state::AbstractCoordinatesState, bot::Robot, field::AbstractField, policy::AbstractPolicy, ; )Assembles the total generalized force vector F acting on the robot given the configuration encoded by inst_state (q, q̇, t, possibly s), the robot model bot, policy, and external field.
This method performs the following steps, in order:
Clears all internal force accumulators on the structure.
Applies actuation/controls according to
policyandinst_state.Updates body kinematics from the current state.
Updates any auxiliary apparatuses (possibly parameterized by
s).Applies the external field to the structure (e.g., gravity, magnetics).
Assembles all forces and stores the result in
F.
All operations are done in-place. The result in inst_state.F reflects the total forces resulting from both internal (structural, actuation) and external (field) contributions.
Arguments
inst_state: Pre-allocatedCoordinatesStateto store the force output.bot: Robot model containing structure and actuation.field: External field object (e.g., gravity, electromagnetics).policy: Actuation or control policy.(optional keyword arguments to pass through.)
Example
gen_force!(inst_state, bot, field, mypolicy, )Afterwards, inst_state.F will contain the total generalized forces for the system at this state.
Rible.gen_force_jacobian! Function
jacobian of generalized force with respect to state (q, q̇) and control (u)This is for adjoint dynamics.
sourceRible.gen_force_state_jacobian! Function
jacobian of generalized force with respect to state (q, q̇This is for forward dynamics.
sourceEnvironment and Contact
Control — Policies, Actuators, Gauges, Costs
Rible.DiscreteFeedbackPolicy Type
A discrete modular feedback policy structure.
struct DiscreteFeedbackPolicy{E<:Rible.AbstractStateExtractor, F<:Rible.AbstractFeaturizer, P<:Rible.AbstractParamFun} <: Rible.FeedbackDiscretePolicyextractor::Rible.AbstractStateExtractorfeaturizer::Rible.AbstractFeaturizerparamfun::Rible.AbstractParamFun
Rible.FeedbackPolicy Type
A modular feedback policy structure.
struct FeedbackPolicy{E<:Rible.AbstractStateExtractor, F<:Rible.AbstractFeaturizer, P<:Rible.AbstractParamFun} <: Rible.FeedbackDiscretePolicyextractor::Rible.AbstractStateExtractorfeaturizer::Rible.AbstractFeaturizerparamfun::Rible.AbstractParamFun
Rible.GaugesExtractor Type
Extracts state by measuring from gauges defined in bot.hub.gauges, weighted by gauges_weights. Follows the same pattern as Objective.
struct GaugesExtractor{W<:(AbstractVector)} <: Rible.AbstractStateExtractorgauges_weights::AbstractVector
Example
# Assuming bot.hub has 3 gauges defined
extractor = GaugesExtractor([1.0, 0.0, 1.0]) # use gauges 1 and 3
# All gauges with equal weight
extractor = GaugesExtractor(ones(3))Note
The gauges themselves are defined in bot.hub.gauges (same as used by Objective).
Rible.IdentityFeaturizer Type
Passes x through unchanged.
struct IdentityFeaturizer <: Rible.AbstractFeaturizerRible.TimeFunctionPolicy Type
Policy that evaluates a time-dependent function f(t).
struct TimeFunctionPolicy{F<:Function} <: Rible.AbstractTimePolicyf::Function
Rible.extract Method
extract(extractor, bot::Robot)Extract state from robot at a specific instantaneous state.
sourceRible.extract_jacobian Method
extract_jacobian(extractor, bot::Robot)Compute the Jacobian of the extracted state with respect to (q, q̇). Returns (∂x/∂q, ∂x/∂q̇) where x is the extracted state.
Uses the same indexing pattern as extract: each gauge's Jacobian rows are placed at indices given by captum_gauge_id2sys_capta_idx[gauge.id].
Rible.ApproxFunBasis Type
ApproxFunBasis{S} <: AbstractTimeBasisA wrapper for ApproxFun.jl spaces. The dimension of the basis is determined by order (number of coefficients).
Rible.BSplineBasis Type
BSplineBasis{T, B}A basis using B-splines defined by a knot vector, wrapping BSplineKit. Uses a single reusable cache to avoid allocations.
sourceRible.BasisOpenLoop Type
BasisOpenLoop{B <: AbstractTimeBasis, T}A generic open-loop policy that computes control actions as a linear combination of time basis functions.
u(t) = weights * basis_features(basis, t)
Fields
weights::Matrix{T}: Weights matrix where each row corresponds to an actuator/DOF and each column corresponds to a basis function.basis::B: The time basis object.
Rible.basis_dimension Method
basis_dimension(basis::AbstractTimeBasis)Returns the number of basis functions (dimension of the feature vector).
sourceRible.basis_features Method
basis_features(basis::AbstractTimeBasis, t)Returns a vector of basis function values at time t.
Rible.LinearParamFun Type
Linear parameter function: u = W φ + b.
struct LinearParamFun{T} <: Rible.AbstractParamFunweights::Matrixbias::Vector
Rible.LinearFeedbackPolicy Method
LinearFeedbackPolicy(K, k=zeros(...); extractor, featurizer)Convenience constructor returning a FeedbackPolicy configured with LinearParamFun (u = K * x + k). No dedicated wrapper struct is used; dispatch relies on the field types of FeedbackPolicy.
Rible.gen_force_state_jacobian! Method
gen_force_state_jacobian!(∂F∂q̌, ∂F∂q̌̇, ∂F∂u, policy::LFPolicy, bot::Robot, inst_state)Compute generalized force Jacobian F(q,q̇,u(q,q̇)) for a given policy. This function updates the provided matrices ∂F∂q̌ and ∂F∂q̌̇ in place. Formula: ∂F∂q̌ = ∂F∂q̌ + ∂F∂u * ∂u∂q̌ ∂F∂q̌̇ = ∂F∂q̌̇ + ∂F∂u * ∂u∂q̌̇
This function concerns only the latter part of the formula: ∂F∂u * ∂u∂q̌ and ∂F∂u * ∂u∂q̌̇
sourceRible.vjp_wrt_state Method
vjp_wrt_state(v, policy::LFPolicy, bot::Robot, num_of_actions, solver, solver_state)Vector-Jacobian product for reverse-mode differentiation using capta gauges.
sourceRible.PDParamFun Type
PDParamFun{T}PD control parametric function: u = K(x_des - x)
This is equivalent to the linear form u = -K_x + b where b = K_x_des, but with structured parameterization that separates the gain matrix K and the reference/setpoint x_des.
Fields
K::Matrix{T}: Gain matrix (action_dim × state_dim)x::Vector{T}: Reference/desired state (state_dim,)
Control Law
u = K * (x_des - x_measured)
Parameters
The parameters are [vec(K); x], giving a bilinear parameterization where the bias term b = K*x_des couples the gain and reference.
Notes
This is a structured but over-parameterized version of LinearParamFun
Parameters are nonlinearly related: changing K affects how x_des influences u
Useful when you want to separate gain tuning from setpoint adjustment
Rible.ProportionalDerivativePolicy Method
ProportionalDerivativePolicy(K, x_des; extractor, featurizer)Convenience constructor that returns a FeedbackPolicy configured as a PD controller using PDParamFun. The control law is u = K(x_des - x).
This is equivalent to the linear form u = -K_x + b where b = K_x_des, but with structured parameterization [K, x_des] instead of [K, b].
sourceRible.gen_force_state_jacobian! Method
gen_force_state_jacobian!(∂F∂q, ∂F∂q̇, ∂F∂u, policy::PDFeedbackPolicy, bot::Robot, inst_state)Compute generalized force Jacobian F(q,q̇,u(q,q̇)) for PD policy.
For u = K(x_des - x) = -K_x + K_x_des: ∂F/∂q̌ += ∂F/∂u · (-K · ∂x/∂q̌) ∂F/∂q̌̇ += ∂F/∂u · (-K · ∂x/∂q̌̇)
sourceRible.vjp_wrt_state Method
vjp_wrt_state(v, policy::PDFeedbackPolicy, bot::Robot, num_of_actions, solver, solver_state)Vector-Jacobian product for reverse-mode differentiation using capta gauges.
For PD control u = K(x_des - x), the VJP computes v'·∂u/∂z for all parameters z.
sourceRible.DiscreteLFPolicy Type
Alias for dispatch on linear-feedback-configured policies.
struct DiscreteFeedbackPolicy{var"#s799"<:Rible.AbstractStateExtractor, var"#s798"<:Rible.AbstractFeaturizer, var"#s797"<:Rible.LinearParamFun} <: Rible.FeedbackDiscretePolicyRible.DiscreteLinearFeedbackPolicy Method
DiscreteLinearFeedbackPolicy(K, k=zeros(...); extractor, featurizer)Convenience constructor returning a DiscreteFeedbackPolicy configured with LinearParamFun (u = K * x + k). No dedicated wrapper struct is used; dispatch relies on the field types of DiscreteFeedbackPolicy.
Rible.actuate! Method
Execute the control actions on the robot's apparatuses.
actuate!(
bot::Robot,
policy::Rible.DiscreteFeedbackPolicy{<:Rible.AbstractStateExtractor, <:Rible.AbstractFeaturizer, <:Rible.LinearParamFun},
inst_state::Rible.AbstractCoordinatesState
) -> AnyRible.control! Method
Compute the control actions and store them in the robot's hub state.
control!(
bot::Robot,
policy::Rible.DiscreteFeedbackPolicy{<:Rible.AbstractStateExtractor, <:Rible.AbstractFeaturizer, <:Rible.LinearParamFun},
solver_cache,
solver_state
) -> AnyRible.control_jacobian! Method
control_jacobian!(bot, policy::DiscreteLFPolicy, ...)For discrete time policy u = u(qₖ).
sourceRible.gen_force_state_jacobian! Method
gen_force_state_jacobian!(∂F∂q, ∂F∂q̇, ∂F∂u, policy::DiscreteLFPolicy, bot::Robot, inst_state)Zero out gradients because control is fixed w.r.t integration variables q_mid or q_{k+1}.
sourceRible.vjp_wrt_state Method
vjp_wrt_state(v, policy::DiscreteLFPolicy, bot::Robot, num_of_actions, solver_cache, solver_state)Vector-Jacobian product for reverse-mode differentiation using discrete q_k.
Rible.DiscretePDPolicy Type
Local alias for PD-configured feedback policies.
struct DiscreteFeedbackPolicy{var"#s799"<:Rible.AbstractStateExtractor, var"#s798"<:Rible.AbstractFeaturizer, var"#s797"<:Rible.PDParamFun} <: Rible.FeedbackDiscretePolicyRible.DiscreteProportionalDerivativePolicy Method
DiscreteProportionalDerivativePolicy(K, x_des; extractor, featurizer)Convenience constructor that returns a DiscreteFeedbackPolicy configured as a PD controller using PDParamFun. The control law is u = K(x_des - x).
This is equivalent to the linear form u = -K_x + b where b = K_x_des, but with structured parameterization [K, x_des] instead of [K, b].
sourceRible.actuate! Method
Execute the control actions on the robot's apparatuses.
actuate!(
bot::Robot,
policy::Rible.DiscreteFeedbackPolicy{<:Rible.AbstractStateExtractor, <:Rible.AbstractFeaturizer, <:Rible.PDParamFun},
inst_state::Rible.AbstractCoordinatesState
) -> AnyRible.control! Method
Compute the control actions and store them in the robot's hub state.
control!(
bot::Robot,
policy::Rible.DiscreteFeedbackPolicy{<:Rible.AbstractStateExtractor, <:Rible.AbstractFeaturizer, <:Rible.PDParamFun},
solver_cache,
solver_state
) -> AnyRible.control_jacobian! Method
control_jacobian!(bot, policy::DiscretePDPolicy, ...)For discrete time policy u = u(qₖ). We compute ∂C∂qₖ and ∂C∂pₖ. ∂u/∂qₖ₊₁ = 0.
sourceRible.gen_force_state_jacobian! Method
gen_force_state_jacobian!(∂F∂q, ∂F∂q̇, ∂F∂u, policy::DiscretePDPolicy, bot::Robot, inst_state)Zero out gradients because control is fixed w.r.t integration variables q_mid or q_{k+1}.
sourceRible.vjp_wrt_state Method
vjp_wrt_state(v, policy::DiscretePDPolicy, bot::Robot, num_of_actions, solver_cache, solver_state)Vector-Jacobian product for reverse-mode differentiation. u = K(x_des - x(qₖ))
sourceRible.control! Method
control!(bot::Robot,policy,state::ComponentArray)For policy that acts directly on discrete solver's discretized states (e.g. iLQR)
sourceRible.control_jacobian! Method
control_jacobian!(workspace,bot::Robot,policy,solver_cache,solver_state)Jacobian of the control function w.r.t. the discrete solver's discretized states. For policy that acts directly on discrete solver's discretized states (e.g. iLQR)
sourceRible.RegisterActuator Type
struct RegisterActuator{sigType, opType, regType} <: Rible.AbstractActuatorActuator that operates on a register of values, such as the original rest lengths of cables.
Fields
id::Int: Unique identifier for the actuatorsignifier::sigType: The signifier type, typically representing what the actuator acts uponoperator::opType: The operator type, defining how the actuator operatesregister::regType: The register containing values to be manipulated
Methods
get_num_of_actions(actuator::RegisterActuator): Returns the number of actions availableget_initial_actions(structure::AbstractStructure, actuator::RegisterActuator): Returns a vector of zeros representing possible actionsexecute!(structure::AbstractStructure, actuator::RegisterActuator, u): Executes the actuator's action on the structure
This actuator type is designed to work with a register of values, allowing for manipulation of multiple elements simultaneously based on the provided actions.
sourceRible.execute! Method
execute!(structure::AbstractStructure,actuator,u)Execute the actuator on the structure with the provided actions u.
Rible.gen_force_actu_jacobian! Method
gen_force_actu_jacobian!(∂F∂u, structure::AbstractStructure,actuator,u)Compute and store in ∂F∂u the Jacobian of the generalized force with respect to the actuator's actions, with the provided actions u.
Rible.get_initial_actions Method
get_initial_actions(structure::AbstractStructure,actuator)Return a vector of actions on the structure by the actuator.
sourceRible.get_num_of_actions Method
get_num_of_actions(::AbstractActuator)Return the number of actions available for the actuator.
sourceRible.measure Method
measure(structure::AbstractStructure,gauge::CaptumGauge)Return the measurement of the captum gauge.
sourceRible.measure Method
measure(structure::AbstractStructure,err_gau::ErrorGauge{sigType,captumType,<:AbstractVector}) where {sigType,captumType}Return the measurement of the error as deviation of the captum from the reference.
sourceRible.measure_gradient! Method
measure_jacobian!(∂g∂q,∂g∂q̇,∂g∂s,structure::AbstractStructure,err_gau::ErrorGauge)Compute the gradient of the error function w.r.t. the coordinates and velocities of the structure.
sourceRible.measure_hessians! Method
measure_hessians!(∂²g∂q²,∂²g∂q̇²,∂²g∂q̇∂q,structure::AbstractStructure,err_gau::ErrorGauge)Compute the Hessian of the error function w.r.t. the coordinates and velocities of the structure.
sourceRible.FullStateCaptum Type
FullStateCaptumA captum that measures the full system state [q; v] (generalized coordinates and velocities). Unlike other Captum types which measure from a specific signifier (body + locus), this captum measures system-level quantities.
sourceRible.compute_com_position_jacobian Method
compute_com_position_jacobian(structure::AbstractStructure)Compute the Jacobian matrix B that maps generalized coordinates to center of mass position. For constant mass system: r_com = B*q, where B = (1/M_total) * Σ m_i * J_i J_i is the position Jacobian of body i's center of mass.
sourceRible.measure Method
measure(structure::AbstractStructure, signifier, captum::CoMPosVelCaptum)Measure center of mass position and velocity for constant mass system: [r; v] = [B_q; B_q̇]
sourceRible.measure Method
measure(structure::AbstractStructure, signifier, captum::CoMPositionCaptum)Measure center of mass position for constant mass system: r = B*q where B maps generalized coordinates to center of mass position.
sourceRible.measure Method
measure(structure::AbstractStructure, signifier, captum::CoMVelocityCaptum)Measure center of mass velocity for constant mass system: v = B*q̇ where B maps generalized velocities to center of mass velocity.
sourceRible.measure Method
measure(structure::AbstractStructure,signifier::Signifier,captum)Return the measurement of the captum on the signifier.
sourceRible.measure_hessians Method
measure_hessians(structure::AbstractStructure, signifier, captum::CoMPosVelCaptum)Return Hessians for center of mass position and velocity (all zeros since both are linear).
sourceRible.measure_hessians Method
measure_hessians(structure::AbstractStructure, signifier, captum::CoMPositionCaptum)Return Hessians for center of mass position (all zeros since r = B*q is linear).
sourceRible.measure_hessians Method
measure_hessians(structure::AbstractStructure, signifier, captum::CoMVelocityCaptum)Return Hessians for center of mass velocity (all zeros since v = B*q̇ is linear).
sourceRible.measure_hessians Method
measure_hessians(structure::AbstractStructure,signifier::Signifier,captum)Return the Hessian of the captum's measurement w.r.t. the signifier's coordinates and velocities.
sourceRible.measure_jacobian! Method
measure_jacobian(structure::AbstractStructure,signifier::Signifier,captum)Return the Jacobian of the captum's measurement w.r.t. the signifier's coordinates and velocities.
sourceRible.cost! Method
cost!(bot::Robot, objt::AbstractObjective, inst_state::AbstractCoordinatesState, u; mode=:trajectory)Compute the cost for a robot system given the current state and control input at a single time point.
Arguments
bot::Robot: The robot systemobjt::AbstractObjective: The objective function containing weights for gauges and actuatorsinst_state::AbstractCoordinatesState: Instantaneous state of the robot systemu: Control inputsmode::Symbol: Cost mode (:trajectory or :terminal) for weights
Returns
The computed cost value
sourceRible.cost_gradient! Method
cost_gradient!(bot::Robot, policy::AbstractPolicy, objt::AbstractObjective, field::AbstractField=NoField(); mode=:trajectory)Compute the gradient of the cost function with respect to the robot's current state variables, control inputs, and parameters.
Arguments
bot::Robot: The robot systempolicy::AbstractPolicy: The control policyobjt::AbstractObjective: The objective functionfield::AbstractField: The field applied to the system (default: NoField())mode::Symbol: The mode of operation (:trajectory or :terminal)
Returns
A tuple containing the gradients with respect to:
∂ϕ∂qᵀ: Generalized coordinates∂ϕ∂q̇ᵀ: Generalized velocities∂ϕ∂pᵀ: Generalized momenta∂ϕ∂uᵀ: Control inputs∂ϕ∂θᵀ: Policy parameters∂ϕ∂cᵀ: System parameters
Rible.cost_hessian! Method
cost_hessian!(hessian::CostHessian, bot::Robot, policy::AbstractPolicy, env::AbstractEnvironment, objt::AbstractObjective, inst_state::AbstractCoordinatesState, u)Compute the Hessian of the cost function w.r.t. the coordinates q and p for a given robot bot at time t. This function updates the provided matrices in hessian in place.
Dynamics Solvers and Sensitivity Analysis
Rible.DynamicsProblem Type
Dynamics Problem definition.
struct DynamicsProblem{RobotType, policyType, envType, objtType, contact_modelType, apparatus_modelType, optionsType} <: Rible.AbstractDynamicsProblembot::Anypolicy::Anyenv::Anyobjt::Anycontact_model::Anyapparatus_model::Anyoptions::Any
Rible.DynamicsProblem Method
DynamicsProblem(bot::Robot;
env=GravityEnv(),
policy=NoPolicy(),
contact_model=Contactless(),
apparatus_model=Naive(),
kwargs...
)Construct a dynamics problem for the given robot.
Arguments
bot::Robot: the robot model (required, positional)env: environment model (default:GravityEnv())policy: control policy (default:NoPolicy())contact_model: contact model (default:Contactless())apparatus_model: apparatus model (default:Naive())kwargs...: additional options forwarded to the solver
Examples
prob = DynamicsProblem(bot)
prob = DynamicsProblem(bot; env=GravityEnv(), contact_model=Zhong06())
prob = DynamicsProblem(bot; policy=my_policy, apparatus_model=my_apparatus)Rible.DynamicsSolver Type
Standard Dynamics Solver.
struct DynamicsSolver{integratorType, body_solverType, apparatus_solverType, contact_solverType, optionsType} <: Rible.AbstractDynamicsSolverintegrator::Anybody_solver::Anyapparatus_solver::Anycontact_solver::Anyoptions::Any
Rible.Objective Type
Objective function parameters for dynamics problems.
struct Objective{weightsType, ηtype<:Function} <: Rible.AbstractObjectivetrajectory_error_gauges_weights::Anytrajectory_actuators_weights::Anyterminal_error_gauges_weights::Anyterminal_actuators_weights::Anyη::Function: weight of the trajectory cost as a function of time
Rible.SimulationResult Type
Result of a simulation.
struct SimulationResult{simType, cacheType}simulator::Anysolver_cache::Any
Rible.Simulator Type
Simulator for running dynamics problems.
mutable struct Simulator{probType, ctrlType, T, dataType}prob::Anycontroller::Anytspan::Tuple{T, T} where Trestart::Booltotalstep::Int64solver_history::Rible.SolverHistoryconvergence::Bool
Rible.generate_cache Method
generate_cache(
simulator::Simulator,
solver::AbstractDynamicsSolver;
dt,kwargs...
)Generate cache for the solver, dispatch based on constant mass matrix trait.
sourceRible.solve! Method
solve!(prob::AbstractDynamicsProblem,solver::AdjointDynamicsSensitivitySolver;
prescribe! = (state, structure) -> nothing,
tspan,dt,restart=true,kwargs...
)Solve the dynamics problem with the adjoint solver, return the simulation result.
sourceRible.solve! Method
solve!(prob::AbstractDynamicsProblem,solver::AbstractDynamicsSolver;
prescribe! = (state, structure) -> nothing,
tspan,dt,restart=true,kwargs...
)Solve the dynamics problem with the solver, return the simulation result.
sourceRible.solve! Method
solve!(simulator::Simulator,solver::AbstractDynamicsSolver;karg...)Solve the simulator with the solver, return the solver cache.
sourceRible.ContactVariables Type
Contact-specific variables for predictor-corrector method.
struct ContactVariables{T, VT, SVT, SAT}Λ::AnyΓ::AnyΛ_split::AnyΓ_split::AnyΛp::AnyΓp::AnyΛp_split::AnyΓp_split::AnyΔxp::AnyΔΛp::AnyΔΓp::AnyΔΛp_split::AnyΔΓp_split::AnyΔxc::AnyΔΛc::AnyΔΓc::AnyΔΛc_split::AnyΔΓc_split::Any𝐞_split::Array{StaticArraysCore.SVector{3, T}, 1} where TJ::LinearAlgebra.Diagonal{T, StaticArraysCore.SVector{3, T}} where T
Rible.CostGradientHessianWorkspace Type
Workspace for storing cost gradients and Hessians.
struct CostGradientHessianWorkspace{VT, MT}∂ϕ∂xᵀ::Anygradient::Rible.CostGradient∂ϕ∂xᵀ∂x::Anyhessian::Rible.CostHessian
Rible.NewtonWorkspace Type
Workspace for Newton iteration variables.
struct NewtonWorkspace{VT, MT}x::AnyRes::AnyJac::AnyΔx::AnyJacΔx::Anyxₖ::Any𝐰::Any∂Γ∂x::Anylu_tmp::Anyipiv::Vector{Int64}
Rible.Zhong06Constants Type
Constants for Jacobian computation.
struct Zhong06Constants{T}h::Anymass_norm::Anynq::Int64nq̌::Int64nλ::Int64nu::Int64nc::Int64nθ::Int64ns::Int64n1::Int64n2::Int64n3::Int64
Rible.Zhong06JacobianBlocks Type
Jacobian blocks for the system at time k+1.
struct Zhong06JacobianBlocks{MatType, BackupMatType, CMatType}Jacᵏ⁺¹ₖ₊₁::AnyJacᵏ⁺¹ₖ::AnyJacᵏ⁺¹ₖ_backup::AnyJacᵏ⁺¹ₘu::AnyJacᵏ⁺¹ₘc::Any
Rible.Zhong06JacobianWorkspace Type
Workspace for Jacobian computations - contains all intermediate matrices needed. Unified workspace used by Primal, Adjoint, and Direct sensitivity solvers.
struct Zhong06JacobianWorkspace{T}Fₘ::Vector∂F∂q::Matrix∂F∂q̇::Matrix∂Fₘ∂u::Matrix∂Fₘ∂c::Matrix∂F∂s::Matrix∂C∂qₖ::Matrix∂C∂pₖ::Matrix∂C∂sₖ::Matrix∂C∂qₖ₊₁::Matrix∂C∂pₖ₊₁::MatrixMₘ::SparseArrays.SparseMatrixCSC{T, Int64} where TM⁻¹ₘ::SparseArrays.SparseMatrixCSC{T, Int64} where T∂Mₘhq̇ₘ∂qₘ::SparseArrays.SparseMatrixCSC{T, Int64} where TM::SparseArrays.SparseMatrixCSC{T, Int64} where TḾ::SparseArrays.SparseMatrixCSC{T, Int64} where TM̌::SparseArrays.SparseMatrixCSC{T, Int64} where TM̄::SparseArrays.SparseMatrixCSC{T, Int64} where TM̌⁻¹::SparseArrays.SparseMatrixCSC{T, Int64} where TAₖ₊₁::MatrixAₖ::Matrix∂Aᵀλ∂q::Matrixϕbuf::Vector∂S∂q::Matrix∂S∂s::Matrix∂ϕ∂qᵀ::Vector∂ϕ∂q̇ᵀ::Vector∂ϕ∂pᵀ::Vector∂ϕ∂uᵀ::Vector∂ϕ∂sᵀ::Vector∂ϕf∂qᵀ::Vector∂ϕf∂q̇ᵀ::Vector∂ϕf∂pᵀ::Vector∂ϕf∂uᵀ::Vector∂ϕf∂sᵀ::Vectorcost_∂g∂q::Matrixcost_∂g∂q̇::Matrixcost_∂g∂s::Matrixcost_∂g∂u::Matrixcost_tmp_vec::Vectorgauge_workspaces::Array{Rible.GaugeWorkspace{T}, 1} where T
Rible.Zhong06SolverState Type
Unified solver state containing all trajectory information needed for Jacobian computation.
struct Zhong06SolverState{InstStateType, T}state_k::Anystate_kp1::Anystate_mid::Anydt::Any
Rible.default_linear_solver! Method
Linear solver that uses the analytic Jacobian.
Expected signature for custom solvers: linear_solver!(ws::NewtonWorkspace, solver_state, solver_cache, bot, policy, env)
sourceRible.finite_diff_linear_solver! Method
Linear solver that builds the Jacobian with finite differences of the residual.
residual_func! must populate ws.Res using the values in ws.x.
Rible._compute_contact_jacobian_blocks! Method
Compute contact-related Jacobian blocks.
This function adds the contribution from frictional contacts to the Jacobian.
sourceRible.compute_primal_jacobian! Method
Compute Jacobian for primal Newton solver at timestep k+1.
Key difference from adjoint/direct: pₖ₊₁ = pₖ₊₁(qₖ₊₁, λₘ) is not independent, so we use chain rule: ∂vₖ₊₁/∂qₖ₊₁ = (∂vₖ₊₁/∂pₖ₊₁) * (∂pₖ₊₁/∂qₖ₊₁).
sourceRible.compute_primal_residual! Method
Compute residual for primal Newton solver at timestep k+1.
Note: This uses a reduced state vector [qₖ₊₁, λₘ, Λ, Γ] where pₖ₊₁ is computed from qₖ₊₁ via the momentum relation, unlike the adjoint/direct solvers which treat p as an independent variable.
sourceRible.create_line_search_functions Method
Create line search functions (ϕ, dϕ, ϕdϕ) with shared setup for efficient evaluation.
Returns a tuple of three closures:
ϕ(β): merit function ϕ(β) = 0.5 * ||Res(x + β*Δx)||²
dϕ(β): derivative dϕ(β)/dβ
ϕdϕ(β): both merit and derivative (for efficiency)
All three functions share the same temporary workspace setup to avoid redundant allocations.
sourceRible.compute_predictor_step Method
Compute predictor step in predictor-corrector interior point method.
compute_predictor_step(
contact_vars::Rible.ContactVariables,
na
) -> Tuple{Any, Any}Rible.compute_timestep_sensitivities! Method
Compute direct sensitivities after convergence at timestep.
Computes:
Jacobian w.r.t. state at k: ∂x_{k+1}/∂x_k
Jacobian w.r.t. action: ∂x_{k+1}/∂u_
Jacobian w.r.t. control parameters: ∂x_{k+1}/∂θ
Cost gradients and Hessians w.r.t. state and action
Rible.newton_iteration_with_contact! Method
Perform single Newton iteration with predictor-corrector for contact case (na > 0)
Note: contact_vars.Δxp should already be computed before calling this function
sourceRible.compute_adjoint_step! Method
Compute adjoint step: Jacobians, cost gradients, VJP, and solve for adjoint variables. Returns updated adjoint variable yₖ and parameter gradients.
sourceRobot and Post-processing
Rible.Robot Type
Robot Type Constructor.
Robot(
structure
) -> Robot{stType, hubType, _A, contacts_trajType, contact_caches_trajType} where {stType<:Rible.AbstractStructure, hubType<:(ControlHub{Vector{Int64}, Vector{Int64}, Vector{Int64}, Coalition, NamedTuple{(:c, :e, :u), var"#s179"}} where var"#s179"<:Tuple{Any, Any, Any}), _A, contacts_trajType<:(Vector), contact_caches_trajType<:(Vector{T} where T<:(NamedTuple{(:na, :bodyid2act_idx, :persistent_idx, :activated_bits, :H, :activated_restitution_coefficients, :D, :Dper, :Dimp, :∂Dq̇∂q, :∂DᵀΛ∂q, :ŕ, :L, :Lv, :Λ, :Γ), <:Tuple{Any, Any, Vector{Int64}, Vararg{Any, 13}}}))}
Robot(
structure,
hub
) -> Robot{_A, _B, _C, contacts_trajType, contact_caches_trajType} where {_A, _B, _C, contacts_trajType<:(Vector), contact_caches_trajType<:(Vector{T} where T<:(NamedTuple{(:na, :bodyid2act_idx, :persistent_idx, :activated_bits, :H, :activated_restitution_coefficients, :D, :Dper, :Dimp, :∂Dq̇∂q, :∂DᵀΛ∂q, :ŕ, :L, :Lv, :Λ, :Γ), <:Tuple{Any, Any, Vector{Int64}, Vararg{Any, 13}}}))}Rible.Robot Type
Robot Type.
struct Robot{stType, hubType, trajType, contacts_trajType, contact_caches_trajType, control_trajType}Rible.goto_step! Method
Update System State to specific step.
goto_step!(bot::Robot, that_step; policy) -> RobotRible.set_initial! Function
Set new nitial conditions.
set_initial!(bot::Robot, q, q̇) -> Any
set_initial!(bot::Robot, q, q̇, s) -> AnyRible.set_robot_state! Method
Set robot state from a dictionary of CartesianFrames mapped to body IDs.
set_robot_state!(
bot::Robot,
frames::AbstractVector{<:Rible.CartesianFrame}
) -> AnyRible.draw_background! Method
Draw the background scene (e.g., starry sky).
draw_background!(ax, config::Rible.AxisConfig) -> Makie.PlotRible.record_trajectory! Method
record_trajectory!(fig, traj, bot, structure, viz_st, this_time, policy, config::PlayConfig)Record the trajectory.
sourceRible.setup_axis! Method
setup_axis!(subgrid, config::AxisConfig, ndim::Int, show_mesh::Bool)Set up the axis.
Arguments
subgrid: subgridconfig: axis configurationndim: dimensionshow_mesh: whether to show the mesh
Rible.setup_info_panel! Method
setup_info_panel!(subgrid, ax, axis_config::AxisConfig)Set up the info panel.
sourceRible.setup_interaction! Method
setup_interaction!(subgrid, traj, bot, structure, viz_st, ax, this_time, this_step, policy, config::PlayConfig, axis_config::AxisConfig, vis_config::VisConfig)Set up interaction.
sourceRible.update_robot_vis! Method
update_robot_vis!(viz_st, structure, bot, step, traj, this_time, policy, config::AxisConfig, ax)Update the robot visualization.
sourceVisualization Recipes
Rible.Vis Type
Vis is the plot type associated with plotting function vis. Check the docstring for vis for further information.
Rible.vis Function
No docstring defined.
Plot type
The plot type alias for the vis function is Vis.
Attributes
axes_arrows_scale = 1.0 — No docs available.
cable_color = :deepskyblue — No docs available.
cable_label_color = :darkgreen — No docs available.
cable_width = 0.6 — No docs available.
clip_planes = Makie.Plane3f[] — No docs available.
fontsize = 12 — No docs available.
id = 1 — No docs available.
isref = false — No docs available.
label_prefix = "" — No docs available.
linewidth = 1 — No docs available.
loci_colors = :black — No docs available.
loci_idx = nothing — No docs available.
loci_markers_sizes = 12 — No docs available.
mesh_color = nothing — No docs available.
point_color = :black — No docs available.
ref_color = :lightgrey — No docs available.
rigid_label_color = :darkblue — No docs available.
show_axes = false — No docs available.
show_cable_labels = false — No docs available.
show_cables = true — No docs available.
show_curvature = false — No docs available.
show_labels = false — No docs available.
show_loci = false — No docs available.
show_loci_labels = false — No docs available.
show_mass_center_labels = false — No docs available.
show_mass_centers = false — No docs available.
show_mesh = true — No docs available.
show_wire = false — No docs available.
slack_linestyle = :dash — No docs available.
Rible.vis! Function
vis! is the mutating variant of plotting function vis. Check the docstring for vis for further information.