Constraints
EqualityConstraint
ConstrainedDynamics.EqualityConstraint
— Typemutable struct EqualityConstraint{T, N, Nc, Cs} <: ConstrainedDynamics.AbstractConstraint{T, N}
An EqualityConstraint
is a component of a Mechanism
and is used to describe the kinematic relation between two or more Body
s. Typically, an EqualityConstraint
should not be created directly. Use the joint prototypes instead, for example:
EqualityConstraint(Revolute(body1, body2, rotation_axis)).
Important attributes
id
: The unique ID of a constraint. Assigned when added to aMechanism
.name
: The name of a constraint. The name is taken from a URDF or can be assigned by the user.parentid
: The ID of the parent body.childids
: The IDs of the child bodies.
Joint Prototypes
The functions below can be used to create joints between two bodies. Note that body1 can also be the origin. The following arguments are available for most joints:
axis
: The rotation axis or plane axis.p1
: The joint connection point for body1 in body1's framep2
: The joint connection point for body2 in body2's frameqoffsett
: The orientation offset of body2 relative to body1
ConstrainedDynamics.Cylindrical
— MethodCylindrical(body1, body2, axis; p1, p2, qoffset, spring, damper)
A cylindrical joint between two bodies.
ConstrainedDynamics.CylindricalFree
— MethodCylindricalFree(body1, body2, axis; p1, p2, spring, damper)
A cylindrical joint between two bodies with unconstrained orientation (point-on-line).
ConstrainedDynamics.Fixed
— MethodFixed(body1::AbstractBody, body2; p1, p2, qoffset)
A fixed connection between two bodies.
ConstrainedDynamics.FixedOrientation
— MethodFixedOrientation(body1, body2; qoffset, spring, damper)
Fixed orientation between two bodies (chicken's head).
ConstrainedDynamics.Floating
— MethodFloating(body1, body2; spring, damper)
An unconstrained connection between two bodies (connection between floating base and origin).
ConstrainedDynamics.Planar
— MethodPlanar(body1, body2, axis; p1, p2, qoffset, spring, damper)
A planar joint between two bodies.
ConstrainedDynamics.PlanarAxis
— MethodPlanarAxis(body1, body2, axis; p1, p2, qoffset, spring, damper)
A planar joint between two bodies with a rotation axis perpendicular to the plane (turtle bot).
ConstrainedDynamics.PlanarFree
— MethodPlanarFree(body1, body2, axis; p1, p2, spring, damper)
A planar joint between two bodies with unconstrained orientation.
ConstrainedDynamics.Prismatic
— MethodPrismatic(body1, body2, axis; p1, p2, qoffset, spring, damper)
A prismatic joint between two bodies.
ConstrainedDynamics.Revolute
— MethodRevolute(body1, body2, axis; p1, p2, qoffset, spring, damper)
A revolute joint between two bodies (pin, continuous, hinge joint).
ConstrainedDynamics.Spherical
— MethodSpherical(body1, body2; p1, p2, spring, damper)
A spherical joint between two bodies (ball-and-socket joint).