Bodies and Origin
Body and Origin
ConstrainedDynamics.Body — Typemutable 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 aMechanism.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 (seeState).shape: The visualization shape of a body (seeShape).
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.Origin — Typemutable 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 aMechanism.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 (seeShape).
Constructors
Origin(; name, shape)
Origin{Type}(; name, shape)
Origin(body)State
ConstrainedDynamics.State — Typemutable 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.Shape — Typeabstract 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) betweenBodyandShape.qoffset: The relative orientation offset (quaternion) betweenBodyandShape.color: The color of theShape.
ConstrainedDynamics.Mesh — Typemutable 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.Box — Typemutable struct Box{T} <: ConstrainedDynamics.Shape{T}A Box.
Important attributes
xyz: The box size in x, y, and z direction (vector).
ConstrainedDynamics.Cylinder — Typemutable struct Cylinder{T} <: ConstrainedDynamics.Shape{T}A Cylinder along the z-axis.
Important attributes
rh: The cylinder radius and height (vector).
ConstrainedDynamics.Sphere — Typemutable struct Sphere{T} <: ConstrainedDynamics.Shape{T}A Sphere.
Important attributes
r: The sphere radius.
ConstrainedDynamics.Pyramid — Typemutable struct Pyramid{T} <: ConstrainedDynamics.Shape{T}A square Pyramid with a base in the x-y-plane.
wh: The pyramid width and height (vector).