Skip to content

API

此页面按功能模块汇总 Rible 的主要 API(自动从 docstring 生成)。

坐标系统

Rible.add_joint_forces_jacobian! Function
julia
add_joint_forces_jacobian!(jacobian, coords, ...)

Get joint forces jacobian.

Rible.build_joint_cache Function
julia
build_joint_cache(coords, ...)

Build joint cache for coordinate system.

Rible.cartesian_frame2coords Method
julia
cartesian_frame2coords(coords, frame)

Convert cartesian frame to coordinates.

Rible.find_angular_velocity Method
julia
find_angular_velocity(coords, q, q̇)

Find angular velocity from coordinates and velocities.

Rible.find_independent_free_idx Method
julia
find_independent_free_idx(coords, ...)

Find independent free indices.

Rible.find_local_angular_velocity Method
julia
find_local_angular_velocity(coords, q, q̇)

Find local angular velocity from coordinates and velocities.

Rible.find_rotation Method
julia
find_rotation(coords, q)

Find rotation matrix from coordinates.

Rible.get_deform Method
julia
get_deform(coords)

Get deformation parameters.

Rible.get_joint_jacobian! Function
julia
get_joint_jacobian!(jacobian, coords, ...)

Get joint constraint jacobian.

Rible.get_joint_velocity_jacobian! Function
julia
get_joint_velocity_jacobian!(jacobian, coords, ...)

Get joint velocity jacobian.

Rible.get_joint_violations! Function
julia
get_joint_violations!(violations, coords, ...)

Get joint constraint violations.

Rible.get_num_of_local_dims Method
julia
get_num_of_local_dims(coords)

Return the number of local dimensions.

Rible.kinetic_energy_coords Function
julia
kinetic_energy_coords(coords, ...)

Calculate kinetic energy from coordinates.

Rible.nullspace_mat Method
julia
nullspace_mat(coords, ...)

Get nullspace matrix.

Rible.to_local_coords Method
julia
to_local_coords(coords, r̄)

Transform global coordinates to local coordinates.

Rible.to_position Method
julia
to_position(coords, q, c)

Get position from coordinates and local parameters.

Rible.to_position_jacobian Method
julia
to_position_jacobian(coords, c)

Get position jacobian with respect to coordinates.

Rible.to_velocity_jacobian Method
julia
to_velocity_jacobian(coords, q, q̇, c)

Get velocity jacobian with respect to coordinates.

体(Bodies)

Rible.RigidBody Type

Rigid Body Type

julia
struct RigidBody{N, M, T, L, coordsType, cacheType, meshType} <: Rible.AbstractRigidBody{N, T}

  • prop::RigidBodyProperty: Rigid Body Property

  • state::RigidBodyState: Rigid Body State

  • coords::Any: Coordinates State

  • cache::Any: Cache

  • mesh::Any: Rigid Body Mesh

Rible.RigidBodyCache Type

Rigid Body Cache Type.

julia
struct RigidBodyCache{CType, cacheType, jacType} <: Rible.AbstractBodyCache

  • Co::Any

  • Cg::Any

  • Cps::Vector

  • inertia_cache::Any

  • jac_cache::Any

Rible.RigidBodyProperty Type

Rigid Body Property Type

julia
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 system

  • type::Symbol: Type or name.

  • mass::Any: Mass

  • inertia::StaticArraysCore.SMatrix{N, N} where N: Inertia

  • mass_locus::Rible.Locus: Centroid in local frame

  • loci::Array{Rible.Locus{N, T, L}, 1} where {N, T, L}: Anchor points in local frame

Rible.RigidBodyProperty Method

Rigid Body Property Constructor

julia
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
) -> RigidBodyProperty
Rible.RigidBodyState Type

Rigid Body State Mutable Type.

julia
mutable struct RigidBodyState{N, M, T, L} <: Rible.AbstractRigidBodyState{N, T}

  • origin_frame::Rible.CartesianFrame: Origin of local frame

  • mass_locus_state::Rible.LocusState: Position of mass center in global frame

  • loci_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

julia
RigidBodyState(
    prop::RigidBodyProperty{N, T},
    origin_position_input,
    rotation_input,
    origin_velocity_input,
    angular_velocity_input
) -> RigidBodyState

Rible.body_state2coords_state Function
julia
body_state2coords_state(state, coords)

Convert body state to coordinate state.

Rible.get_inertia Function
julia
get_inertia(body)

Get inertia tensor of the body.

Rible.get_mass Function
julia
get_mass(body)

Get mass of the body.

Rible.kinetic_energy Function
julia
kinetic_energy(body, inst_state)

Calculate kinetic energy of the body.

Rible.lazy_update_state! Function
julia
lazy_update_state!(state, coords, cache, prop, inst_state)

Update only position and velocity (lazy update).

Rible.potential_energy_field Function
julia
potential_energy_field(body, field, inst_state)

Calculate potential energy from field.

Rible.potential_energy_strain Function
julia
potential_energy_strain(body)

Calculate strain potential energy.

Rible.strain! Function
julia
strain!(F, prop, coords, state, cache)

Calculate strain from body state.

Rible.stretch_loci! Function
julia
stretch_loci!(coords, cache, prop, inst_state)

Update transformation matrices from deformation parameters.

Rible.update_inertia_cache! Function
julia
update_inertia_cache!(cache, coords, prop, inst_state)

Update inertia-related cache.

Rible.update_loci_states! Function
julia
update_loci_states!(state, coords, cache, prop, inst_state)

Update loci states using cached transformation matrices.

Rible.update_state! Function
julia
update_state!(state, coords, cache, prop, inst_state)

Update full state including rotation and angular velocity.

Rible.update_transformations! Function
julia
update_transformations!(coords, cache, state, prop, inst_state)

Update transformation matrices from coordinates.

Rible.clear_forces! Method

Clear Rigid Body Forces and torques.

julia
clear_forces!(body::Rible.AbstractRigidBody) -> Any
Rible.kinetic_energy Method

Return Rigid Body kinetic energy.

julia
kinetic_energy(body::Rible.AbstractRigidBody{2, T}) -> Any
Rible.kinetic_energy Method

Return Rigid Body kinetic energy.

julia
kinetic_energy(body::Rible.AbstractRigidBody{3, T}) -> Any
Rible.potential_energy_field Method

Return Rigid Body gravity potential energy.

julia
potential_energy_field(
    body::RigidBody,
    field::Rible.Gravity,
    q
) -> Any
Rible.potential_energy_strain Method

Return Rigid Body Strain potential energy.

julia
potential_energy_strain(
    body::Rible.AbstractRigidBody
) -> Any

结构、约束与连接

Rible.get_num_of_cstr Method

Return the system's number of constraints.

julia
get_num_of_cstr(st::Rible.AbstractStructure) -> Any
Rible.get_num_of_dims Method

Return System dimensions

julia
get_num_of_dims(st::Rible.AbstractStructure) -> Any
Rible.kinetic_energy Method

Return System Kinetic energy

julia
kinetic_energy(st::Rible.AbstractStructure) -> Any
Rible.potential_energy_field Function

Return System potential energy

julia
potential_energy_field(st::Rible.AbstractStructure) -> Any
potential_energy_field(
    st::Rible.AbstractStructure,
    field
) -> Any
Rible.apply_field! Method
julia
apply_field!(
    structure::Rible.AbstractStructure,
    field::Rible.AbstractField
) -> Any
Rible.field_jacobian! Method
julia
field_jacobian!(
    ∂F∂q,
    structure::Rible.AbstractStructure,
    field::Rible.AbstractField
) -> Any

力元件、关节与广义力

环境与接触

控制(Policies / Actuators / Gauges / Costs)

动力学求解器与灵敏度分析

机器人与后处理

Rible.reset! Method

Reset System State.

julia
reset!(bot::Rible.Robot) -> Any