diff --git a/robosuite/controllers/composite/composite_controller.py b/robosuite/controllers/composite/composite_controller.py
index b832827c38..91e040cb18 100644
--- a/robosuite/controllers/composite/composite_controller.py
+++ b/robosuite/controllers/composite/composite_controller.py
@@ -200,7 +200,7 @@ def create_action_vector(self, action_dict):
A helper function that creates the action vector given a dictionary
"""
full_action_vector = np.zeros(self.action_limits[0].shape)
- for (part_name, action_vector) in action_dict.items():
+ for part_name, action_vector in action_dict.items():
if part_name not in self._action_split_indexes:
ROBOSUITE_DEFAULT_LOGGER.debug(f"{part_name} is not specified in the action space")
continue
@@ -349,7 +349,7 @@ def action_limits(self):
def create_action_vector(self, action_dict: Dict[str, np.ndarray]) -> np.ndarray:
full_action_vector = np.zeros(self.action_limits[0].shape)
- for (part_name, action_vector) in action_dict.items():
+ for part_name, action_vector in action_dict.items():
if part_name not in self._whole_body_controller_action_split_indexes:
ROBOSUITE_DEFAULT_LOGGER.debug(f"{part_name} is not specified in the action space")
continue
diff --git a/robosuite/controllers/parts/controller_factory.py b/robosuite/controllers/parts/controller_factory.py
index 8c780f8d48..8f72454749 100644
--- a/robosuite/controllers/parts/controller_factory.py
+++ b/robosuite/controllers/parts/controller_factory.py
@@ -1,6 +1,7 @@
"""
Set of functions that streamline controller initialization process
"""
+
import json
import os
from copy import deepcopy
diff --git a/robosuite/demos/demo_gripper_selection.py b/robosuite/demos/demo_gripper_selection.py
index 1da85c9ddd..8c817718e5 100644
--- a/robosuite/demos/demo_gripper_selection.py
+++ b/robosuite/demos/demo_gripper_selection.py
@@ -2,6 +2,7 @@
This script shows you how to select gripper for an environment.
This is controlled by gripper_type keyword argument.
"""
+
import time
import numpy as np
diff --git a/robosuite/demos/demo_segmentation.py b/robosuite/demos/demo_segmentation.py
index bb53b72d34..4123ae13a2 100644
--- a/robosuite/demos/demo_segmentation.py
+++ b/robosuite/demos/demo_segmentation.py
@@ -1,6 +1,7 @@
"""
Play random actions in an environment and render a video that demonstrates segmentation.
"""
+
import argparse
import colorsys
import json
diff --git a/robosuite/demos/demo_usd_export.py b/robosuite/demos/demo_usd_export.py
index 0e0cbd756f..55b912f508 100644
--- a/robosuite/demos/demo_usd_export.py
+++ b/robosuite/demos/demo_usd_export.py
@@ -1,4 +1,4 @@
-""" Exports a USD file corresponding to the collected trajectory.
+"""Exports a USD file corresponding to the collected trajectory.
The USD (Universal Scene Description) file format allows users to save
trajectories such that they can be rendered in external renderers such
@@ -8,8 +8,9 @@
***IMPORTANT***: If you are using mujoco version 3.1.1, please make sure
that you also have numpy < 2 installed in your environment. Failure to do
-so may result in incorrect renderings.
+so may result in incorrect renderings.
"""
+
import argparse
import mujoco
diff --git a/robosuite/devices/device.py b/robosuite/devices/device.py
index 32da777a0d..6880665acd 100644
--- a/robosuite/devices/device.py
+++ b/robosuite/devices/device.py
@@ -166,7 +166,7 @@ def input2action(self, mirror_actions=False) -> Optional[Dict]:
ac_dict[f"{active_arm}_gripper"] = np.array([grasp] * gripper_dof)
# clip actions between -1 and 1
- for (k, v) in ac_dict.items():
+ for k, v in ac_dict.items():
if "abs" not in k:
ac_dict[k] = np.clip(v, -1, 1)
diff --git a/robosuite/environments/robot_env.py b/robosuite/environments/robot_env.py
index 9c58f2964a..e99759b0dd 100644
--- a/robosuite/environments/robot_env.py
+++ b/robosuite/environments/robot_env.py
@@ -345,7 +345,7 @@ def _setup_observables(self):
# Create sensor information
sensors = []
names = []
- for (cam_name, cam_w, cam_h, cam_d, cam_segs) in zip(
+ for cam_name, cam_w, cam_h, cam_d, cam_segs in zip(
self.camera_names,
self.camera_widths,
self.camera_heights,
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/base_link.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/base_link.stl
new file mode 100644
index 0000000000..6a3263b5b5
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/base_link.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/end_tool.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/end_tool.stl
new file mode 100644
index 0000000000..e2324f41ef
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/end_tool.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/left_finger.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/left_finger.stl
new file mode 100644
index 0000000000..41f2c0d76f
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/left_finger.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/left_inner_knuckle.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/left_inner_knuckle.stl
new file mode 100644
index 0000000000..abeff0cec0
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/left_inner_knuckle.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/left_outer_knuckle.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/left_outer_knuckle.stl
new file mode 100644
index 0000000000..639add9e0e
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/left_outer_knuckle.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/link1.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link1.stl
new file mode 100644
index 0000000000..a5ca309d62
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link1.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/link2.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link2.stl
new file mode 100644
index 0000000000..1539adb628
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link2.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/link3.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link3.stl
new file mode 100644
index 0000000000..23926351ee
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link3.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/link4.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link4.stl
new file mode 100644
index 0000000000..a24cc91df0
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link4.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/link5.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link5.stl
new file mode 100644
index 0000000000..7f91e37cfa
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link5.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/link6.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link6.stl
new file mode 100644
index 0000000000..04fc480566
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link6.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/link7.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link7.stl
new file mode 100644
index 0000000000..0e9963c387
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link7.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/link_base.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link_base.stl
new file mode 100644
index 0000000000..555d6f2ea3
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/link_base.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/right_finger.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/right_finger.stl
new file mode 100644
index 0000000000..53f0eecae8
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/right_finger.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/right_inner_knuckle.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/right_inner_knuckle.stl
new file mode 100644
index 0000000000..f1a486daf3
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/right_inner_knuckle.stl differ
diff --git a/robosuite/models/assets/grippers/meshes/xarm7_gripper/right_outer_knuckle.stl b/robosuite/models/assets/grippers/meshes/xarm7_gripper/right_outer_knuckle.stl
new file mode 100644
index 0000000000..3099dfdeda
Binary files /dev/null and b/robosuite/models/assets/grippers/meshes/xarm7_gripper/right_outer_knuckle.stl differ
diff --git a/robosuite/models/assets/grippers/xarm7_gripper.xml b/robosuite/models/assets/grippers/xarm7_gripper.xml
new file mode 100644
index 0000000000..a6527d1051
--- /dev/null
+++ b/robosuite/models/assets/grippers/xarm7_gripper.xml
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/robosuite/models/assets/robots/xarm7/assets/base_link.stl b/robosuite/models/assets/robots/xarm7/assets/base_link.stl
new file mode 100644
index 0000000000..6a3263b5b5
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/base_link.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/end_tool.stl b/robosuite/models/assets/robots/xarm7/assets/end_tool.stl
new file mode 100644
index 0000000000..e2324f41ef
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/end_tool.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/left_finger.stl b/robosuite/models/assets/robots/xarm7/assets/left_finger.stl
new file mode 100644
index 0000000000..41f2c0d76f
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/left_finger.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/left_inner_knuckle.stl b/robosuite/models/assets/robots/xarm7/assets/left_inner_knuckle.stl
new file mode 100644
index 0000000000..abeff0cec0
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/left_inner_knuckle.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/left_outer_knuckle.stl b/robosuite/models/assets/robots/xarm7/assets/left_outer_knuckle.stl
new file mode 100644
index 0000000000..639add9e0e
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/left_outer_knuckle.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/link1.stl b/robosuite/models/assets/robots/xarm7/assets/link1.stl
new file mode 100644
index 0000000000..a5ca309d62
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/link1.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/link2.stl b/robosuite/models/assets/robots/xarm7/assets/link2.stl
new file mode 100644
index 0000000000..1539adb628
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/link2.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/link3.stl b/robosuite/models/assets/robots/xarm7/assets/link3.stl
new file mode 100644
index 0000000000..23926351ee
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/link3.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/link4.stl b/robosuite/models/assets/robots/xarm7/assets/link4.stl
new file mode 100644
index 0000000000..a24cc91df0
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/link4.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/link5.stl b/robosuite/models/assets/robots/xarm7/assets/link5.stl
new file mode 100644
index 0000000000..7f91e37cfa
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/link5.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/link6.stl b/robosuite/models/assets/robots/xarm7/assets/link6.stl
new file mode 100644
index 0000000000..04fc480566
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/link6.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/link7.stl b/robosuite/models/assets/robots/xarm7/assets/link7.stl
new file mode 100644
index 0000000000..0e9963c387
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/link7.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/link_base.stl b/robosuite/models/assets/robots/xarm7/assets/link_base.stl
new file mode 100644
index 0000000000..555d6f2ea3
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/link_base.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/right_finger.stl b/robosuite/models/assets/robots/xarm7/assets/right_finger.stl
new file mode 100644
index 0000000000..53f0eecae8
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/right_finger.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/right_inner_knuckle.stl b/robosuite/models/assets/robots/xarm7/assets/right_inner_knuckle.stl
new file mode 100644
index 0000000000..f1a486daf3
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/right_inner_knuckle.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/assets/right_outer_knuckle.stl b/robosuite/models/assets/robots/xarm7/assets/right_outer_knuckle.stl
new file mode 100644
index 0000000000..3099dfdeda
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/assets/right_outer_knuckle.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/base_link.stl b/robosuite/models/assets/robots/xarm7/meshes/base_link.stl
new file mode 100644
index 0000000000..6a3263b5b5
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/base_link.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/end_tool.stl b/robosuite/models/assets/robots/xarm7/meshes/end_tool.stl
new file mode 100644
index 0000000000..e2324f41ef
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/end_tool.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/left_finger.stl b/robosuite/models/assets/robots/xarm7/meshes/left_finger.stl
new file mode 100644
index 0000000000..41f2c0d76f
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/left_finger.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/left_inner_knuckle.stl b/robosuite/models/assets/robots/xarm7/meshes/left_inner_knuckle.stl
new file mode 100644
index 0000000000..abeff0cec0
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/left_inner_knuckle.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/left_outer_knuckle.stl b/robosuite/models/assets/robots/xarm7/meshes/left_outer_knuckle.stl
new file mode 100644
index 0000000000..639add9e0e
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/left_outer_knuckle.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/link1.stl b/robosuite/models/assets/robots/xarm7/meshes/link1.stl
new file mode 100644
index 0000000000..a5ca309d62
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/link1.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/link2.stl b/robosuite/models/assets/robots/xarm7/meshes/link2.stl
new file mode 100644
index 0000000000..1539adb628
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/link2.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/link3.stl b/robosuite/models/assets/robots/xarm7/meshes/link3.stl
new file mode 100644
index 0000000000..23926351ee
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/link3.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/link4.stl b/robosuite/models/assets/robots/xarm7/meshes/link4.stl
new file mode 100644
index 0000000000..a24cc91df0
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/link4.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/link5.stl b/robosuite/models/assets/robots/xarm7/meshes/link5.stl
new file mode 100644
index 0000000000..7f91e37cfa
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/link5.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/link6.stl b/robosuite/models/assets/robots/xarm7/meshes/link6.stl
new file mode 100644
index 0000000000..04fc480566
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/link6.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/link7.stl b/robosuite/models/assets/robots/xarm7/meshes/link7.stl
new file mode 100644
index 0000000000..0e9963c387
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/link7.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/link_base.stl b/robosuite/models/assets/robots/xarm7/meshes/link_base.stl
new file mode 100644
index 0000000000..555d6f2ea3
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/link_base.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/right_finger.stl b/robosuite/models/assets/robots/xarm7/meshes/right_finger.stl
new file mode 100644
index 0000000000..53f0eecae8
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/right_finger.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/right_inner_knuckle.stl b/robosuite/models/assets/robots/xarm7/meshes/right_inner_knuckle.stl
new file mode 100644
index 0000000000..f1a486daf3
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/right_inner_knuckle.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/meshes/right_outer_knuckle.stl b/robosuite/models/assets/robots/xarm7/meshes/right_outer_knuckle.stl
new file mode 100644
index 0000000000..3099dfdeda
Binary files /dev/null and b/robosuite/models/assets/robots/xarm7/meshes/right_outer_knuckle.stl differ
diff --git a/robosuite/models/assets/robots/xarm7/robot.xml b/robosuite/models/assets/robots/xarm7/robot.xml
new file mode 100644
index 0000000000..b8602f0878
--- /dev/null
+++ b/robosuite/models/assets/robots/xarm7/robot.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/robosuite/models/bases/floating_legged_base.py b/robosuite/models/bases/floating_legged_base.py
index 2a41ed9bea..f8163010a8 100644
--- a/robosuite/models/bases/floating_legged_base.py
+++ b/robosuite/models/bases/floating_legged_base.py
@@ -1,6 +1,7 @@
"""
Rethink's Generic Mount (Officially used on Sawyer).
"""
+
import numpy as np
from robosuite.models.bases.mobile_base_model import MobileBaseModel
diff --git a/robosuite/models/bases/leg_base_model.py b/robosuite/models/bases/leg_base_model.py
index d272e4c0ef..de4c54701c 100644
--- a/robosuite/models/bases/leg_base_model.py
+++ b/robosuite/models/bases/leg_base_model.py
@@ -1,6 +1,7 @@
"""
Defines the base class of all mobile bases
"""
+
from xml.etree import ElementTree as ET
import numpy as np
diff --git a/robosuite/models/bases/no_actuation_base.py b/robosuite/models/bases/no_actuation_base.py
index 5c77f3ab19..971ed0304c 100644
--- a/robosuite/models/bases/no_actuation_base.py
+++ b/robosuite/models/bases/no_actuation_base.py
@@ -1,6 +1,7 @@
"""
Rethink's Generic Mount (Officially used on Sawyer).
"""
+
import numpy as np
from robosuite.models.bases.mobile_base_model import MobileBaseModel
diff --git a/robosuite/models/bases/null_mobile_base.py b/robosuite/models/bases/null_mobile_base.py
index a3e8e6d5a7..125bf8bd32 100644
--- a/robosuite/models/bases/null_mobile_base.py
+++ b/robosuite/models/bases/null_mobile_base.py
@@ -1,6 +1,7 @@
"""
Rethink's Generic Mount (Officially used on Sawyer).
"""
+
import numpy as np
from robosuite.models.bases.mobile_base_model import MobileBaseModel
diff --git a/robosuite/models/bases/null_mount.py b/robosuite/models/bases/null_mount.py
index a7896be35e..53a45be089 100644
--- a/robosuite/models/bases/null_mount.py
+++ b/robosuite/models/bases/null_mount.py
@@ -1,6 +1,7 @@
"""
Rethink's Generic Mount (Officially used on Sawyer).
"""
+
import numpy as np
from robosuite.models.bases.mount_model import MountModel
diff --git a/robosuite/models/bases/omron_mobile_base.py b/robosuite/models/bases/omron_mobile_base.py
index 12f40bb96a..49b2967819 100644
--- a/robosuite/models/bases/omron_mobile_base.py
+++ b/robosuite/models/bases/omron_mobile_base.py
@@ -1,6 +1,7 @@
"""
Omron LD-60 Mobile Base.
"""
+
import numpy as np
from robosuite.models.bases.mobile_base_model import MobileBaseModel
diff --git a/robosuite/models/bases/rethink_minimal_mount.py b/robosuite/models/bases/rethink_minimal_mount.py
index a0263bd200..ea05cb6d48 100644
--- a/robosuite/models/bases/rethink_minimal_mount.py
+++ b/robosuite/models/bases/rethink_minimal_mount.py
@@ -1,6 +1,7 @@
"""
Rethink's Alternative Mount (Officially used on Baxter).
"""
+
import numpy as np
from robosuite.models.bases.mount_model import MountModel
diff --git a/robosuite/models/bases/rethink_mount.py b/robosuite/models/bases/rethink_mount.py
index 3277ba2128..d9ac7f28b0 100644
--- a/robosuite/models/bases/rethink_mount.py
+++ b/robosuite/models/bases/rethink_mount.py
@@ -1,6 +1,7 @@
"""
Rethink's Generic Mount (Officially used on Sawyer).
"""
+
import numpy as np
from robosuite.models.bases.mount_model import MountModel
diff --git a/robosuite/models/bases/robot_base_model.py b/robosuite/models/bases/robot_base_model.py
index f1353f103c..cda9ead519 100644
--- a/robosuite/models/bases/robot_base_model.py
+++ b/robosuite/models/bases/robot_base_model.py
@@ -1,6 +1,7 @@
"""
Defines the base class of all mounts
"""
+
from typing import Dict, List
import numpy as np
diff --git a/robosuite/models/grippers/__init__.py b/robosuite/models/grippers/__init__.py
index 56089af8f7..03d8d9ac99 100644
--- a/robosuite/models/grippers/__init__.py
+++ b/robosuite/models/grippers/__init__.py
@@ -14,6 +14,7 @@
from .null_gripper import NullGripper
from .inspire_hands import InspireLeftHand, InspireRightHand
from .fourier_hands import FourierLeftHand, FourierRightHand
+from .xarm7_gripper import XArm7Gripper
GRIPPER_MAPPING = {
"RethinkGripper": RethinkGripper,
@@ -30,6 +31,7 @@
"InspireRightHand": InspireRightHand,
"FourierLeftHand": FourierLeftHand,
"FourierRightHand": FourierRightHand,
+ "XArm7Gripper": XArm7Gripper,
None: NullGripper,
}
diff --git a/robosuite/models/grippers/fourier_hands.py b/robosuite/models/grippers/fourier_hands.py
index 6a2a368d0f..ef0f3e8fad 100644
--- a/robosuite/models/grippers/fourier_hands.py
+++ b/robosuite/models/grippers/fourier_hands.py
@@ -1,6 +1,7 @@
"""
Dexterous hands for GR1 robot.
"""
+
import numpy as np
from robosuite.models.grippers.gripper_model import GripperModel
diff --git a/robosuite/models/grippers/gripper_factory.py b/robosuite/models/grippers/gripper_factory.py
index 79f5348e67..41c7b235fd 100644
--- a/robosuite/models/grippers/gripper_factory.py
+++ b/robosuite/models/grippers/gripper_factory.py
@@ -1,6 +1,7 @@
"""
Defines a string based method of initializing grippers
"""
+
from typing import Optional
from robosuite.models.grippers.gripper_model import GripperModel
diff --git a/robosuite/models/grippers/gripper_model.py b/robosuite/models/grippers/gripper_model.py
index 5ebe18b3ae..44c73f5be6 100644
--- a/robosuite/models/grippers/gripper_model.py
+++ b/robosuite/models/grippers/gripper_model.py
@@ -1,6 +1,7 @@
"""
Defines the base class of all grippers
"""
+
import numpy as np
import robosuite.utils.transform_utils as T
diff --git a/robosuite/models/grippers/gripper_tester.py b/robosuite/models/grippers/gripper_tester.py
index 8221d855fa..963dbe48af 100644
--- a/robosuite/models/grippers/gripper_tester.py
+++ b/robosuite/models/grippers/gripper_tester.py
@@ -1,6 +1,7 @@
"""
Defines GripperTester that is used to test the physical properties of various grippers
"""
+
import xml.etree.ElementTree as ET
import numpy as np
diff --git a/robosuite/models/grippers/inspire_hands.py b/robosuite/models/grippers/inspire_hands.py
index 1484fe55ea..097b2f1853 100644
--- a/robosuite/models/grippers/inspire_hands.py
+++ b/robosuite/models/grippers/inspire_hands.py
@@ -1,6 +1,7 @@
"""
Dexterous hands for GR1 robot.
"""
+
import numpy as np
from robosuite.models.grippers.gripper_model import GripperModel
diff --git a/robosuite/models/grippers/jaco_three_finger_gripper.py b/robosuite/models/grippers/jaco_three_finger_gripper.py
index 3a379a37dc..5e2b1acdff 100644
--- a/robosuite/models/grippers/jaco_three_finger_gripper.py
+++ b/robosuite/models/grippers/jaco_three_finger_gripper.py
@@ -1,6 +1,7 @@
"""
Gripper for Kinova's Jaco robot arm (has three fingers).
"""
+
import numpy as np
from robosuite.models.grippers.gripper_model import GripperModel
diff --git a/robosuite/models/grippers/null_gripper.py b/robosuite/models/grippers/null_gripper.py
index 48f6a80474..11017b09c9 100644
--- a/robosuite/models/grippers/null_gripper.py
+++ b/robosuite/models/grippers/null_gripper.py
@@ -1,6 +1,7 @@
"""
Null Gripper (if we don't want to attach gripper to robot eef).
"""
+
from robosuite.models.grippers.gripper_model import GripperModel
from robosuite.utils.mjcf_utils import xml_path_completion
diff --git a/robosuite/models/grippers/panda_gripper.py b/robosuite/models/grippers/panda_gripper.py
index 738d49f950..30f4473c7a 100644
--- a/robosuite/models/grippers/panda_gripper.py
+++ b/robosuite/models/grippers/panda_gripper.py
@@ -1,6 +1,7 @@
"""
Gripper for Franka's Panda (has two fingers).
"""
+
import numpy as np
from robosuite.models.grippers.gripper_model import GripperModel
diff --git a/robosuite/models/grippers/rethink_gripper.py b/robosuite/models/grippers/rethink_gripper.py
index 0c13154b4d..32ca352720 100644
--- a/robosuite/models/grippers/rethink_gripper.py
+++ b/robosuite/models/grippers/rethink_gripper.py
@@ -1,6 +1,7 @@
"""
Gripper with two fingers for Rethink Robots.
"""
+
import numpy as np
from robosuite.models.grippers.gripper_model import GripperModel
diff --git a/robosuite/models/grippers/robotiq_140_gripper.py b/robosuite/models/grippers/robotiq_140_gripper.py
index f5a31e250d..ddce616786 100644
--- a/robosuite/models/grippers/robotiq_140_gripper.py
+++ b/robosuite/models/grippers/robotiq_140_gripper.py
@@ -1,6 +1,7 @@
"""
Gripper with 140mm Jaw width from Robotiq (has two fingers).
"""
+
import numpy as np
from robosuite.models.grippers.gripper_model import GripperModel
diff --git a/robosuite/models/grippers/robotiq_85_gripper.py b/robosuite/models/grippers/robotiq_85_gripper.py
index 6eaeb39afe..5a3543aac2 100644
--- a/robosuite/models/grippers/robotiq_85_gripper.py
+++ b/robosuite/models/grippers/robotiq_85_gripper.py
@@ -1,6 +1,7 @@
"""
6-DoF gripper with its open/close variant
"""
+
import numpy as np
from robosuite.models.grippers.gripper_model import GripperModel
diff --git a/robosuite/models/grippers/robotiq_three_finger_gripper.py b/robosuite/models/grippers/robotiq_three_finger_gripper.py
index c7cc7c830f..0b6398c5ac 100644
--- a/robosuite/models/grippers/robotiq_three_finger_gripper.py
+++ b/robosuite/models/grippers/robotiq_three_finger_gripper.py
@@ -1,6 +1,7 @@
"""
Gripper with 11-DoF controlling three fingers and its open/close variant.
"""
+
import numpy as np
from robosuite.models.grippers.gripper_model import GripperModel
diff --git a/robosuite/models/grippers/wiping_gripper.py b/robosuite/models/grippers/wiping_gripper.py
index 692475efab..d3654dde30 100644
--- a/robosuite/models/grippers/wiping_gripper.py
+++ b/robosuite/models/grippers/wiping_gripper.py
@@ -1,6 +1,7 @@
"""
Gripper without fingers to wipe a surface
"""
+
from robosuite.models.grippers.gripper_model import GripperModel
from robosuite.utils.mjcf_utils import xml_path_completion
diff --git a/robosuite/models/grippers/xarm7_gripper.py b/robosuite/models/grippers/xarm7_gripper.py
new file mode 100644
index 0000000000..ca93cbe0c7
--- /dev/null
+++ b/robosuite/models/grippers/xarm7_gripper.py
@@ -0,0 +1,57 @@
+"""
+Gripper for UFactory's XArm7 (has two fingers).
+"""
+import numpy as np
+
+from robosuite.models.grippers.gripper_model import GripperModel
+from robosuite.utils.mjcf_utils import xml_path_completion
+
+
+class XArm7GripperBase(GripperModel):
+ """
+ Gripper for UFactory's XArm7.
+
+ Args:
+ idn (int or str): Number or some other unique identification string for this gripper instance
+ """
+
+ def __init__(self, idn=0):
+ super().__init__(xml_path_completion("grippers/xarm7_gripper.xml"), idn=idn)
+
+ def format_action(self, action):
+ return action
+
+ @property
+ def init_qpos(self):
+ return np.array([0.02, 0.0, 0.0, -0.02, 0.0, 0.0])
+
+ @property
+ def _important_geoms(self):
+ return {
+ "left_fingerpad": ["finger1_pad_collision"],
+ "right_fingerpad": ["finger2_pad_collision"],
+ }
+
+
+class XArm7Gripper(XArm7GripperBase):
+ """
+ Modifies XArm7 Gripper to only take one action.
+ """
+
+ def format_action(self, action):
+ """
+ -1 => fully open, +1 => fully closed
+ """
+ assert len(action) == self.dof # i.e., 1
+ # Suppose self.current_action is also shape (1,). Then:
+ delta = self.speed * np.sign(action)
+ self.current_action = np.clip(self.current_action + delta, -1.0, 1.0)
+ return self.current_action
+
+ @property
+ def speed(self):
+ return 0.2
+
+ @property
+ def dof(self):
+ return 1
diff --git a/robosuite/models/objects/composite/hammer.py b/robosuite/models/objects/composite/hammer.py
index dcfa96c9d0..acbe33b40c 100644
--- a/robosuite/models/objects/composite/hammer.py
+++ b/robosuite/models/objects/composite/hammer.py
@@ -146,9 +146,11 @@ def _get_geom_attrs(self):
geom_types="cylinder" if self.handle_shape == "cylinder" else "box",
geom_locations=(0, 0, 0),
geom_quats=(1, 0, 0, 0),
- geom_sizes=np.array([self.handle_radius, self.handle_length / 2.0])
- if self.handle_shape == "cylinder"
- else np.array([self.handle_radius, self.handle_radius, self.handle_length / 2.0]),
+ geom_sizes=(
+ np.array([self.handle_radius, self.handle_length / 2.0])
+ if self.handle_shape == "cylinder"
+ else np.array([self.handle_radius, self.handle_radius, self.handle_length / 2.0])
+ ),
geom_names="handle",
geom_rgbas=None if self.use_texture else self.rgba_handle,
geom_materials="wood_mat" if self.use_texture else None,
diff --git a/robosuite/models/objects/composite/pot_with_handles.py b/robosuite/models/objects/composite/pot_with_handles.py
index 157c162477..89340fdfb0 100644
--- a/robosuite/models/objects/composite/pot_with_handles.py
+++ b/robosuite/models/objects/composite/pot_with_handles.py
@@ -290,7 +290,6 @@ def _get_geom_attrs(self):
@property
def handle_distance(self):
-
"""
Calculates how far apart the handles are
diff --git a/robosuite/models/objects/objects.py b/robosuite/models/objects/objects.py
index e7681f8f39..8f43c05e0e 100644
--- a/robosuite/models/objects/objects.py
+++ b/robosuite/models/objects/objects.py
@@ -110,7 +110,6 @@ def exclude_from_prefixing(self, inp):
raise NotImplementedError
def _get_object_subtree(self):
-
"""
Returns a ET.Element
It is a