roboplan.roboplan_ext.core

Core roboplan module

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.

Box

Temporary wrapper struct to represent a box geometry.

Sphere

Temporary wrapper struct to represent a sphere geometry.

OcTree

Temporary wrapper struct to represent a octree geometry.

Scene

Primary scene representation for planning and control.

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.

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 roboplan.roboplan_ext.core.JointConfiguration
class roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.CartesianConfiguration
class roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.Box(x, y, z)

Temporary wrapper struct to represent a box geometry.

Parameters:
  • x (float)

  • y (float)

  • z (float)

class roboplan.roboplan_ext.core.Sphere(radius)

Temporary wrapper struct to represent a sphere geometry.

Parameters:

radius (float)

class roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.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 roboplan.roboplan_ext.core.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 full joint names, including mimic joints.

Return type:

list[str]

getActuatedJointNames()

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

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

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

applyMimics(q)

Applies mimic joint relationships to a position vector.

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)

Calculates forward kinematics for a specific frame.

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

  • frame_name (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 joint positions for the full robot state.

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='')

Get the joint position 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’)]]

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

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

roboplan.roboplan_ext.core.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')]]
roboplan.roboplan_ext.core.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.

roboplan.roboplan_ext.core.hasCollisionsAlongPath(scene, q_start, q_end, max_step_size, bisection=False)

Checks collisions along a specified configuration space path.

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)

Return type:

bool

class roboplan.roboplan_ext.core.PathShortcutter(scene, group_name)

Shortcuts joint paths with random sampling and checking connections.

Parameters:
  • scene (Scene)

  • group_name (str)

shortcut(path, max_step_size, max_iters=100, seed=0)

Attempts to shortcut a specified path.

Parameters:
  • path (JointPath)

  • max_step_size (float)

  • max_iters (int)

  • seed (int)

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]

roboplan.roboplan_ext.core.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’)]

roboplan.roboplan_ext.core.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’)]