Bodies and Origin

Body and Origin

ConstrainedDynamics.BodyType
mutable struct Body{T} <: ConstrainedDynamics.AbstractBody{T}

A Body is a component of a Mechanism.

Important attributes

• id: The unique ID of a body. Assigned when added to a Mechanism.
• name: The name of a body. The name is taken from a URDF or can be assigned by the user.
• m: The mass of a body.
• J: The inertia of a body.
• state: The state of a body. Contains all position and velocity information (see State).
• shape: The visualization shape of a body (see Shape).

Constructors

Body(m, J; name, shape)
Mesh(path, m, J; scale, kwargs...)
Box(x, y, z, m; kwargs...)
Cylinder(r, h, m; kwargs...)
Sphere(r, m; kwargs...)
Pyramid(w, h, m; kwargs...)
ConstrainedDynamics.OriginType
mutable struct Origin{T} <: ConstrainedDynamics.AbstractBody{T}

The Origin is the root of a Mechanism.

Important attributes

• id: The unique ID of the origin. Assigned when added to a Mechanism.
• name: The name of the origin. The name is taken from a URDF or can be assigned by the user.
• shape: The visualization shape of the origin (see Shape).

Constructors

Origin(; name, shape)
Origin{Type}(; name, shape)
Origin(body)

State

ConstrainedDynamics.StateType
mutable struct State{T}

The State contains the position and velocity information of a Body.

Important attributes

• xc: Continuous-time position (vector)
• qc: Continuous-time oritentation (quaternion)
• vc: Continuous-time velocity (vector)
• ωc: Continuous-time angular velocity (vector)
• xk: Knot-point positions (vector of vectors)
• qk: Knot-point orientations (vector of vectors)

Shape

ConstrainedDynamics.ShapeType
abstract type Shape{T}

A Shape is used for visualization of a Body. All Shapes have an xoffset and a qoffset parameter to specify the position and orientation offset between the actual Body and the visualized Shape.

Important attributes

• xoffset: The relative position offset (vector) between Body and Shape.
• qoffset: The relative orientation offset (quaternion) between Body and Shape.
• color: The color of the Shape.
ConstrainedDynamics.MeshType
mutable struct Mesh{T} <: ConstrainedDynamics.Shape{T}

A Mesh can be used to visualize arbitrary geometries.

Important attributes

• path: The path to the geometry file.
ConstrainedDynamics.BoxType
mutable struct Box{T} <: ConstrainedDynamics.Shape{T}

A Box.

Important attributes

• xyz: The box size in x, y, and z direction (vector).
ConstrainedDynamics.CylinderType
mutable struct Cylinder{T} <: ConstrainedDynamics.Shape{T}

A Cylinder along the z-axis.

Important attributes

• rh: The cylinder radius and height (vector).
ConstrainedDynamics.SphereType
mutable struct Sphere{T} <: ConstrainedDynamics.Shape{T}

A Sphere.

Important attributes

• r: The sphere radius.
ConstrainedDynamics.PyramidType
mutable struct Pyramid{T} <: ConstrainedDynamics.Shape{T}

A square Pyramid with a base in the x-y-plane.

• wh: The pyramid width and height (vector).