Skip to content

Commit 9a1bba8

Browse files
Format
1 parent 66793b6 commit 9a1bba8

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

robosuite/robots/robot.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import os
44
from collections import OrderedDict
5-
from typing import Optional, Dict
5+
from typing import Dict, Optional
66

77
import numpy as np
88

@@ -329,9 +329,7 @@ def setup_references(self):
329329
self.sim.model.get_joint_qpos_addr(x) for x in self.robot_model._torso_joints
330330
]
331331
# indices for all joints (includes arms, base, torso, but not gripper joints, as those are handled separately)
332-
self._ref_all_joint_pos_indexes = [
333-
self.sim.model.get_joint_qpos_addr(x) for x in self.robot_model.all_joints
334-
]
332+
self._ref_all_joint_pos_indexes = [self.sim.model.get_joint_qpos_addr(x) for x in self.robot_model.all_joints]
335333

336334
def setup_observables(self):
337335
"""
@@ -664,25 +662,25 @@ def get_robot_joint_positions(self):
664662
def get_all_robot_joint_positions(self) -> Dict[str, float]:
665663
"""
666664
Returns all joint positions including robot joints (arms, base, torso) and gripper joints.
667-
665+
668666
Returns:
669667
dict: joint name -> joint position (in angles / radians)
670668
"""
671669
joint_positions = {}
672-
670+
673671
# Get all robot joint positions (includes arms, base, torso, etc.)
674672
all_joint_names = self.robot_model.all_joints
675673
for i, joint_name in enumerate(all_joint_names):
676674
joint_positions[joint_name] = self.sim.data.qpos[self._ref_all_joint_pos_indexes[i]]
677-
675+
678676
# Add gripper joint positions for all arms
679677
for arm in self.arms:
680678
if self.has_gripper[arm]:
681679
gripper_joint_names = self.gripper_joints[arm]
682680
gripper_positions = self.sim.data.qpos[self._ref_gripper_joint_pos_indexes[arm]]
683681
for joint_name, position in zip(gripper_joint_names, gripper_positions):
684682
joint_positions[joint_name] = position
685-
683+
686684
return joint_positions
687685

688686
def get_gripper_joint_positions(self, gripper_arm: Optional[str] = None):

0 commit comments

Comments
 (0)