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)

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 (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:

CollidablePoint

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

jtype#

The type of the joint.

Type:

JointType

child#

The child link attached to the joint.

Type:

LinkDescription

parent#

The parent link attached to the joint.

Type:

LinkDescription

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.joint.JointType[source]#
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=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:

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:
  • consider. (The joint names to)

  • considered_joints (Sequence[str])

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