Joint
- class compas.robots.Joint(name, type, parent, child, origin=None, axis=None, calibration=None, dynamics=None, limit=None, safety_controller=None, mimic=None, **kwargs)[source]
Bases:
compas.data.data.Data
Representation of the kinematics and dynamics of a joint and its safety limits.
- Attributes
name (
str
) – Unique name for the joint.type (
str
orint
) – Joint type either as a string or an index number. See class attributes for named constants and supported types.origin (
Origin
) – Transformation from the parent link to the child link frame.parent (
ParentLink
or str) – Parent link instance or parent link name.child (
ChildLink
or str) – Child link instance or name of child link.axis (
Axis
) – Joint axis specified in the joint frame. Represents the axis of rotation for revolute joints, the axis of translation for prismatic joints, and the surface normal for planar joints. The axis is specified in the joint frame of reference.calibration (
Calibration
) – Reference positions of the joint, used to calibrate the absolute position of the joint.dynamics (
Dynamics
) – Physical properties of the joint. These values are used to specify modeling properties of the joint, particularly useful for simulation.limit (
Limit
) – Joint limit properties.safety_controller (
SafetyController
) – Safety controller properties.mimic (
Mimic
) – Used to specify that the defined joint mimics another existing joint.attr (
dict
) – Non-standard attributes.child_link (
Link
) – Joint’s child linkposition (
float
) – The current position of the joint. This depends on the joint type, i.e. for revolute joints, it will be the rotation angle in radians, for prismatic joints the translation in meters.
- Class Attributes
REVOLUTE (
int
) – Revolute joint type.CONTINUOUS (
int
) – Continuous joint type.PRISMATIC (
int
) – Prismatic joint type.FIXED (
int
) – Fixed joint type.FLOATING (
int
) – Floating joint type.PLANAR (
int
) – Planar joint type.SUPPORTED_TYPES (
list
ofstr
) – String representations of the supported joint types.
Methods
calculate_continuous_transformation
(position)Returns a transformation of a continuous joint.
calculate_fixed_transformation
(position)Returns an identity transformation.
calculate_floating_transformation
(position)Returns a transformation of a floating joint.
calculate_planar_transformation
(position)Returns a transformation of a planar joint.
calculate_prismatic_transformation
(position)Returns a transformation of a prismatic joint.
calculate_revolute_transformation
(position)Returns a transformation of a revolute joint.
calculate_transformation
(position)Returns the transformation of the joint.
copy
([cls])Make an independent copy of the data object.
from_data
(data)from_json
(filepath)Construct an object from serialized data contained in a JSON file.
from_jsonstring
(string)Construct an object from serialized data contained in a JSON string.
Returns
True
if the joint can be configured, otherwiseFalse
.Returns
True
if the joint can be scaled, otherwiseFalse
.scale
(factor)Scale the joint origin and limit (only if scalable) by a given factor.
to_data
()Convert an object to its native data representation.
to_json
(filepath[, pretty])Serialize the data representation of an object to a JSON file.
to_jsonstring
([pretty])Serialize the data representation of an object to a JSON string.
transform
(transformation)Transform the joint in place.
Validate the object's data against its data schema (self.DATASCHEMA).
Validate the object's data against its json schema (self.JSONSCHEMA).