mani-skill-nightly 2025.5.15.816__py3-none-any.whl → 2025.5.16.816__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mani_skill/examples/motionplanning/panda/run.py +2 -1
- mani_skill/examples/motionplanning/panda/solutions/__init__.py +1 -0
- mani_skill/examples/motionplanning/panda/solutions/place_sphere.py +83 -0
- {mani_skill_nightly-2025.5.15.816.dist-info → mani_skill_nightly-2025.5.16.816.dist-info}/METADATA +1 -1
- {mani_skill_nightly-2025.5.15.816.dist-info → mani_skill_nightly-2025.5.16.816.dist-info}/RECORD +8 -7
- {mani_skill_nightly-2025.5.15.816.dist-info → mani_skill_nightly-2025.5.16.816.dist-info}/LICENSE +0 -0
- {mani_skill_nightly-2025.5.15.816.dist-info → mani_skill_nightly-2025.5.16.816.dist-info}/WHEEL +0 -0
- {mani_skill_nightly-2025.5.15.816.dist-info → mani_skill_nightly-2025.5.16.816.dist-info}/top_level.txt +0 -0
@@ -9,13 +9,14 @@ from tqdm import tqdm
|
|
9
9
|
import os.path as osp
|
10
10
|
from mani_skill.utils.wrappers.record import RecordEpisode
|
11
11
|
from mani_skill.trajectory.merge_trajectory import merge_trajectories
|
12
|
-
from mani_skill.examples.motionplanning.panda.solutions import solvePushCube, solvePickCube, solveStackCube, solvePegInsertionSide, solvePlugCharger, solvePullCubeTool, solveLiftPegUpright, solvePullCube, solveDrawTriangle, solveDrawSVG
|
12
|
+
from mani_skill.examples.motionplanning.panda.solutions import solvePushCube, solvePickCube, solveStackCube, solvePegInsertionSide, solvePlugCharger, solvePullCubeTool, solveLiftPegUpright, solvePullCube, solveDrawTriangle, solveDrawSVG, solvePlaceSphere
|
13
13
|
MP_SOLUTIONS = {
|
14
14
|
"DrawTriangle-v1": solveDrawTriangle,
|
15
15
|
"PickCube-v1": solvePickCube,
|
16
16
|
"StackCube-v1": solveStackCube,
|
17
17
|
"PegInsertionSide-v1": solvePegInsertionSide,
|
18
18
|
"PlugCharger-v1": solvePlugCharger,
|
19
|
+
"PlaceSphere-v1": solvePlaceSphere,
|
19
20
|
"PushCube-v1": solvePushCube,
|
20
21
|
"PullCubeTool-v1": solvePullCubeTool,
|
21
22
|
"LiftPegUpright-v1": solveLiftPegUpright,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from .pick_cube import solve as solvePickCube
|
2
2
|
from .stack_cube import solve as solveStackCube
|
3
3
|
from .peg_insertion_side import solve as solvePegInsertionSide
|
4
|
+
from .place_sphere import solve as solvePlaceSphere
|
4
5
|
from .plug_charger import solve as solvePlugCharger
|
5
6
|
from .push_cube import solve as solvePushCube
|
6
7
|
from .pull_cube_tool import solve as solvePullCubeTool
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import numpy as np
|
2
|
+
import sapien
|
3
|
+
from transforms3d.euler import euler2quat
|
4
|
+
|
5
|
+
from mani_skill.envs.tasks import PlaceSphereEnv
|
6
|
+
from mani_skill.utils import common
|
7
|
+
from mani_skill.examples.motionplanning.panda.motionplanner import PandaArmMotionPlanningSolver
|
8
|
+
from mani_skill.examples.motionplanning.panda.utils import compute_grasp_info_by_obb, get_actor_obb
|
9
|
+
|
10
|
+
def solve(env: PlaceSphereEnv, seed=None, debug=False, vis=False):
|
11
|
+
env.reset(seed=seed)
|
12
|
+
assert env.unwrapped.control_mode in [
|
13
|
+
"pd_joint_pos",
|
14
|
+
"pd_joint_pos_vel",
|
15
|
+
], env.unwrapped.control_mode
|
16
|
+
planner = PandaArmMotionPlanningSolver(
|
17
|
+
env,
|
18
|
+
debug=debug,
|
19
|
+
vis=vis,
|
20
|
+
base_pose=env.unwrapped.agent.robot.pose,
|
21
|
+
visualize_target_grasp_pose=vis,
|
22
|
+
print_env_info=False,
|
23
|
+
)
|
24
|
+
FINGER_LENGTH = 0.025
|
25
|
+
env = env.unwrapped
|
26
|
+
obb = get_actor_obb(env.obj)
|
27
|
+
|
28
|
+
approaching = np.array([0, 0, -1])
|
29
|
+
target_closing = env.agent.tcp.pose.to_transformation_matrix()[0, :3, 1].cpu().numpy()
|
30
|
+
grasp_info = compute_grasp_info_by_obb(
|
31
|
+
obb,
|
32
|
+
approaching=approaching,
|
33
|
+
target_closing=target_closing,
|
34
|
+
depth=FINGER_LENGTH,
|
35
|
+
)
|
36
|
+
closing, center = grasp_info["closing"], grasp_info["center"]
|
37
|
+
grasp_pose = env.agent.build_grasp_pose(approaching, closing, center)
|
38
|
+
|
39
|
+
# Search a valid pose
|
40
|
+
angles = np.arange(0, np.pi * 2 / 3, np.pi / 2) + np.pi / 4
|
41
|
+
angles = np.repeat(angles, 2)
|
42
|
+
angles[1::2] *= -1
|
43
|
+
for angle in angles:
|
44
|
+
delta_pose = sapien.Pose(q=euler2quat(0, 0, angle))
|
45
|
+
grasp_pose2 = grasp_pose * delta_pose
|
46
|
+
res = planner.move_to_pose_with_screw(grasp_pose2, dry_run=True)
|
47
|
+
if res == -1:
|
48
|
+
continue
|
49
|
+
grasp_pose = grasp_pose2
|
50
|
+
break
|
51
|
+
else:
|
52
|
+
print("Fail to find a valid grasp pose")
|
53
|
+
|
54
|
+
# -------------------------------------------------------------------------- #
|
55
|
+
# Reach
|
56
|
+
# -------------------------------------------------------------------------- #
|
57
|
+
reach_pose = grasp_pose * sapien.Pose([0, 0, -0.05])
|
58
|
+
planner.move_to_pose_with_screw(reach_pose)
|
59
|
+
|
60
|
+
# -------------------------------------------------------------------------- #
|
61
|
+
# Grasp
|
62
|
+
# -------------------------------------------------------------------------- #
|
63
|
+
planner.move_to_pose_with_screw(grasp_pose)
|
64
|
+
planner.close_gripper()
|
65
|
+
|
66
|
+
# -------------------------------------------------------------------------- #
|
67
|
+
# Lift
|
68
|
+
# -------------------------------------------------------------------------- #
|
69
|
+
lift_pose = sapien.Pose([0, 0, 0.1]) * grasp_pose
|
70
|
+
planner.move_to_pose_with_screw(lift_pose)
|
71
|
+
|
72
|
+
# -------------------------------------------------------------------------- #
|
73
|
+
# Stack
|
74
|
+
# -------------------------------------------------------------------------- #
|
75
|
+
block_half_size_torch = common.to_tensor(env.block_half_size)
|
76
|
+
goal_pose = env.bin.pose * sapien.Pose([0, 0, (block_half_size_torch[2] * 2).item()])
|
77
|
+
offset = (goal_pose.p - env.obj.pose.p).cpu().numpy()[0] # remember that all data in ManiSkill is batched and a torch tensor
|
78
|
+
align_pose = sapien.Pose(lift_pose.p + offset, lift_pose.q)
|
79
|
+
planner.move_to_pose_with_screw(align_pose)
|
80
|
+
|
81
|
+
res = planner.open_gripper()
|
82
|
+
planner.close()
|
83
|
+
return res
|
{mani_skill_nightly-2025.5.15.816.dist-info → mani_skill_nightly-2025.5.16.816.dist-info}/RECORD
RENAMED
@@ -656,14 +656,15 @@ mani_skill/examples/motionplanning/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQe
|
|
656
656
|
mani_skill/examples/motionplanning/panda/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
657
657
|
mani_skill/examples/motionplanning/panda/motionplanner.py,sha256=2GT2K2tXI9QVyhE1hOapr34vyCPRtBdOVm_MFH_OnGE,10314
|
658
658
|
mani_skill/examples/motionplanning/panda/motionplanner_stick.py,sha256=o4qwJLL7rLFsPAu856UtbtBOu8nlKJo3SLI_bFcGzUM,6148
|
659
|
-
mani_skill/examples/motionplanning/panda/run.py,sha256=
|
659
|
+
mani_skill/examples/motionplanning/panda/run.py,sha256=nKBWnMFtx-5lTSKgY4prBUQqKT9qrHdKrFKfRWsoO6k,7376
|
660
660
|
mani_skill/examples/motionplanning/panda/utils.py,sha256=ueS0b4-gX9lnsvqet361tEi8S5cv4Liq71BWN-feEZU,3058
|
661
|
-
mani_skill/examples/motionplanning/panda/solutions/__init__.py,sha256=
|
661
|
+
mani_skill/examples/motionplanning/panda/solutions/__init__.py,sha256=s3nWFWEDrfBU6wR9bjgzVEAExPv8KQ-SibtJmb_VhVs,564
|
662
662
|
mani_skill/examples/motionplanning/panda/solutions/draw_svg.py,sha256=MF-THj9aAXefc6wpRJ44nk5Y_sF2P0PdWXKQhlR_pOE,1049
|
663
663
|
mani_skill/examples/motionplanning/panda/solutions/draw_triangle.py,sha256=CeRhTdPep6vgVix6SfOEBx8DRDS9Kmpo3zALEg7sK7Q,1937
|
664
664
|
mani_skill/examples/motionplanning/panda/solutions/lift_peg_upright.py,sha256=-wQ5DpT7dMffOgOkpboUNYg4odq-NuQgGUzJ0LWNIUg,3616
|
665
665
|
mani_skill/examples/motionplanning/panda/solutions/peg_insertion_side.py,sha256=xjyH1THjtzZrnS6m_zURjKQ9vZgqCWbcKsa7RcbBg8g,3575
|
666
666
|
mani_skill/examples/motionplanning/panda/solutions/pick_cube.py,sha256=STYpml582MlVq52ixxBcMIF6gwyCwSdpGd1SDioOZVQ,2243
|
667
|
+
mani_skill/examples/motionplanning/panda/solutions/place_sphere.py,sha256=w8Q-IvPgGNgLd01AMB-tttPXr_fS10oAXuSmOXVrmSA,3282
|
667
668
|
mani_skill/examples/motionplanning/panda/solutions/plug_charger.py,sha256=-4MoxBRGmWbJqFf1XxWWJ0CZsDxQVaZg6ft7NOLKGWs,3533
|
668
669
|
mani_skill/examples/motionplanning/panda/solutions/pull_cube.py,sha256=rQkvCRYjVejEWC28mo6lbGRqjp9McZGjQEv4Wp1fMWE,1111
|
669
670
|
mani_skill/examples/motionplanning/panda/solutions/pull_cube_tool.py,sha256=g6adx921V2SOVYYFlh_gLwV5I0tnz70qCLm81oA6YhA,3609
|
@@ -811,8 +812,8 @@ mani_skill/vector/wrappers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
811
812
|
mani_skill/vector/wrappers/gymnasium.py,sha256=v1MDPIrVACBKCulrpdXBK2jDZQI7LKYFZgGgaCC5avY,7408
|
812
813
|
mani_skill/vector/wrappers/sb3.py,sha256=SlXdiEPqcNHYMhJCzA29kBU6zK7DKTe1nc0L6Z3QQtY,4722
|
813
814
|
mani_skill/viewer/__init__.py,sha256=srvDBsk4LQU75K2VIttrhiQ68p_ro7PSDqQRls2PY5c,1722
|
814
|
-
mani_skill_nightly-2025.5.
|
815
|
-
mani_skill_nightly-2025.5.
|
816
|
-
mani_skill_nightly-2025.5.
|
817
|
-
mani_skill_nightly-2025.5.
|
818
|
-
mani_skill_nightly-2025.5.
|
815
|
+
mani_skill_nightly-2025.5.16.816.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
816
|
+
mani_skill_nightly-2025.5.16.816.dist-info/METADATA,sha256=QzcESGR6yD5zXuWGNdgom2dL0dZlEw2yDwc_60IN6rA,9410
|
817
|
+
mani_skill_nightly-2025.5.16.816.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
818
|
+
mani_skill_nightly-2025.5.16.816.dist-info/top_level.txt,sha256=bkBgOVl_MZMoQx2aRFsSFEYlZLxjWlip5vtJ39FB3jA,11
|
819
|
+
mani_skill_nightly-2025.5.16.816.dist-info/RECORD,,
|
{mani_skill_nightly-2025.5.15.816.dist-info → mani_skill_nightly-2025.5.16.816.dist-info}/LICENSE
RENAMED
File without changes
|
{mani_skill_nightly-2025.5.15.816.dist-info → mani_skill_nightly-2025.5.16.816.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|