Skip to main content

Module joints

Module joints 

Source
Expand description

Joints and couplings: mates that say how one part may move against another, rather than only what touches what.

A joint holds a Connector of one part on a connector of another — an origin, an axis through it and a direction square to the axis that turns are measured from — and lets the second part turn about the first one’s axis, slide along it, or both, as its JointKind says. How far it is turned and slid are the joint’s coordinates: values of the program’s state, solved with the poses, so that a joint can be set to a value, held there, kept within limits, and coupled to another joint’s.

A coupling (CouplingKind) ties a coordinate of one joint to one of another — or of the same one — linearly: a gear pair, a rack and its pinion, a screw.

Like crate::residuals, every residual is computed in dual numbers.

Structs§

Connector
A joint’s end on a body, in that body’s frame — or, placed, where its body puts it: where its axis passes, the axis, and the direction its turns are measured from — unit vectors, the reference square to the axis.
CouplingKind
How a coupling ties its two joints’ coordinates: the second’s is the first’s times a factor — given by value as the transmission says, negated if reverse — plus offset, in the second’s units, degrees for an angle. Serializes flat: {"type": "gear", "value": 2.0, "reverse": true}.
JointKind
How a joint lets its second body move against its first: which joint of the table it is (Joint), and the limits of its coordinates. Serializes flat, the limits of only those limited, by name: {"type": "revolute", "limits": {"angle": {"min": -90.0, "max": 90.0}}}.
Limits
The limits a joint’s coordinate is kept within, either missing — an angle’s in degrees.

Enums§

Joint
The joints there are, each a row of one table — how it lets the second frame turn, and which motions it frees (Joint::frees): every joint is the second frame held on the first within those, so that one formulation (joint_residuals) holds them all.
Motion
One of the ways a joint may let its second frame move on its first: turning about the first frame’s z axis, or sliding along its z, x or y axis. Each it frees is a coordinate of the joint, called as it serializes (Motion::name).
Transmission
What a coupling transmits between its two joints: the motions of each it ties (Transmission::motions) and what its value is (CouplingKind::factor) — presets of one linear relation.
Turning
How a joint lets its second frame turn against its first.

Constants§

MOTIONS
How many motions there are: what a joint’s coordinates are indexed by.

Functions§

joint_residuals
The residuals of a joint of kind between a — the first part’s connector — and b, at the coordinates at (an angle in degrees), where they are: each a length, a direction’s scaled by the part’s size scale.
measure
Where the coordinates of a joint between a and b are, measured from where its ends are, by Motion::index: the angle b’s reference is turned from a’s about a’s axis, in degrees in (-180, 180], and how far b’s origin is along a’s axis, its reference and the direction square to both. Only a seed for a solve, which finds the exact values: read off midpoints.

Type Aliases§

Coordinates
A joint’s coordinates where they are, by Motion::index: zero for a motion it does not free.