Skip to content

Commit 5550cb2

Browse files
committed
style(linting): fix linting in scene dict (#266)
1 parent 5c74e42 commit 5550cb2

File tree

8 files changed

+19
-11
lines changed

8 files changed

+19
-11
lines changed

examples/fr3/fr3_direct_control.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def main():
6060
robot: rcs.common.Robot
6161
gripper: rcs.common.Gripper
6262
if ROBOT_INSTANCE == RobotPlatform.SIMULATION:
63-
simulation = sim.Sim(rcs.scenes["fr3_empty_world"].mjb)
63+
scene = rcs.scenes["fr3_empty_world"]
64+
simulation = sim.Sim(scene.mjb or scene.mjcf_scene)
6465
robot_cfg = sim.SimRobotConfig()
6566
robot_cfg.add_id("0")
6667
robot_cfg.tcp_offset = rcs.common.Pose(rcs.common.FrankaHandTCPOffset())

examples/so101/so101_env_cartesian_control.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def main():
2525
robot_cfg.robot_type = rcs.common.RobotType.SO101
2626
robot_cfg.attachment_site = "gripper"
2727
robot_cfg.arm_collision_geoms = []
28-
robot_cfg.mjcf_scene_path = rcs.scenes["so101_empty_world"].mjb
28+
scene = rcs.scenes["so101_empty_world"]
29+
robot_cfg.mjcf_scene_path = scene.mjb or scene.mjcf_scene
2930
robot_cfg.kinematic_model_path = rcs.scenes["so101_empty_world"].mjcf_robot
3031

3132
gripper_cfg = sim.SimGripperConfig()

examples/so101/so101_env_joint_control.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def main():
2626
robot_cfg.robot_type = rcs.common.RobotType.SO101
2727
robot_cfg.attachment_site = "gripper"
2828
robot_cfg.arm_collision_geoms = []
29-
robot_cfg.mjcf_scene_path = rcs.scenes["so101_empty_world"].mjb
29+
scene = rcs.scenes["so101_empty_world"]
30+
robot_cfg.mjcf_scene_path = scene.mjb or scene.mjcf_scene
3031
robot_cfg.kinematic_model_path = rcs.scenes["so101_empty_world"].mjcf_robot
3132

3233
gripper_cfg = sim.SimGripperConfig()

examples/ur5e/ur5e_env_cartesian_control.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def main():
4444
robot_sim_cfg.robot_type = rcs.common.RobotType.UR5e
4545
robot_sim_cfg.attachment_site = "attachment_site"
4646
robot_sim_cfg.arm_collision_geoms = []
47-
robot_sim_cfg.mjcf_scene_path = rcs.scenes["ur5e_empty_world"].mjb
47+
scene = rcs.scenes["ur5e_empty_world"]
48+
robot_sim_cfg.mjcf_scene_path = scene.mjb or scene.mjcf_scene
4849
robot_sim_cfg.kinematic_model_path = rcs.scenes["ur5e_empty_world"].mjcf_robot
4950
robot_sim_cfg.base = "base"
5051
robot_sim_cfg.tcp_offset = rcs.common.Pose()

examples/ur5e/ur5e_env_joint_control.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def main():
4545
robot_sim_cfg.robot_type = rcs.common.RobotType.UR5e
4646
robot_sim_cfg.attachment_site = "attachment_site"
4747
robot_sim_cfg.arm_collision_geoms = []
48-
robot_sim_cfg.mjcf_scene_path = rcs.scenes["ur5e_empty_world"].mjb
48+
scene = rcs.scenes["ur5e_empty_world"]
49+
robot_sim_cfg.mjcf_scene_path = scene.mjb or scene.mjcf_scene
4950
robot_sim_cfg.kinematic_model_path = rcs.scenes["ur5e_empty_world"].mjcf_robot
5051
robot_sim_cfg.base = "base"
5152

examples/xarm7/xarm7_env_cartesian_control.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def main():
6060
robot_cfg.robot_type = rcs.common.RobotType.XArm7
6161
robot_cfg.attachment_site = "attachment_site"
6262
robot_cfg.arm_collision_geoms = []
63-
robot_cfg.mjcf_scene_path = rcs.scenes["xarm7_empty_world"].mjb
63+
scene = rcs.scenes["xarm7_empty_world"]
64+
robot_cfg.mjcf_scene_path = scene.mjb or scene.mjcf_scene
6465
robot_cfg.kinematic_model_path = rcs.scenes["xarm7_empty_world"].mjcf_robot
6566
env_rel = SimEnvCreator()(
6667
robot_cfg=robot_cfg,

examples/xarm7/xarm7_env_joint_control.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def main():
6060
robot_cfg.robot_type = rcs.common.RobotType.XArm7
6161
robot_cfg.attachment_site = "attachment_site"
6262
robot_cfg.arm_collision_geoms = []
63-
robot_cfg.mjcf_scene_path = rcs.scenes["xarm7_empty_world"].mjb
63+
scene = rcs.scenes["xarm7_empty_world"]
64+
robot_cfg.mjcf_scene_path = scene.mjb or scene.mjcf_scene
6465
robot_cfg.kinematic_model_path = rcs.scenes["xarm7_empty_world"].mjcf_robot
6566
env_rel = SimEnvCreator()(
6667
robot_cfg=robot_cfg,

python/rcs/envs/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@
1717

1818
def default_sim_robot_cfg(scene: str = "fr3_empty_world", idx: str = "0") -> sim.SimRobotConfig:
1919
robot_cfg = rcs.sim.SimRobotConfig()
20-
robot_cfg.robot_type = rcs.scenes[scene].robot_type
20+
scene_cfg = rcs.scenes[scene]
21+
robot_cfg.robot_type = scene_cfg.robot_type
2122
robot_cfg.tcp_offset = common.Pose(common.FrankaHandTCPOffset())
2223
# robot_cfg.add_id(idx)
2324
if rcs.scenes[scene].mjb is not None:
2425
robot_cfg.mjcf_scene_path = rcs.scenes[scene].mjb
2526
else:
26-
robot_cfg.mjcf_scene_path = rcs.scenes[scene].mjcf_scene
27-
robot_cfg.kinematic_model_path = rcs.scenes[scene].mjcf_robot
28-
# robot_cfg.kinematic_model_path = rcs.scenes[scene].urdf
27+
robot_cfg.mjcf_scene_path = scene_cfg.mjcf_scene
28+
robot_cfg.kinematic_model_path = scene_cfg.mjcf_robot
29+
# robot_cfg.kinematic_model_path = scene_cfg.urdf
2930
return robot_cfg
3031

3132

0 commit comments

Comments
 (0)