core ==== .. py:module:: core Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/core/_core_ext/index Classes ------- .. autoapisummary:: core.JointConfiguration core.CartesianConfiguration core.JointType core.JointLimits core.JointMimicInfo core.JointInfo core.JointGroupInfo core.JointPath core.JointTrajectory core.CartesianPath core.CartesianTrajectory core.Box core.Sphere core.Cylinder core.Mesh core.OcTree core.Scene core.PathShortcuttingOptions core.PathShortcutter Functions --------- .. autoapisummary:: core.computeFramePath core.hasCollisionsAlongPath core.collapseContinuousJointPositions core.expandContinuousJointPositions Package Contents ---------------- .. py:class:: JointConfiguration JointConfiguration(joint_names, positions) Represents a robot joint configuration. .. py:property:: joint_names :type: list[str] The names of the joints. .. py:property:: positions :type: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')] The joint positions, in the same order as the names. .. py:property:: velocities :type: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')] The joint velocities, in the same order as the names. .. py:property:: accelerations :type: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')] The joint accelerations, in the same order as the names. .. py:class:: CartesianConfiguration CartesianConfiguration(base_frame, tip_frame, tform) Represents a robot Cartesian configuration. .. py:property:: base_frame :type: str The name of the base (or reference) frame. .. py:property:: tip_frame :type: str The name of the tip (or target) frame. .. py:property:: tform :type: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order='F')] The transformation matrix from the base to the tip frame. .. py:class:: JointType(*args, **kwds) Bases: :py:obj:`enum.Enum` Enumeration that describes different types of joints. .. py:attribute:: UNKNOWN :value: 0 .. py:attribute:: PRISMATIC :value: 1 .. py:attribute:: REVOLUTE :value: 2 .. py:attribute:: CONTINUOUS :value: 3 .. py:attribute:: PLANAR :value: 4 .. py:attribute:: FLOATING :value: 5 .. py:class:: JointLimits Contains joint limit information. .. py:property:: min_position :type: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')] The minimum positions of the joint. .. py:property:: max_position :type: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')] The maximum positions of the joint. .. py:property:: max_velocity :type: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')] The maximum (symmetric) velocities of the joint. .. py:property:: max_acceleration :type: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')] The maximum (symmetric) accelerations of the joint. .. py:property:: max_jerk :type: Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')] The maximum (symmetric) jerks of the joint. .. py:class:: JointMimicInfo Contains joint mimic information. .. py:property:: mimicked_joint_name :type: str The name of the joint being mimicked. .. py:property:: scaling :type: float The scaling factor for the mimic relationship. .. py:property:: offset :type: float The offset for the mimic relationship. .. py:class:: JointInfo(joint_type) Contains joint information relevant to motion planning and control. .. py:property:: type :type: JointType The type of the joint. .. py:property:: num_position_dofs :type: int The number of positional degrees of freedom. .. py:property:: num_velocity_dofs :type: int The number of velocity degrees of freedom. .. py:property:: limits :type: JointLimits The joint limit information for each degree of freedom. .. py:property:: mimic_info :type: JointMimicInfo | None The joint mimic information. .. py:class:: JointGroupInfo Contains information about a named group of joints. .. py:property:: joint_names :type: list[str] The joint names that make up the group. .. py:property:: joint_indices :type: list[int] The joint indices in the group. .. py:property:: q_indices :type: Annotated[numpy.typing.NDArray[numpy.int32], dict(shape=(None, ), order='C')] The position vector indices in the group. .. py:property:: v_indices :type: Annotated[numpy.typing.NDArray[numpy.int32], dict(shape=(None, ), order='C')] The velocity vector indices in the group. .. py:property:: has_continuous_dofs :type: bool Whether the group has any continuous degrees of freedom. .. py:property:: nq_collapsed :type: int The number of collapsed degrees of freedom. .. py:method:: __repr__() .. py:class:: JointPath Contains a path of joint configurations. .. py:property:: joint_names :type: list[str] The list of joint names. .. py:property:: positions :type: list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')]] The list of joint configuration positions. .. py:method:: __repr__() .. py:class:: JointTrajectory Contains a trajectory of joint configurations. .. py:property:: joint_names :type: list[str] The list of joint names. .. py:property:: times :type: list[float] The list of times. .. py:property:: positions :type: list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')]] The list of joint positions. .. py:property:: velocities :type: list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')]] The list of joint velocities. .. py:property:: accelerations :type: list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(None, ), order='C')]] The list of joint acceleration. .. py:method:: __repr__() .. py:class:: CartesianPath CartesianPath(base_frames, tip_frames, tforms) Contains a path of Cartesian configurations. .. py:property:: base_frames :type: list[str] The names of the base frames. .. py:property:: tip_frames :type: list[str] The names of the tip frames. .. py:property:: tforms :type: list[list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order='F')]]] The list of Cartesian transforms. .. py:method:: __repr__() .. py:class:: CartesianTrajectory CartesianTrajectory(base_frames, tip_frames, times, tforms) Contains a trajectory of Cartesian configurations. .. py:property:: base_frames :type: list[str] The names of the base frames. .. py:property:: tip_frames :type: list[str] The names of the tip frames. .. py:property:: times :type: list[float] The list of times. .. py:property:: tforms :type: list[list[Annotated[numpy.typing.NDArray[numpy.float64], dict(shape=(4, 4), order='F')]]] The list of Cartesian transforms. .. py:method:: __repr__() .. py:class:: Box(x, y, z) Temporary wrapper struct to represent a box geometry. .. py:class:: Sphere(radius) Temporary wrapper struct to represent a sphere geometry. .. py:class:: Cylinder(radius, length) Temporary wrapper struct to represent a cylinder geometry. .. py:class:: Mesh(filename, scale = ...) Temporary wrapper struct to represent a triangle mesh geometry. .. py:class:: OcTree(boxes, resolution) Temporary wrapper struct to represent a octree geometry. .. py:class:: 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 = ...) Scene(name, urdf, srdf, package_paths = [], yaml_config_path = ...) Primary scene representation for planning and control. .. py:method:: getName() Gets the scene's name. .. py:method:: getJointNames() Gets the scene's actuated joint names (non-mimic joints only). .. py:method:: getJointNamesWithMimics() Gets the scene's full joint names, including mimic joints. .. py:method:: getJointInfo(joint_name) Gets the information for a specific joint. .. py:method:: configurationDistance(q_start, q_end) Gets the distance between two joint configurations. .. py:method:: setRngSeed(seed) Sets the seed for the random number generator (RNG). .. py:method:: randomPositions() Generates random positions for the robot model. .. py:method:: randomCollisionFreePositions(max_samples = 1000) Generates random collision-free positions for the robot model. .. py:method:: hasCollisions(q, debug = False) Checks collisions at specified joint positions. .. py:method:: isValidConfiguration(q) Checks if the specified joint positions are valid with respect to joint limits. .. py:method:: clampToValidConfiguration(q) Clamps the specified joint positions to valid joint limits. .. py:method:: toFullJointPositions(group_name, q) Converts partial joint positions to full joint positions. .. py:method:: interpolate(q_start, q_end, fraction) Interpolates between two joint configurations. .. py:method:: integrate(q, v) Integrates a velocity vector from a configuration using Lie group operations. .. py:method:: forwardKinematics(q, frame_name, base_frame = '') Calculates forward kinematics for a specific frame. .. py:method:: computeFrameJacobian(q, frame_name, local = True) Computes the frame Jacobian for a specific frame. .. py:method:: getFrameId(name) Get the Pinocchio model ID of a frame by its name. .. py:method:: getJointGroupInfo(name) Get the joint group information of a scene by its name. .. py:method:: getCurrentJointPositions() Get the current Pinocchio configuration vector (model.nq). .. py:method:: getCurrentJointPositionsWithMimics() Get current joint positions in getJointNamesWithMimics() order, including mimic values. .. py:method:: setJointPositions(positions) Set the joint positions for the full robot state. .. py:method:: getJointPositionIndices(joint_names) Get the joint position indices for a set of joint names. .. py:method:: getPositionLimitVectors(group_name = '', collapsed = False) Get the joint position limit vectors for a specified group. .. py:method:: getVelocityLimitVectors(group_name = '') Get the joint velocity limit vectors for a specified group. .. py:method:: getAccelerationLimitVectors(group_name = '') Get the joint acceleration limit vectors for a specified group. .. py:method:: getJerkLimitVectors(group_name = '') Get the joint jerk limit vectors for a specified group. .. py:method:: addBoxGeometry(name, parent_frame, box, tform, color) Adds a box geometry to the scene. .. py:method:: addSphereGeometry(name, parent_frame, sphere, tform, color) Adds a sphere geometry to the scene. .. py:method:: addCylinderGeometry(name, parent_frame, cylinder, tform, color) Adds a cylinder geometry to the scene. .. py:method:: addMeshGeometry(name, parent_frame, mesh, tform, color) Adds a triangle mesh geometry to the scene. .. py:method:: addOcTreeGeometry(name, parent_frame, octree, tform, color) Adds a octree geometry to the scene. .. py:method:: updateGeometryPlacement(name, parent_frame, tform) Updates the placement of an object geometry in the scene. .. py:method:: removeGeometry(name) Removes a geometry from the scene. .. py:method:: getCollisionGeometryIDs(body) Gets a list of collision geometry IDs corresponding to a specified body. .. py:method:: setCollisions(body1, body2, enable) Sets the allowable collisions for a pair of bodies in the model. .. py:method:: __repr__() .. py:function:: 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')]] 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. .. py:function:: 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. .. py:class:: 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. .. py:property:: group_name :type: str The joint group name to be used for path shortcutting. .. py:property:: max_step_size :type: float Maximum step size used in collision checking, and the minimum separable distance between points in a shortcut. .. py:property:: max_iters :type: int Maximum number of iterations of random sampling. .. py:property:: seed :type: int Seed for the random generator. If < 0, a random seed is used. .. py:property:: max_convergence_iters :type: int Stop early once this many consecutive iterations fail to apply a shortcut. A value of 0 disables early stopping. .. py:property:: redundant_removal_iters :type: int Cadence (in iterations) at which to interleave the redundant-vertex removal pass that cleans up the micro-segments introduced by shortcutting. .. py:class:: PathShortcutter(scene, options) Shortcuts joint paths with random sampling and checking connections. .. py:method:: shortcut(path) Attempts to shortcut a specified path. .. py:method:: getPathLengths(path) Computes configuration distances from the start to each pose in a path. .. py:method:: getNormalizedPathScaling(path) Computes length-normalized scaling values along a JointPath. .. py:method:: getConfigurationfromNormalizedPathScaling(path, path_scalings, value) Gets joint configurations from a path with normalized joint scalings. .. py:function:: collapseContinuousJointPositions(scene, group_name, q_orig) Collapses a joint position vector's continuous joints for downstream algorithms. .. py:function:: expandContinuousJointPositions(scene, group_name, q_orig) Expands a joint position vector's continuous joints from downstream algorithms.