Parsers#
- class jaxsim.parsers.descriptions.collision.BoxCollision(collidable_points, center)[source]#
Represents a box-shaped collision shape.
- Parameters:
collidable_points (tuple[CollidablePoint])
center (Array | ndarray | bool | number | bool | int | float | complex | tuple)
- center#
The center of the box in the local frame of the collision shape.
- class jaxsim.parsers.descriptions.collision.CollidablePoint(parent_link, position=<factory>, enabled=True)[source]#
Represents a collidable point associated with a parent link.
- Parameters:
parent_link (LinkDescription)
position (ndarray[Any, dtype[_ScalarType_co]])
enabled (bool)
- parent_link#
The parent link to which the collidable point is attached.
- position#
The position of the collidable point relative to the parent link.
- enabled#
A flag indicating whether the collidable point is enabled for collision detection.
- change_link(new_link, new_H_old)[source]#
Move the collidable point to a new parent link.
- Parameters:
new_link (LinkDescription) – The new parent link to which the collidable point is moved.
new_H_old (npt.NDArray) – The transformation matrix from the new link’s frame to the old link’s frame.
- Returns:
A new collidable point associated with the new parent link.
- Return type:
- class jaxsim.parsers.descriptions.collision.CollisionShape(collidable_points)[source]#
Abstract base class for representing collision shapes.
- Parameters:
collidable_points (tuple[CollidablePoint])
- collidable_points#
A list of collidable points associated with the collision shape.
- class jaxsim.parsers.descriptions.collision.SphereCollision(collidable_points, center)[source]#
Represents a spherical collision shape.
- Parameters:
collidable_points (tuple[CollidablePoint])
center (Array | ndarray | bool | number | bool | int | float | complex | tuple)
- center#
The center of the sphere in the local frame of the collision shape.
- class jaxsim.parsers.descriptions.joint.JointDescription(name, axis, pose, jtype, child=<function dataclass.<locals>.wrap>, parent=<function dataclass.<locals>.wrap>, index=None, friction_static=0.0, friction_viscous=0.0, position_limit_damper=0.0, position_limit_spring=0.0, position_limit=(0.0, 0.0), initial_position=0.0, motor_inertia=0.0, motor_viscous_friction=0.0, motor_gear_ratio=1.0)[source]#
In-memory description of a robot link.
- Parameters:
name (Annotated[str, '__jax_dataclasses_static_field__'])
axis (Array)
pose (Array)
jtype (Annotated[float | Array | ndarray | bool | number | bool | int | complex, '__jax_dataclasses_static_field__'])
child (LinkDescription)
parent (LinkDescription)
index (float | Array | ndarray | bool | number | bool | int | complex | None)
friction_static (float | Array | ndarray | bool | number | bool | int | complex)
friction_viscous (float | Array | ndarray | bool | number | bool | int | complex)
position_limit_damper (float | Array | ndarray | bool | number | bool | int | complex)
position_limit_spring (float | Array | ndarray | bool | number | bool | int | complex)
position_limit (tuple[float | Array | ndarray | bool | number | bool | int | complex, float | Array | ndarray | bool | number | bool | int | complex])
initial_position (float | Array | ndarray | bool | number | bool | int | complex | tuple)
motor_inertia (float | Array | ndarray | bool | number | bool | int | complex)
motor_viscous_friction (float | Array | ndarray | bool | number | bool | int | complex)
motor_gear_ratio (float | Array | ndarray | bool | number | bool | int | complex)
- name#
The name of the joint.
- Type:
str
- axis#
The axis of rotation or translation for the joint.
- Type:
npt.NDArray
- pose#
The pose transformation matrix of the joint.
- Type:
npt.NDArray
- child#
The child link attached to the joint.
- Type:
- parent#
The parent link attached to the joint.
- Type:
- index#
An optional index for the joint.
- Type:
Optional[int]
- friction_static#
The static friction coefficient for the joint.
- Type:
float
- friction_viscous#
The viscous friction coefficient for the joint.
- Type:
float
- position_limit_damper#
The damper coefficient for position limits.
- Type:
float
- position_limit_spring#
The spring coefficient for position limits.
- Type:
float
- position_limit#
The position limits for the joint.
- Type:
Tuple[float, float]
- initial_position#
The initial position of the joint.
- Type:
Union[float, npt.NDArray]
- class jaxsim.parsers.descriptions.joint.JointGenericAxis(axis)[source]#
A joint requiring the specification of a 3D axis.
- Parameters:
axis (Array)
- class jaxsim.parsers.descriptions.link.LinkDescription(name, mass, inertia, index=None, parent=None, pose=<factory>, children=<factory>)[source]#
In-memory description of a robot link.
- Parameters:
name (Annotated[str, '__jax_dataclasses_static_field__'])
mass (float)
inertia (Array)
index (int | None)
parent (LinkDescription | None)
pose (Array)
children (Annotated[tuple[LinkDescription], '__jax_dataclasses_static_field__'])
- name#
The name of the link.
- mass#
The mass of the link.
- inertia#
The inertia tensor of the link.
- index#
An optional index for the link (it gets automatically assigned).
- parent#
The parent link of this link.
- pose#
The pose transformation matrix of the link.
- children#
The children links.
- lump_with(link, lumped_H_removed)[source]#
Combine the current link with another link, preserving mass and inertia.
- Parameters:
link (
LinkDescription
) – The link to combine with.lumped_H_removed (
Array
) – The transformation matrix between the two links.
- Return type:
- Returns:
The combined link.
- property name_and_index: str#
Get a formatted string with the link’s name and index.
- Returns:
The formatted string.
- Return type:
str
- class jaxsim.parsers.descriptions.model.ModelDescription(root, frames=<factory>, joints=<factory>, root_pose=<factory>, _extra_info=<factory>, _joints_removed=<factory>, name=None, fixed_base=True, collision_shapes=<factory>)[source]#
Intermediate representation representing the kinematic graph of a robot model.
- Parameters:
root (LinkDescription)
frames (list[LinkDescription])
joints (list[JointDescription])
root_pose (RootPose)
_extra_info (dict[str, Any])
_joints_removed (list[JointDescription])
name (str)
fixed_base (bool)
collision_shapes (tuple[CollisionShape, ...])
- name#
The name of the model.
- fixed_base#
Whether the model is either fixed-base or floating-base.
- collision_shapes#
List of collision shapes associated with the model.
- all_enabled_collidable_points()[source]#
Get all enabled collidable points in the model.
- Return type:
list
[CollidablePoint
]- Returns:
The list of all enabled collidable points.
- static build_model_from(name, links, joints, frames=None, collisions=(), fixed_base=False, base_link_name=None, considered_joints=None, model_pose=RootPose(root_position=array([0., 0., 0.]), root_quaternion=array([1., 0., 0., 0.])))[source]#
Build a model description from provided components.
- Parameters:
name (
str
) – The name of the model.links (
list
[LinkDescription
]) – List of link descriptions.joints (
list
[JointDescription
]) – List of joint descriptions.frames (
list
[LinkDescription
] |None
) – List of frame descriptions.collisions (
tuple
[CollisionShape
,...
]) – List of collision shapes associated with the model.fixed_base (
bool
) – Indicates whether the model has a fixed base.base_link_name (
str
|None
) – Name of the base link (i.e. the root of the kinematic tree).considered_joints (
Sequence
[str
] |None
) – List of joint names to consider (by default all joints).model_pose (
RootPose
) – Pose of the model’s root (by default an identity transform).
- Return type:
- Returns:
A ModelDescription instance representing the model.
- collision_shape_of_link(link_name)[source]#
Get the collision shape associated with a specific link.
- Parameters:
link_name (
str
) – The name of the link.- Return type:
- Returns:
The collision shape associated with the link.