roboplan.roboplan_ext.core ========================== .. py:module:: roboplan.roboplan_ext.core .. autoapi-nested-parse:: Core roboplan module Classes ------- .. autoapisummary:: roboplan.roboplan_ext.core.JointConfiguration roboplan.roboplan_ext.core.CartesianConfiguration roboplan.roboplan_ext.core.JointType roboplan.roboplan_ext.core.JointLimits roboplan.roboplan_ext.core.JointMimicInfo roboplan.roboplan_ext.core.JointInfo roboplan.roboplan_ext.core.JointGroupInfo roboplan.roboplan_ext.core.JointPath roboplan.roboplan_ext.core.JointTrajectory roboplan.roboplan_ext.core.Box roboplan.roboplan_ext.core.Sphere roboplan.roboplan_ext.core.OcTree roboplan.roboplan_ext.core.Scene roboplan.roboplan_ext.core.PathShortcutter Functions --------- .. autoapisummary:: roboplan.roboplan_ext.core.computeFramePath roboplan.roboplan_ext.core.hasCollisionsAlongPath roboplan.roboplan_ext.core.collapseContinuousJointPositions roboplan.roboplan_ext.core.expandContinuousJointPositions Module 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:: 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:: 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 full joint names, including mimic joints. .. py:method:: getActuatedJointNames() Gets the scene's actuated (non-mimic) joint names. .. 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:: isValidPose(q) Checks if the specified joint positions are valid with respect to joint limits. .. py:method:: applyMimics(q) Applies mimic joint relationships to a position vector. .. 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) 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 joint positions for the full robot state. .. 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 = '') 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:: 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) Checks collisions along a specified configuration space path. .. py:class:: PathShortcutter(scene, group_name) Shortcuts joint paths with random sampling and checking connections. .. py:method:: shortcut(path, max_step_size, max_iters = 100, seed = 0) 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.