Parsers#

class jaxsim.parsers.descriptions.collision.BoxCollision(collidable_points, center)[source]#

Represents a box-shaped collision shape.

Parameters:
  • collidable_points (tuple[CollidablePoint])

  • center (tuple[float, float, float])

center#

The center of the box in the local frame of the collision shape.

class jaxsim.parsers.descriptions.collision.CollidablePoint(parent_link, enabled=True, _position=(0.0, 0.0, 0.0))[source]#

Represents a collidable point associated with a parent link.

Parameters:

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.

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 (ndarray[tuple[int, ...], dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]) – 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:

CollidablePoint

property position: ndarray[tuple[int, ...], dtype[_ScalarType_co]]#

Get the position of the collidable point.

Returns:

The position of the collidable point.

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.MeshCollision(collidable_points, center)[source]#

Represents a mesh-shaped collision shape.

Parameters:
  • collidable_points (tuple[CollidablePoint])

  • center (tuple[float, float, float])

center#

The center of the mesh in the local frame of the collision shape.

class jaxsim.parsers.descriptions.collision.SphereCollision(collidable_points, center)[source]#

Represents a spherical collision shape.

Parameters:
  • collidable_points (tuple[CollidablePoint])

  • center (tuple[float, float, float])

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=<factory>, parent=<factory>, 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 joint.

Parameters:
  • name (str)

  • _axis (tuple[float])

  • _pose (tuple[float])

  • jtype (int)

  • child (LinkDescription)

  • parent (LinkDescription)

  • index (int | None)

  • friction_static (float)

  • friction_viscous (float)

  • position_limit_damper (float)

  • position_limit_spring (float)

  • position_limit (tuple[float, float])

  • _initial_position (float | tuple[float])

  • motor_inertia (float)

  • motor_viscous_friction (float)

  • motor_gear_ratio (float)

name#

The name of the joint.

axis#

The axis of rotation or translation for the joint.

pose#

The pose transformation matrix of the joint.

jtype#

The type of the joint.

child#

The child link attached to the joint.

parent#

The parent link attached to the joint.

index#

An optional index for the joint.

friction_static#

The static friction coefficient for the joint.

friction_viscous#

The viscous friction coefficient for the joint.

position_limit_damper#

The damper coefficient for position limits.

position_limit_spring#

The spring coefficient for position limits.

position_limit#

The position limits for the joint.

initial_position#

The initial position of the joint.

property axis: ndarray[tuple[int, ...], dtype[_ScalarType_co]]#

Get the axis of the joint.

Returns:

The axis of the joint.

Return type:

npt.NDArray

property initial_position: float | ndarray[tuple[int, ...], dtype[_ScalarType_co]]#

Get the initial position of the joint.

Returns:

The initial position of the joint.

property pose: ndarray[tuple[int, ...], dtype[_ScalarType_co]]#

Get the pose of the joint.

Returns:

The pose of the joint.

class jaxsim.parsers.descriptions.joint.JointType[source]#

Enumeration of joint types.

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:
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=(0.0, 0.0, 0.0), _root_quaternion=(1.0, 0.0, 0.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:

ModelDescription

Returns:

A ModelDescription instance representing the model.

Get the collision shape associated with a specific link.

Parameters:

link_name (str) – The name of the link.

Return type:

CollisionShape

Returns:

The collision shape associated with the link.

reduce(considered_joints)[source]#

Reduce the model by removing specified joints.

Parameters:

considered_joints (Sequence[str]) – Sequence of joint names to consider.

Return type:

ModelDescription

Returns:

A ModelDescription instance that only includes the considered joints.

Enable or disable collision shapes associated with a link.

Parameters:
  • link_name (str) – The name of the link.

  • enabled (bool) – Enable or disable collision shapes associated with the link.

Return type:

None