Interface
Initialization
The unused kwargs of initialization functions are set to zero.
ConstrainedDynamics.setPosition!
— MethodsetPosition!(body1, body2; p1, p2, Δx, Δq)
Set the position and orientation of body2 relative to body1 at the connection points p1 and p2.
ConstrainedDynamics.setPosition!
— MethodsetPosition!(body; x, q)
Set the position and orientation of a body.
ConstrainedDynamics.setPosition!
— MethodsetPosition!(origin, body2; p1, p2, Δx, Δq)
Set the position and orientation of body2 relative to the origin at the connection points p1 and p2.
ConstrainedDynamics.setVelocity!
— MethodsetVelocity!(body1, body2; p1, p2 Δv, Δω)
Set the translational and angular velocity of body2 relative to body1 at the connection points p1 and p2.
ConstrainedDynamics.setVelocity!
— MethodsetVelocity!(body; v, ω)
Set the translational and angular velocity of a body.
ConstrainedDynamics.setVelocity!
— MethodsetVelocity!(origin, body2; p1, p2 Δv, Δω)
Set the translational and angular velocity of body2 relative to the origin at the connection points p1 and p2.
Indexing
The following functions can be used to get bodies and constraints from a mechanism.
ConstrainedDynamics.getbody
— Methodgetbody!(mechanism, id)
Gets the body with ID id
from mechanism
if it exists. If id = nothing
, the origin will be returned.
ConstrainedDynamics.getbody
— Methodgetbody!(mechanism, name)
Gets the body with name name
from mechanism
if it exists.
ConstrainedDynamics.getcomponent
— Methodgetcomponent!(mechanism, name)
Gets the component (body or equality constraint) with name name
from mechanism
if it exists.
ConstrainedDynamics.getcomponent
— Methodgetcomponent(mechanism, id)
Gets the component (body or equality constraint) with ID id
from mechanism
if it exists.
ConstrainedDynamics.geteqconstraint
— Methodgeteqconstraint!(mechanism, id)
Gets the equality constraint with ID id
from mechanism
if it exists.
ConstrainedDynamics.geteqconstraint
— Methodgeteqconstraint!(mechanism, name)
Gets the equality constraint with name name
from mechanism
if it exists.
Minimal Coordinates
The state of a mechanism ist stored in maximal coordinates, i.e. the position and orientation of each body. Minimal coordinates (generalized, joint coordinates) can be set and retrived from constraints with the following functions.
ConstrainedDynamics.minimalCoordinates
— MethodminimalCoordinates(mechanism, eqconstraint)
Gets the minimal coordinates of joint eqconstraint
.
ConstrainedDynamics.minimalVelocities
— MethodminimalVelocities(mechanism, eqconstraint)
Gets the minimal coordinate velocities of joint eqconstraint
.
ConstrainedDynamics.setForce!
— MethodsetForce!(mechanism, eqconstraint, Fτ)
Sets the minimal coordinate forces (vector) of joint eqconstraint
.
Prismatic joint example: setVelocity!(mechanism, geteqconstraint(mechanism, jointid), [-1.0])
ConstrainedDynamics.setPosition!
— MethodsetPosition!(mechanism, eqconstraint, xθ)
Sets the minimal coordinates (vector) of joint eqconstraint
.
Revolute joint example: setPosition!(mechanism, geteqconstraint(mechanism, "joint_name"), [pi/2])
ConstrainedDynamics.setVelocity!
— MethodsetVelocity!(mechanism, eqconstraint, vω)
Sets the minimal coordinate velocities (vector) of joint eqconstraint
.
Planar joint example: setVelocity!(mechanism, geteqconstraint(mechanism, jointid), [0.5;2.0])