Skip to content

Commit 7934ec5

Browse files
Refactor Pybullet Robots (#1169)
* Move Single Arm Robots to their own module * Fix the linting issue
1 parent 1bf7801 commit 7934ec5

8 files changed

Lines changed: 408 additions & 383 deletions

File tree

src/envs/pybullet_blocks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
from predicators.src.envs.blocks import BlocksEnv
1212
from predicators.src.envs.pybullet_env import PyBulletEnv, \
1313
create_pybullet_block
14-
from predicators.src.envs.pybullet_robots import _SingleArmPyBulletRobot, \
15-
create_change_fingers_option, create_move_end_effector_to_pose_option, \
14+
from predicators.src.envs.pybullet_robots import \
15+
create_change_fingers_option, create_move_end_effector_to_pose_option
16+
from predicators.src.pybullet_helpers.robots import SingleArmPyBulletRobot, \
1617
create_single_arm_pybullet_robot
1718
from predicators.src.settings import CFG
1819
from predicators.src.structs import Array, Object, ParameterizedOption, \
@@ -214,7 +215,7 @@ def _initialize_pybullet(self) -> None:
214215
self._physics_client_id))
215216

216217
def _create_pybullet_robot(
217-
self, physics_client_id: int) -> _SingleArmPyBulletRobot:
218+
self, physics_client_id: int) -> SingleArmPyBulletRobot:
218219
ee_home = (self.robot_init_x, self.robot_init_y, self.robot_init_z)
219220
return create_single_arm_pybullet_robot(CFG.pybullet_robot, ee_home,
220221
self._ee_orn,

src/envs/pybullet_cover.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
from predicators.src.envs.cover import CoverEnv
1111
from predicators.src.envs.pybullet_env import PyBulletEnv, \
1212
create_pybullet_block
13-
from predicators.src.envs.pybullet_robots import _SingleArmPyBulletRobot, \
14-
create_change_fingers_option, create_move_end_effector_to_pose_option, \
13+
from predicators.src.envs.pybullet_robots import \
14+
create_change_fingers_option, create_move_end_effector_to_pose_option
15+
from predicators.src.pybullet_helpers.robots import SingleArmPyBulletRobot, \
1516
create_single_arm_pybullet_robot
1617
from predicators.src.settings import CFG
1718
from predicators.src.structs import Action, Array, Object, \
@@ -134,7 +135,7 @@ def _initialize_pybullet(self) -> None:
134135
self._physics_client_id))
135136

136137
def _create_pybullet_robot(
137-
self, physics_client_id: int) -> _SingleArmPyBulletRobot:
138+
self, physics_client_id: int) -> SingleArmPyBulletRobot:
138139
ee_home = (self._workspace_x, self._robot_init_y, self._workspace_z)
139140
return create_single_arm_pybullet_robot(CFG.pybullet_robot, ee_home,
140141
self._ee_orn,

src/envs/pybullet_env.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from predicators.src import utils
1515
from predicators.src.envs import BaseEnv
16-
from predicators.src.envs.pybullet_robots import _SingleArmPyBulletRobot
16+
from predicators.src.pybullet_helpers.robots import SingleArmPyBulletRobot
1717
from predicators.src.settings import CFG
1818
from predicators.src.structs import Action, Array, Pose3D, State, Task, Video
1919

@@ -116,7 +116,7 @@ def _initialize_pybullet(self) -> None:
116116

117117
@abc.abstractmethod
118118
def _create_pybullet_robot(
119-
self, physics_client_id: int) -> _SingleArmPyBulletRobot:
119+
self, physics_client_id: int) -> SingleArmPyBulletRobot:
120120
"""Make and return a PyBullet robot object in the given
121121
physics_client_id.
122122

0 commit comments

Comments
 (0)