API
此页面按功能模块汇总 Rible 的主要 API(自动从 docstring 生成)。
坐标系统
Rible.add_joint_forces_jacobian! Function
add_joint_forces_jacobian!(jacobian, coords, ...)Get joint forces jacobian.
Rible.build_joint_cache Function
build_joint_cache(coords, ...)Build joint cache for coordinate system.
Rible.cartesian_frame2coords Method
cartesian_frame2coords(coords, frame)Convert cartesian frame to coordinates.
Rible.find_angular_velocity Method
find_angular_velocity(coords, q, q̇)Find angular velocity from coordinates and velocities.
Rible.find_independent_free_idx Method
find_independent_free_idx(coords, ...)Find independent free indices.
Rible.find_local_angular_velocity Method
find_local_angular_velocity(coords, q, q̇)Find local angular velocity from coordinates and velocities.
Rible.get_joint_jacobian! Function
get_joint_jacobian!(jacobian, coords, ...)Get joint constraint jacobian.
Rible.get_joint_velocity_jacobian! Function
get_joint_velocity_jacobian!(jacobian, coords, ...)Get joint velocity jacobian.
Rible.get_joint_violations! Function
get_joint_violations!(violations, coords, ...)Get joint constraint violations.
Rible.get_num_of_local_dims Method
get_num_of_local_dims(coords)Return the number of local dimensions.
Rible.kinetic_energy_coords Function
kinetic_energy_coords(coords, ...)Calculate kinetic energy from coordinates.
Rible.to_local_coords Method
to_local_coords(coords, r̄)Transform global coordinates to local coordinates.
Rible.to_position Method
to_position(coords, q, c)Get position from coordinates and local parameters.
Rible.to_position_jacobian Method
to_position_jacobian(coords, c)Get position jacobian with respect to coordinates.
Rible.to_velocity_jacobian Method
to_velocity_jacobian(coords, q, q̇, c)Get velocity jacobian with respect to coordinates.
体(Bodies)
Rible.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::Rible.Locus: Centroid in local frameloci::Array{Rible.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_center_position::AbstractVector;
...
) -> RigidBodyProperty
RigidBodyProperty(
id::Integer,
contactable::Bool,
mass,
inertia_input,
mass_center_position::AbstractVector,
loci_positions::Array{StaticArraysCore.SArray{Tuple{N}, T, 1, N}, 1};
...
) -> RigidBodyProperty
RigidBodyProperty(
id::Integer,
contactable::Bool,
mass,
inertia_input,
mass_center_position::AbstractVector,
loci_positions::Array{StaticArraysCore.SArray{Tuple{N}, T, 1, N}, 1},
axes_inputs;
...
) -> RigidBodyProperty
RigidBodyProperty(
id::Integer,
contactable::Bool,
mass,
inertia_input,
mass_center_position::AbstractVector,
loci_positions::Array{StaticArraysCore.SArray{Tuple{N}, T, 1, N}, 1},
axes_inputs,
friction_coefficients;
...
) -> RigidBodyProperty
RigidBodyProperty(
id::Integer,
contactable::Bool,
mass,
inertia_input,
mass_center_position::AbstractVector,
loci_positions::Array{StaticArraysCore.SArray{Tuple{N}, T, 1, N}, 1},
axes_inputs,
friction_coefficients,
restitution_coefficients;
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
) -> RigidBodyStateRible.body_state2coords_state Function
body_state2coords_state(state, coords)Convert body state to coordinate state.
Rible.kinetic_energy Function
kinetic_energy(body, inst_state)Calculate kinetic energy of the body.
Rible.lazy_update_state! Function
lazy_update_state!(state, coords, cache, prop, inst_state)Update only position and velocity (lazy update).
Rible.potential_energy_field Function
potential_energy_field(body, field, inst_state)Calculate potential energy from field.
Rible.potential_energy_strain Function
potential_energy_strain(body)Calculate strain potential energy.
Rible.stretch_loci! Function
stretch_loci!(coords, cache, prop, inst_state)Update transformation matrices from deformation parameters.
Rible.update_inertia_cache! Function
update_inertia_cache!(cache, coords, prop, inst_state)Update inertia-related cache.
Rible.update_loci_states! Function
update_loci_states!(state, coords, cache, prop, inst_state)Update loci states using cached transformation matrices.
Rible.update_state! Function
update_state!(state, coords, cache, prop, inst_state)Update full state including rotation and angular velocity.
Rible.update_transformations! Function
update_transformations!(coords, cache, state, prop, inst_state)Update transformation matrices from coordinates.
Rible.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
) -> Any结构、约束与连接
Rible.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.kinetic_energy Method
Return System Kinetic energy
kinetic_energy(st::Rible.AbstractStructure) -> AnyRible.potential_energy_field Function
Return System potential energy
potential_energy_field(st::Rible.AbstractStructure) -> Any
potential_energy_field(
st::Rible.AbstractStructure,
field
) -> AnyRible.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
) -> Any