Skip to content

TypeError in Path Planning Demo Due to Incorrect Pose Multiplication #118

@henryhcliu

Description

@henryhcliu

When running the path planning demo with SAPIEN 3.0.1 and mplib 0.2.1, the following error occurs:

TypeError: can't multiply sequence by non-int of type 'mplib.pymp.Pose'

The error originates from lines 616–618 in $PYTHON_SITE_PKG_PATH/mplib/planner.py, where a sequence is being multiplied by a Pose object, which is unsupported.

Image

Proposed Fix:
Update the _transform_goal_to_wrt_base method to properly handle list/tuple inputs by converting them to a Pose before performing the transformation:

def _transform_goal_to_wrt_base(self, goal_pose: Pose) -> Pose:
    """Converts goal pose from T_world_goal to T_base_goal"""
    if isinstance(goal_pose, (list, tuple)):
        goal_pose = Pose(goal_pose[:3], goal_pose[3:])
    return self.robot.get_base_pose().inv() * goal_pose

With this change, the demo runs without errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions