core._core_ext

Classes

JointConfiguration

Represents a robot joint configuration.

CartesianConfiguration

Represents a robot Cartesian configuration.

JointType

Enumeration that describes different types of joints.

JointLimits

Contains joint limit information.

JointMimicInfo

Contains joint mimic information.

JointInfo

Contains joint information relevant to motion planning and control.

JointGroupInfo

Contains information about a named group of joints.

JointPath

Contains a path of joint configurations.

JointTrajectory

Contains a trajectory of joint configurations.

CartesianPath

Contains a path of Cartesian configurations.

CartesianTrajectory

Contains a trajectory of Cartesian configurations.

Box

Temporary wrapper struct to represent a box geometry.

Sphere

Temporary wrapper struct to represent a sphere geometry.

Cylinder

Temporary wrapper struct to represent a cylinder geometry.

Mesh

Temporary wrapper struct to represent a triangle mesh geometry.

OcTree

Temporary wrapper struct to represent a octree geometry.

Scene

Primary scene representation for planning and control.

PathShortcuttingOptions

Options struct for path shortcutting.

PathShortcutter

Shortcuts joint paths with random sampling and checking connections.

Functions

computeFramePath(…)

Computes the Cartesian path of a specified frame using a vector of provided points.

hasCollisionsAlongPath(scene, q_start, q_end, ...[, ...])

Checks collisions along a specified configuration space path. Uses the Scene's own collision scratch, so it is not safe to call concurrently with other queries on the same Scene.

collapseContinuousJointPositions(scene, group_name, q_orig)

Collapses a joint position vector's continuous joints for downstream algorithms.

expandContinuousJointPositions(scene, group_name, q_orig)

Expands a joint position vector's continuous joints from downstream algorithms.

Module Contents

class core._core_ext.JointConfiguration
class core._core_ext.JointConfiguration(joint_names, positions)

Represents a robot joint configuration.

property joint_names: list[str]

The names of the joints.

Return type:

list[str]

property positions: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]

The joint positions, in the same order as the names.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

property velocities: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]

The joint velocities, in the same order as the names.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

property accelerations: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]

The joint accelerations, in the same order as the names.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

class core._core_ext.CartesianConfiguration
class core._core_ext.CartesianConfiguration(base_frame, tip_frame, tform)

Represents a robot Cartesian configuration.

property base_frame: str

The name of the base (or reference) frame.

Return type:

str

property tip_frame: str

The name of the tip (or target) frame.

Return type:

str

property tform: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, 4, order='F')]

The transformation matrix from the base to the tip frame.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order=’F’)]

class core._core_ext.JointType(*args, **kwds)

Bases: enum.Enum

Enumeration that describes different types of joints.

UNKNOWN = 0
PRISMATIC = 1
REVOLUTE = 2
CONTINUOUS = 3
PLANAR = 4
FLOATING = 5
class core._core_ext.JointLimits

Contains joint limit information.

property min_position: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]

The minimum positions of the joint.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

property max_position: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]

The maximum positions of the joint.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

property max_velocity: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]

The maximum (symmetric) velocities of the joint.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

property max_acceleration: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]

The maximum (symmetric) accelerations of the joint.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

property max_jerk: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]

The maximum (symmetric) jerks of the joint.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

class core._core_ext.JointMimicInfo

Contains joint mimic information.

property mimicked_joint_name: str

The name of the joint being mimicked.

Return type:

str

property scaling: float

The scaling factor for the mimic relationship.

Return type:

float

property offset: float

The offset for the mimic relationship.

Return type:

float

class core._core_ext.JointInfo(joint_type)

Contains joint information relevant to motion planning and control.

Parameters:

joint_type (JointType)

property type: JointType

The type of the joint.

Return type:

JointType

property num_position_dofs: int

The number of positional degrees of freedom.

Return type:

int

property num_velocity_dofs: int

The number of velocity degrees of freedom.

Return type:

int

property limits: JointLimits

The joint limit information for each degree of freedom.

Return type:

JointLimits

property mimic_info: JointMimicInfo | None

The joint mimic information.

Return type:

JointMimicInfo | None

class core._core_ext.JointGroupInfo

Contains information about a named group of joints.

property joint_names: list[str]

The joint names that make up the group.

Return type:

list[str]

property joint_indices: list[int]

The joint indices in the group.

Return type:

list[int]

property q_indices: Annotated[numpy.typing.NDArray[numpy.int32], dict(shape=None, order='C')]

The position vector indices in the group.

Return type:

Annotated[numpy.typing.NDArray[numpy.int32], dict(shape=(None, ), order=’C’)]

property v_indices: Annotated[numpy.typing.NDArray[numpy.int32], dict(shape=None, order='C')]

The velocity vector indices in the group.

Return type:

Annotated[numpy.typing.NDArray[numpy.int32], dict(shape=(None, ), order=’C’)]

property has_continuous_dofs: bool

Whether the group has any continuous degrees of freedom.

Return type:

bool

property nq_collapsed: int

The number of collapsed degrees of freedom.

Return type:

int

__repr__()
Return type:

str

class core._core_ext.JointPath

Contains a path of joint configurations.

property joint_names: list[str]

The list of joint names.

Return type:

list[str]

property positions: list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]]

The list of joint configuration positions.

Return type:

list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]]

__repr__()
Return type:

str

class core._core_ext.JointTrajectory

Contains a trajectory of joint configurations.

property joint_names: list[str]

The list of joint names.

Return type:

list[str]

property times: list[float]

The list of times.

Return type:

list[float]

property positions: list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]]

The list of joint positions.

Return type:

list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]]

property velocities: list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]]

The list of joint velocities.

Return type:

list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]]

property accelerations: list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]]

The list of joint acceleration.

Return type:

list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]]

__repr__()
Return type:

str

class core._core_ext.CartesianPath
class core._core_ext.CartesianPath(base_frames, tip_frames, tforms)

Contains a path of Cartesian configurations.

property base_frames: list[str]

The names of the base frames.

Return type:

list[str]

property tip_frames: list[str]

The names of the tip frames.

Return type:

list[str]

property tforms: list[list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, 4, order='F')]]]

The list of Cartesian transforms.

Return type:

list[list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order=’F’)]]]

__repr__()
Return type:

str

class core._core_ext.CartesianTrajectory
class core._core_ext.CartesianTrajectory(base_frames, tip_frames, times, tforms)

Contains a trajectory of Cartesian configurations.

property base_frames: list[str]

The names of the base frames.

Return type:

list[str]

property tip_frames: list[str]

The names of the tip frames.

Return type:

list[str]

property times: list[float]

The list of times.

Return type:

list[float]

property tforms: list[list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, 4, order='F')]]]

The list of Cartesian transforms.

Return type:

list[list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order=’F’)]]]

__repr__()
Return type:

str

class core._core_ext.Box(x, y, z)

Temporary wrapper struct to represent a box geometry.

Parameters:
  • x (float)

  • y (float)

  • z (float)

class core._core_ext.Sphere(radius)

Temporary wrapper struct to represent a sphere geometry.

Parameters:

radius (float)

class core._core_ext.Cylinder(radius, length)

Temporary wrapper struct to represent a cylinder geometry.

Parameters:
  • radius (float)

  • length (float)

class core._core_ext.Mesh(filename, scale=...)

Temporary wrapper struct to represent a triangle mesh geometry.

Parameters:
  • filename (str | os.PathLike)

  • scale (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=3, order='C')])

class core._core_ext.OcTree(boxes, resolution)

Temporary wrapper struct to represent a octree geometry.

Parameters:
  • boxes (collections.abc.Sequence[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=6, order='C')]])

  • resolution (float)

class core._core_ext.Scene(name: str, urdf_path: str | os.PathLike, srdf_path: str | os.PathLike, package_paths: collections.abc.Sequence[str | os.PathLike] = [], yaml_config_path: str | os.PathLike = ...)
class core._core_ext.Scene(name, urdf, srdf, package_paths=[], yaml_config_path=...)

Primary scene representation for planning and control.

getName()

Gets the scene’s name.

Return type:

str

getJointNames()

Gets the scene’s actuated joint names (non-mimic joints only).

Return type:

list[str]

getJointNamesWithMimics()

Gets the scene’s full joint names, including mimic joints.

Return type:

list[str]

getJointInfo(joint_name)

Gets the information for a specific joint.

Parameters:

joint_name (str)

Return type:

JointInfo

configurationDistance(q_start, q_end)

Gets the distance between two joint configurations.

Parameters:
  • q_start (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • q_end (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

Return type:

float

setRngSeed(seed)

Sets the seed for the random number generator (RNG).

Parameters:

seed (int)

Return type:

None

randomPositions()

Generates random positions for the robot model.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

randomCollisionFreePositions(max_samples=1000)

Generates random collision-free positions for the robot model.

Parameters:

max_samples (int)

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)] | None

hasCollisions(q, debug=False)

Checks collisions at specified joint positions.

Parameters:
  • q (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • debug (bool)

Return type:

bool

isValidConfiguration(q)

Checks if the specified joint positions are valid with respect to joint limits.

Parameters:

q (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

Return type:

bool

clampToValidConfiguration(q)

Clamps the specified joint positions to valid joint limits.

Parameters:

q (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

toFullJointPositions(group_name, q)

Converts partial joint positions to full joint positions.

Parameters:
  • group_name (str)

  • q (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

interpolate(q_start, q_end, fraction)

Interpolates between two joint configurations.

Parameters:
  • q_start (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • q_end (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • fraction (float)

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

integrate(q, v)

Integrates a velocity vector from a configuration using Lie group operations.

Parameters:
  • q (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • v (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

forwardKinematics(q, frame_name, base_frame='')

Calculates forward kinematics for a specific frame.

Parameters:
  • q (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • frame_name (str)

  • base_frame (str)

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order=’F’)]

computeFrameJacobian(q, frame_name, local=True)

Computes the frame Jacobian for a specific frame.

Parameters:
  • q (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • frame_name (str)

  • local (bool)

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, None), order=’F’)]

getFrameId(name)

Get the Pinocchio model ID of a frame by its name.

Parameters:

name (str)

Return type:

int

getJointGroupInfo(name)

Get the joint group information of a scene by its name.

Parameters:

name (str)

Return type:

JointGroupInfo

getCurrentJointPositions()

Get the current Pinocchio configuration vector (model.nq).

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

getCurrentJointPositionsWithMimics()

Get current joint positions in getJointNamesWithMimics() order, including mimic values.

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

setJointPositions(positions)

Set the joint positions for the full robot state.

Parameters:

positions (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

Return type:

None

getJointPositionIndices(joint_names)

Get the joint position indices for a set of joint names.

Parameters:

joint_names (collections.abc.Sequence[str])

Return type:

Annotated[numpy.typing.NDArray[numpy.int32], dict(shape=(None, ), order=’C’)]

getPositionLimitVectors(group_name='', collapsed=False)

Get the joint position limit vectors for a specified group.

Parameters:
  • group_name (str)

  • collapsed (bool)

Return type:

tuple[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)], Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]]

getVelocityLimitVectors(group_name='')

Get the joint velocity limit vectors for a specified group.

Parameters:

group_name (str)

Return type:

tuple[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)], Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]]

getAccelerationLimitVectors(group_name='')

Get the joint acceleration limit vectors for a specified group.

Parameters:

group_name (str)

Return type:

tuple[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)], Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]]

getJerkLimitVectors(group_name='')

Get the joint jerk limit vectors for a specified group.

Parameters:

group_name (str)

Return type:

tuple[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)], Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]]

addBoxGeometry(name, parent_frame, box, tform, color)

Adds a box geometry to the scene.

Parameters:
  • name (str)

  • parent_frame (str)

  • box (Box)

  • tform (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order='F')])

  • color (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, order='C')])

Return type:

None

addSphereGeometry(name, parent_frame, sphere, tform, color)

Adds a sphere geometry to the scene.

Parameters:
  • name (str)

  • parent_frame (str)

  • sphere (Sphere)

  • tform (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order='F')])

  • color (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, order='C')])

Return type:

None

addCylinderGeometry(name, parent_frame, cylinder, tform, color)

Adds a cylinder geometry to the scene.

Parameters:
  • name (str)

  • parent_frame (str)

  • cylinder (Cylinder)

  • tform (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order='F')])

  • color (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, order='C')])

Return type:

None

addMeshGeometry(name, parent_frame, mesh, tform, color)

Adds a triangle mesh geometry to the scene.

Parameters:
  • name (str)

  • parent_frame (str)

  • mesh (Mesh)

  • tform (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order='F')])

  • color (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, order='C')])

Return type:

None

addOcTreeGeometry(name, parent_frame, octree, tform, color)

Adds a octree geometry to the scene.

Parameters:
  • name (str)

  • parent_frame (str)

  • octree (OcTree)

  • tform (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order='F')])

  • color (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, order='C')])

Return type:

None

updateGeometryPlacement(name, parent_frame, tform)

Updates the placement of an object geometry in the scene.

Parameters:
  • name (str)

  • parent_frame (str)

  • tform (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order='F')])

Return type:

None

removeGeometry(name)

Removes a geometry from the scene.

Parameters:

name (str)

Return type:

None

getCollisionGeometryIDs(body)

Gets a list of collision geometry IDs corresponding to a specified body.

Parameters:

body (str)

Return type:

list[int]

setCollisions(body1, body2, enable)

Sets the allowable collisions for a pair of bodies in the model.

Parameters:
  • body1 (str)

  • body2 (str)

  • enable (bool)

Return type:

None

__repr__()
Return type:

str

core._core_ext.computeFramePath(scene: Scene, q_start: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')], q_end: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')], frame_name: str, max_step_size: float) list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, 4, order='F')]]
core._core_ext.computeFramePath(scene: Scene, q_vec: collections.abc.Sequence[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=None, order='C')]], frame_name: str) list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=4, 4, order='F')]]

Computes the Cartesian path of a specified frame using a vector of provided points.

core._core_ext.hasCollisionsAlongPath(scene, q_start, q_end, max_step_size, bisection=False, check_endpoints=True)

Checks collisions along a specified configuration space path. Uses the Scene’s own collision scratch, so it is not safe to call concurrently with other queries on the same Scene.

Parameters:
  • scene (Scene)

  • q_start (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • q_end (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • max_step_size (float)

  • bisection (bool)

  • check_endpoints (bool)

Return type:

bool

class core._core_ext.PathShortcuttingOptions(group_name='', max_step_size=0.05, max_iters=100, seed=0, max_convergence_iters=20, redundant_removal_iters=20)

Options struct for path shortcutting.

Parameters:
  • group_name (str)

  • max_step_size (float)

  • max_iters (int)

  • seed (int)

  • max_convergence_iters (int)

  • redundant_removal_iters (int)

property group_name: str

The joint group name to be used for path shortcutting.

Return type:

str

property max_step_size: float

Maximum step size used in collision checking, and the minimum separable distance between points in a shortcut.

Return type:

float

property max_iters: int

Maximum number of iterations of random sampling.

Return type:

int

property seed: int

Seed for the random generator. If < 0, a random seed is used.

Return type:

int

property max_convergence_iters: int

Stop early once this many consecutive iterations fail to apply a shortcut. A value of 0 disables early stopping.

Return type:

int

property redundant_removal_iters: int

Cadence (in iterations) at which to interleave the redundant-vertex removal pass that cleans up the micro-segments introduced by shortcutting.

Return type:

int

class core._core_ext.PathShortcutter(scene, options)

Shortcuts joint paths with random sampling and checking connections.

Parameters:
shortcut(path)

Attempts to shortcut a specified path.

Parameters:

path (JointPath)

Return type:

JointPath

getPathLengths(path)

Computes configuration distances from the start to each pose in a path.

Parameters:

path (JointPath)

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

getNormalizedPathScaling(path)

Computes length-normalized scaling values along a JointPath.

Parameters:

path (JointPath)

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

getConfigurationfromNormalizedPathScaling(path, path_scalings, value)

Gets joint configurations from a path with normalized joint scalings.

Parameters:
  • path (JointPath)

  • path_scalings (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

  • value (float)

Return type:

tuple[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)], int]

core._core_ext.collapseContinuousJointPositions(scene, group_name, q_orig)

Collapses a joint position vector’s continuous joints for downstream algorithms.

Parameters:
  • scene (Scene)

  • group_name (str)

  • q_orig (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]

core._core_ext.expandContinuousJointPositions(scene, group_name, q_orig)

Expands a joint position vector’s continuous joints from downstream algorithms.

Parameters:
  • scene (Scene)

  • group_name (str)

  • q_orig (Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')])

Return type:

Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order=’C’)]