Skip to content

Commit

Permalink
BUGFIX: Version robust way of getting robotiq max_width
Browse files Browse the repository at this point in the history
  • Loading branch information
vikashplus committed Mar 14, 2023
1 parent 1bfb678 commit a8bf20f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mj_envs/robot/hardware_robotiq.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ def connect(self, policy=None):
print("RBQ:> Testing {} connection: ".format(self.name), end="")
if self.okay():
print("Okay")
self.max_width = self.robot.get_state().max_width
# get max_width based on polymetis version
if self.robot.metadata:
self.max_width = self.robot.metadata.max_width
elif self.robot.get_state().max_width:
self.max_width = self.robot.get_state().max_width
else:
self.max_width = 0.085
connection = True
else:
print("Not ready. Please retry connection")
Expand Down

0 comments on commit a8bf20f

Please sign in to comment.