Skip to content

Commit a1e8294

Browse files
refactor(hand): fix pyformat, pylint and pytest
1 parent e95c1f4 commit a1e8294

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

python/rcsss/envs/factories.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
RandomCubePos,
2828
SimWrapper,
2929
)
30-
from rcsss.hand.hand import Hand
31-
from rcsss.hand.tilburg_hand_control import TilburgHandControl
3230
from rcsss.envs.space_utils import Vec7Type
3331
from rcsss.envs.utils import (
3432
default_fr3_hw_gripper_cfg,
@@ -38,6 +36,8 @@
3836
default_realsense,
3937
get_urdf_path,
4038
)
39+
from rcsss.hand.hand import Hand
40+
from rcsss.hand.tilburg_hand_control import TilburgHandControl
4141

4242
logger = logging.getLogger(__name__)
4343
logger.setLevel(logging.INFO)

python/rcsss/hand/hand.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def __init__(self):
88
pass
99

1010
def grasp(self, value: float):
11-
self.value = value # to pass pylint
11+
self.value = value # to pass pylint
1212
message = "This method should be overridden by subclasses."
1313
raise NotImplementedError(message)
1414

@@ -25,7 +25,7 @@ def get_pos_vector(self):
2525
raise NotImplementedError(message)
2626

2727
def set_pos_vector(self, values: list):
28-
self.values = values # to pass pylint
28+
self.values = values # to pass pylint
2929
message = "This method should be overridden by subclasses."
3030
raise NotImplementedError(message)
3131

@@ -40,8 +40,8 @@ class Hand:
4040
def __init__(self, hand: HandControl):
4141
self._hand = hand
4242

43-
def grasp(self):
44-
self._hand.grasp()
43+
def grasp(self, value):
44+
self._hand.grasp(value)
4545

4646
def reset(self):
4747
self._hand.set_zero_pos()

python/rcsss/hand/tilburg_hand_control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ def sleep(self, seconds: float):
124124
"""
125125
sleep(seconds)
126126

127-
def set_joint_pos(self, finger_joint : Finger, pos_value: float):
127+
def set_joint_pos(self, finger_joint: Finger, pos_value: float):
128128
"""
129129
Sets a single joint to a specific normalized position.
130130
"""
131131
self._motors.set_pos_single(finger_joint, pos_value, unit=self.pos_value_unit)
132132
self._pos_normalized[int(finger_joint)] = pos_value
133133
logger.info(f"Set joint {finger_joint.name} to {pos_value:.2f}")
134134

135-
def reset_joint_pos(self, finger_joint : Finger):
135+
def reset_joint_pos(self, finger_joint: Finger):
136136
"""
137137
Resets a specific joint to zero.
138138
"""

0 commit comments

Comments
 (0)