compas_robots.model
¤
Classes¤
Axis
¤
Axis(xyz: str = '1 0 0', **kwargs)
Representation of an axis or vector.
Parameters:
-
xyz(str, default:'1 0 0') –3D coordinates of the axis, specified as a string of three space-separated floats (e.g.
"1 0 0"). The axis will be normalized to unit length if it is not the zero vector -
kwargs–Additional attributes to be stored in the axis.
Attributes:
-
x(float) –X coordinate.
-
y(float) –Y coordinate.
-
z(float) –Z coordinate.
-
attr(dict) –Additional axis attributes.
Attributes¤
Functions¤
transform
¤
transform(transformation: Transformation) -> None
Transform the axis in place.
Parameters:
-
transformation(Transformation) –The transformation used to transform the axis.
transformed
¤
transformed(transformation: Transformation) -> Vector
Return a transformed copy of the axis.
Parameters:
-
transformation(Transformation) –The transformation used to transform the axis.
Returns:
-
Vector–The transformed axis.
BoxProxy
¤
Proxy class that adds URDF functionality to an instance of Box.
This class is internal and not intended to be referenced externally.
Calibration
¤
Reference positions of the joint, used to calibrate the absolute position.
CapsuleProxy
¤
Proxy class that adds URDF functionality to an instance of Capsule.
This class is internal and not intended to be referenced externally.
Collision
¤
Collision(
geometry: LinkGeometry,
origin: Frame | None = None,
name: str | None = None,
**kwargs
)
Collidable description of a link.
Parameters:
-
geometry(LinkGeometry) –Shape of the collidable element.
-
origin(Frame | None, default:None) –Reference frame of the collidable element with respect to the reference frame of the link.
-
name(str | None, default:None) –Name of the collidable element.
-
kwargs–Non-standard attributes.
CylinderProxy
¤
Proxy class that adds URDF functionality to an instance of Cylinder.
This class is internal and not intended to be referenced externally.
Dynamics
¤
Physical properties of the joint used for simulation of dynamics.
Inertia
¤
Inertia(
ixx: float = 0.0,
ixy: float = 0.0,
ixz: float = 0.0,
iyy: float = 0.0,
iyz: float = 0.0,
izz: float = 0.0,
)
Rotational inertia matrix (3x3) represented in the inertia frame.
Since the rotational inertia matrix is symmetric, only 6 above-diagonal
elements of this matrix are specified here, using the attributes
ixx, ixy, ixz, iyy, iyz, izz.
Inertial
¤
Inertial properties of a link.
Parameters:
-
origin(Frame | None, default:None) –This is the pose of the inertial reference frame, relative to the link reference frame.
-
mass(Mass | None, default:None) –Mass of the link.
-
inertia(Inertia | None, default:None) –3x3 rotational inertia matrix, represented in the inertia frame.
Joint
¤
Joint(
name: str,
type: str | int | JointType,
parent: ParentLink | str,
child: ChildLink | str,
origin: Frame | None = None,
axis: Axis | None = None,
calibration: Calibration | None = None,
dynamics: Dynamics | None = None,
limit: Limit | None = None,
safety_controller: SafetyController | None = None,
mimic: Mimic | None = None,
**kwargs
)
Representation of the kinematics and dynamics of a joint and its safety limits.
Parameters:
-
name(str) –Unique name for the joint.
-
type(str | int | JointType) – -
origin(Frame | None, default:None) –Frame defining the transformation from the parent link to the child link frame.
-
parent(ParentLink | str) –Parent link instance or parent link name.
-
child(ChildLink | str) –Child link instance or name of child link.
-
axis(Axis | None, default:None) –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 | None, default:None) –Reference positions of the joint, used to calibrate the absolute position of the joint.
-
dynamics(Dynamics | None, default:None) –Physical properties of the joint. These values are used to specify modeling properties of the joint, particularly useful for simulation.
-
limit(Limit | None, default:None) –Joint limit properties.
-
safety_controller(SafetyController | None, default:None) –Safety controller properties.
-
mimic(Mimic | None, default:None) –Used to specify that the defined joint mimics another existing joint.
-
kwargs(dict, default:{}) –Non-standard attributes.
Attributes:
-
child_link(Link) –Joint's child link
-
position(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.
-
REVOLUTE(JointType) –Alias for
JointType.REVOLUTE. -
CONTINUOUS(JointType) –Alias for
JointType.CONTINUOUS. -
PRISMATIC(JointType) –Alias for
JointType.PRISMATIC. -
FIXED(JointType) –Alias for
JointType.FIXED. -
FLOATING(JointType) –Alias for
JointType.FLOATING. -
PLANAR(JointType) –Alias for
JointType.PLANAR. -
SUPPORTED_TYPES(tuple[str, ...]) –URDF string representations of the supported joint types.
Attributes¤
Functions¤
calculate_continuous_transformation
¤
calculate_fixed_transformation
¤
calculate_fixed_transformation(position: float) -> Transformation
Returns an identity transformation.
The fixed joint is is not really a joint because it cannot move. All degrees of freedom are locked.
Returns:
-
Transformation–Identity transformation.
calculate_floating_transformation
¤
calculate_floating_transformation(position: float) -> Transformation
Returns a transformation of a floating joint.
A floating joint allows motion for all 6 degrees of freedom.
calculate_planar_transformation
¤
calculate_planar_transformation(position: float) -> Transformation
Returns a transformation of a planar joint.
A planar joint allows motion in a plane perpendicular to the axis.
calculate_prismatic_transformation
¤
calculate_prismatic_transformation(position: float) -> Translation
Returns a transformation of a prismatic joint.
A prismatic joint slides along the axis and has a limited range specified by the upper and lower limits.
Parameters:
-
position(float) –Translation movement in meters.
Returns:
-
Transformation–Transformation of type translation for the prismatic joint.
calculate_revolute_transformation
¤
Returns a transformation of a revolute joint.
A revolute joint rotates about the axis and has a limited range specified by the upper and lower limits.
Parameters:
-
position(float) –Angle in radians.
Returns:
-
Transformation of type rotation for the revolute joint.–
calculate_transformation
¤
calculate_transformation(position: float) -> Transformation
Returns the transformation of the joint.
This function calls different calculate_*_transformation depends on self.type
Parameters:
-
position(float) –Position in radians or meters depending on the joint type.
scale
¤
scale(factor: float) -> None
Scale the joint origin and limit (only if scalable) by a given factor.
Parameters:
-
factor(float) –Scale factor.
transform
¤
transform(transformation: Transformation) -> None
Transform the joint in place.
Parameters:
-
transformation(Transformation) –The transformation used to transform the joint.
JointType
¤
Supported joint types as defined by URDF.
Members carry an integer value (used for storage and comparison) and a URDF-compatible string representation accessible via urdf_name. The enum can be constructed from either form:
Examples:
>>> JointType.REVOLUTE.urdf_name
'revolute'
>>> JointType.from_urdf("prismatic") is JointType.PRISMATIC
True
>>> JointType(0) is JointType.REVOLUTE
True
Limit
¤
Limit(
effort: float = 0.0,
velocity: float = 0.0,
lower: float = 0.0,
upper: float = 0.0,
**kwargs
)
Joint limit properties.
Parameters:
-
effort(float, default:0.0) –Maximum joint effort.
-
velocity(float, default:0.0) –Maximum joint velocity.
-
lower(float, default:0.0) –Lower joint limit (radians for revolute joints, meter for prismatic joints).
-
upper(float, default:0.0) –Upper joint limit (radians for revolute joints, meter for prismatic joints).
Link
¤
Link(
name: str,
type: str | None = None,
visual: Iterable[Visual] | None = (),
collision: Iterable[Collision] | None = (),
inertial: Inertial | None = None,
**kwargs
)
Link represented as a rigid body with an inertia, visual, and collision features.
Parameters:
-
name(str) –Name of the link itself.
-
type(str | None, default:None) –Link type. Undocumented in URDF, but used by PR2.
-
visual(Iterable[Visual] | None, default:()) –Visual properties of the link.
-
collision(Iterable[Collision] | None, default:()) –Collision properties of the link. This can be different from the visual properties of a link.
-
inertial(Inertial | None, default:None) –Inertial properties of the link.
-
kwargs–Non-standard attributes.
LinkGeometry
¤
LinkGeometry(
box: Box | None = None,
cylinder: Cylinder | None = None,
sphere: Sphere | None = None,
capsule: Capsule | None = None,
mesh: MeshDescriptor | None = None,
**kwargs
)
Geometrical description of the shape of a link.
Parameters:
-
box(Box | None, default:None) –A box shape primitive.
-
cylinder(Cylinder | None, default:None) –A cylinder shape primitive.
-
sphere(Sphere | None, default:None) –A sphere shape primitive.
-
capsule(Capsule | None, default:None) –A capsule shape primitive.
-
mesh(MeshDescriptor | None, default:None) –A descriptor of a mesh.
-
**kwargs–The keyword arguments (kwargs) collected in a dict. These allow using non-standard attributes absent in the URDF specification.
Attributes:
-
shape(object) –The shape of the geometry
-
attr(keyword arguments) –Additional attributes
Examples:
Material
¤
Material description.
Parameters:
-
name(str | None, default:None) –The name of the material.
-
color(Color | None, default:None) –The color of the material.
-
texture(Texture | None, default:None) –The filename of the texture.
Examples:
MeshDescriptor
¤
Description of a mesh.
Parameters:
-
filename(str) –The mesh' filename.
-
scale(str, default:'1.0 1.0 1.0') –The scale factors of the mesh in the x-, y-, and z-direction.
-
**kwargs–The keyword arguments (kwargs) collected in a dict. These allow using non-standard attributes absent in the URDF specification.
Attributes:
-
filename(str) –The mesh' filename.
-
scale([float, float, float]) –The scale factors of the mesh in the x-, y-, and z-direction.
-
meshes(list[[Mesh]]) –List of COMPAS geometric meshes.
Examples:
SafetyController
¤
Safety controller properties.
SphereProxy
¤
Proxy class that adds URDF functionality to an instance of Sphere.
This class is internal and not intended to be referenced externally.
Visual
¤
Visual(
geometry: LinkGeometry,
origin: Frame | None = None,
name: str | None = None,
material: Material | None = None,
**kwargs
)
Visual description of a link.
Parameters:
-
geometry(LinkGeometry) –Shape of the visual element.
-
origin(Frame | None, default:None) –Reference frame of the visual element with respect to the reference frame of the link.
-
name(str | None, default:None) –Name of the visual element.
-
material(Material | None, default:None) –Material of the visual element.
-
kwargs–Non-standard attributes.