Skip to main content

No project description provided

Project description

🤖 Dexmate Robot Motion Planning API

Python

📦 Installation

pip install dexmotion

📚 Usage

🚀 API Usage Guide

Basic Setup

from dexmotion.motion_manager import MotionManager

# Initialize MotionManager
mm = MotionManager()

# Initialize with specific robot type
mm = MotionManager(robot_type = "vega_1")

# Initialize with locked joint regions
mm = MotionManager(robot_type = "vega_1", joint_regions_to_lock=["BASE", "HEAD", "LEFT_HAND", "RIGHT_HAND"])

# Set robot joints (locked or unlocked) before using active joints
initial_config = {
        "L_arm_j1": 0.064,
        "L_arm_j7": 0.03,
        "R_arm_j1": -0.064,
        "torso_j1": 0.42,
        "torso_j2": 0.14,
        "torso_j3": -0.6,
        "head_j1": 0.4,
    }
mm = MotionManager(
        robot_type="vega_1",
        initial_joint_configuration_dict=initial_config,
    )

# Setting custom target frames for dexmotion
mm.target_frames = ["L_ee", "R_arm_j7", "head_l1"]

Available Robot Types

Dexmotion supports multiple Vega robot variants with different configurations:

No End Effector:

  • vega_1 - Full body robot (arms, torso, base, head)
  • vega_1u - Upper body only (arms, head, no torso/base)
  • vega_1p - Full body robot variant (arms, torso, base, head)

Gripper End Effector:

  • vega_1_gripper - Full body with gripper hands
  • vega_1u_gripper - Upper body with gripper hands
  • vega_1p_gripper - Full body variant with gripper hands

F5D6 Hand End Effector:

  • vega_1_f5d6 - Full body with F5D6 dexterous hands
  • vega_1u_f5d6 - Upper body with F5D6 dexterous hands
  • vega_1p_f5d6 - Full body variant with F5D6 dexterous hands
# Example: Initialize with F5D6 hands
mm = MotionManager(robot_type="vega_1_f5d6")

# Example: Initialize upper body variant with grippers
mm = MotionManager(robot_type="vega_1u_gripper")

Joint Control

# Get current joint positions
joint_pos_dict = mm.get_joint_pos_dict()

# Set joint positions
new_positions = {"L_arm_j1": 0.5, "R_arm_j1": -0.5}
mm.set_joint_pos(new_positions)

# Set joint poses at component level
mm.right_arm.set_joint_pos([-2.5, -0.3, 0.0, 0.0, 0.0, 0.0, 0.0])
mm.torso.set_joint_pos([0.42, 0.14, -0.6])
mm.head.set_joint_pos([0.4, 0.0, 0.0])

# Read full body pose
joint_pos_dict = mm.get_joint_pos_dict()

# Read component pose
updated_head_pos = mm.head.get_joint_pos()

Forward Kinematics

# Get end-effector poses
poses = mm.fk(["L_ee", "R_ee"])

# Get poses for specific configuration
poses = mm.fk(["L_ee", "R_ee"], qpos=solution)

End effector control

# Move chosen frame to absolute or realtive pose
mm.right_arm.set_ee_pose(
    right_target_pos, right_target_rot, target_frame="R_arm_j4", relative=True
)

# Move chosen EE about cartesian space
mm.left_arm.move_ee_xyz(np.array([0.0, 0.0, 0.5]))
mm.right_arm.move_ee_rpy(np.array([np.pi / 4, 0.0, 0.0]))

Inverse Kinematics

# Relative movement IK
solution, collision_status, limits_status = mm.ik(
    target_pos={"L_ee": [0.05, 0.0, 0.02]},
    relative=True,
    type="pink"
)

Inverse Kinematics with External Obstacle Avoidance

# IK with obstacle avoidance using pink_ext
from dexmotion.configs.ik import LocalPinkExtIKConfig

# Configure external obstacles
obstacle_config = LocalPinkExtIKConfig(
    external_obstacles=[
        {
            "urdf_path": "/path/to/obstacle.urdf",
            "position": [0.5, 0.0, 0.5],
            "orientation": [1.0, 0.0, 0.0, 0.0],
        }
    ]
)

# Initialize with pink_ext solver
mm = MotionManager(
    local_ik_solver_type="pink_ext",
    custom_local_ik_config=obstacle_config
)

# Solve IK avoiding obstacles
solution, collision_status, limits_status = mm.ik(
    target_pos={"L_ee": [0.05, 0.0, 0.02]},
    relative=True,
    type="pink_ext"
)

Global IK

# Absolute positioning with quaternions
target_configuration_dict, is_in_collision, is_joints_within_limits = mm.global_ik(
    target_pos={"L_ee": [0.4, 0.2, 1.0]},
    target_rot={"L_ee": [1.0, 0.0, 0.0, 0.0]},  # Quaternion [w,x,y,z], RPY [r,p,y]
    type="hybrid"  # "pink", "casadi", or "hybrid"
)

Motion Planning

# Plan to configuration
waypoints = mm.plan(
    goal_config=goal_config,
    planner_type="ompl"  # "ompl" or "interpolation"
)

# Plan to poses
waypoints = mm.plan(
    goal_pos={"L_ee": [0.1, 0.0, 0.1]},
    target_rot={"L_ee": [3.14, 0.0, 0.0]},
    planner_type="interpolation"
)

### Trajectory Smoothing
smooth_trajectory = mm.smooth_trajectory(
    waypoints=waypoints_qpos,
    method="gaussian",  # "gaussian", "toppra", "ruckig"
    control_frequency=100.0
)

# Extract smoothed data
positions = smooth_trajectory["positions"]
velocities = smooth_trajectory.get("velocities")

Visualization

# Visualize motion plan
mm.visualize_motion_plan(waypoints, duration=3.0)

🤝 Ready to build amazing robots?

📧 Contact Us

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dexmotion-0.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

dexmotion-0.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

dexmotion-0.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

dexmotion-0.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

dexmotion-0.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

dexmotion-0.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

dexmotion-0.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

dexmotion-0.4.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

File details

Details for the file dexmotion-0.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dexmotion-0.4.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4f6601d3b68981f72479bc9b89c637195fc9675d640eeacf08f0ba2aaa070cb8
MD5 e01fd663dd990b1d4094bcceb10349be
BLAKE2b-256 65484327df78c9cac5a3709e3a023254d24a99938281c82a73da023d8d459613

See more details on using hashes here.

File details

Details for the file dexmotion-0.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dexmotion-0.4.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b51606343359f128ce8489eba6a87b3d8f2257d38ad74449a35c0b1c8acc3980
MD5 bc0b878db9e536f1362230f757feefae
BLAKE2b-256 60f7f38b99847176f0aa1508f01b3f4ed509c01724f60f6ae936c2966ecdde6e

See more details on using hashes here.

File details

Details for the file dexmotion-0.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dexmotion-0.4.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 530711475f5a2812b9e43dc4e6a84c750eaed9267c2a1bfe7be1bbba9f0f9bff
MD5 b78a14a06941dcfbf3bc13a18cdd9875
BLAKE2b-256 a7134417977bd2b66fc1581e615ad0ed727db2afca9eb98de5a4d7e05312fbd2

See more details on using hashes here.

File details

Details for the file dexmotion-0.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dexmotion-0.4.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 3dc723f8b8f5cd82fbc2c632724defec4af2d439e3448c7f8f98828349019446
MD5 3f0af45531174ba1693c8e0706d39d8d
BLAKE2b-256 f82ce30399912f55aea3e11472c54189d9f01c1542f9c5401f0e08706b3dbaa5

See more details on using hashes here.

File details

Details for the file dexmotion-0.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dexmotion-0.4.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9ec161e675413a2978ffab2915c3abc0da41362fa3304a8321f31f6b08e73f05
MD5 d4c6172de24f7142e58f7a868f0aeb92
BLAKE2b-256 bf9ae201a8ac5a8853d79a3a4c0a69114283911258ef07d998238c489386da6e

See more details on using hashes here.

File details

Details for the file dexmotion-0.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dexmotion-0.4.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c0f349ce21a34327d0754cb2d9620866ff547e3b3f4a075dc802a69ada08223d
MD5 a3dfb6743087b155ae5c620835b11c4d
BLAKE2b-256 fbdfffa3bd9d2582b1ffa71deba7e8774c721e93c71c901fcd83918bd6949479

See more details on using hashes here.

File details

Details for the file dexmotion-0.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dexmotion-0.4.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3757121338ce88df7ebf786e3d002beabf4113c35c8ade678310d4ca91d55317
MD5 db7cc01e32d8dfd8f55f0e13a37f8bce
BLAKE2b-256 f21b9079f05b5bc7f8ae7ac45dd662a434db2891decda544e1187a7805a26d00

See more details on using hashes here.

File details

Details for the file dexmotion-0.4.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for dexmotion-0.4.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 74ff3eb27dbaa6668f2140f046a63ea9609573399daeea09a45dc36fd8e489cc
MD5 31c69ce955ed2d31fa4ba73b1b5da1de
BLAKE2b-256 f3f12967a25dd9efd310aa0a100fc32d6883b6b84bcafa1d169f915b084f222b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page