Skip to content

Commit 2529054

Browse files
committed
misc: remove chai_tea problem
1 parent c3648b9 commit 2529054

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

examples/fsm_walking_python_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def ankle_homing_complete():
265265

266266
with osl, osl_fsm:
267267
osl.update()
268-
osl.home(callback_functions=[knee_homing_complete, ankle_homing_complete])
268+
osl.home(callbacks=[knee_homing_complete, ankle_homing_complete])
269269
input("Press Enter to start walking...")
270270

271271
# knee

opensourceleg/actuators/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ def home(
763763
output_position_offset: float = 0.0,
764764
current_threshold: int = 5000,
765765
velocity_threshold: float = 0.001,
766-
callback_fn: Optional[Callable[[], None]] = None,
766+
callback: Optional[Callable[[], None]] = None,
767767
) -> None:
768768
"""
769769
Home the actuator.
@@ -778,7 +778,7 @@ def home(
778778
output_position_offset (float): Offset to add to the output position.
779779
current_threshold (int): Current threshold to stop homing.
780780
velocity_threshold (float): Velocity threshold to stop homing.
781-
callback_fn (Optional[Callable[[], None]]): Optional callback function to be
781+
callback (Optional[Callable[[], None]]): Optional callback function to be
782782
called when homing completes. The function should take no arguments and return None.
783783
784784
Examples:

opensourceleg/actuators/dephy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def home(
294294
output_position_offset: float = 0.0,
295295
current_threshold: int = 5000,
296296
velocity_threshold: float = 0.001,
297-
callback_fn: Optional[Callable[[], None]] = None,
297+
callback: Optional[Callable[[], None]] = None,
298298
) -> None:
299299
"""
300300
@@ -318,7 +318,7 @@ def home(
318318
velocity_threshold (float): Velocity threshold in rad/s to stop homing the joint or actuator.
319319
This is also used to detect if the actuator or joint has hit a hard stop.
320320
Default is 0.001 rad/s.
321-
callback_fn (Optional[Callable[[], None]]): Optional callback function to be called when homing completes.
321+
callback (Optional[Callable[[], None]]): Optional callback function to be called when homing completes.
322322
The function should take no arguments and return None.
323323
Examples:
324324
>>> actuator = DephyActuator(port='/dev/ttyACM0')
@@ -348,8 +348,8 @@ def home(
348348

349349
if abs(self.output_velocity) <= velocity_threshold or abs(self.motor_current) >= current_threshold:
350350
self.set_motor_voltage(value=0)
351-
if callback_fn is not None:
352-
callback_fn()
351+
if callback is not None:
352+
callback()
353353
is_homing = False
354354

355355
except KeyboardInterrupt:

opensourceleg/actuators/tmotor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def home(
199199
output_position_offset: float = 0.0,
200200
current_threshold: int = 5000,
201201
velocity_threshold: float = 0.001,
202-
callback_fn: Optional[Callable[[], None]] = None,
202+
callback: Optional[Callable[[], None]] = None,
203203
):
204204
"""
205205
Home the actuator and corresponding joint by moving it to the zero position.
@@ -218,7 +218,7 @@ def home(
218218
Default is 5000 mA.
219219
velocity_threshold (float): Velocity threshold in rad/s to stop homing the joint or actuator.
220220
Default is 0.001 rad/s.
221-
callback_fn (Optional[Callable[[], None]]): Optional callback function to be called when homing completes.
221+
callback (Optional[Callable[[], None]]): Optional callback function to be called when homing completes.
222222
The function should take no arguments and return None.
223223
"""
224224
# TODO: implement homing

opensourceleg/robots/osl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def home(
4444
output_position_offset: Optional[dict[str, float]] = None,
4545
current_threshold: int = 5000,
4646
velocity_threshold: float = 0.001,
47-
callback_functions: Optional["Iterable[Optional[Callable[[], None]]]"] = None,
47+
callbacks: Optional["Iterable[Optional[Callable[[], None]]]"] = None,
4848
) -> None:
4949
"""
5050
Call the home method for all actuators.
@@ -58,7 +58,7 @@ def home(
5858
Default is 0.0 for knee and 30.0 for ankle.
5959
current_threshold: The current threshold to apply to the actuators during homing. Default is 5000.
6060
velocity_threshold: The velocity threshold to apply to the actuators during homing. Default is 0.001.
61-
callback_functions (Optional[Iterable[Optional[Callable[[], None]]]]):
61+
callbacks (Optional[Iterable[Optional[Callable[[], None]]]]):
6262
Optional list or iterable of callback functions, one per actuator,
6363
to be called when each actuator's homing completes.
6464
Each function should take no arguments and return None. If None, no callbacks are used.
@@ -67,15 +67,15 @@ def home(
6767
output_position_offset = {"knee": 0.0, "ankle": np.deg2rad(30.0)}
6868
if homing_direction is None:
6969
homing_direction = {"knee": -1, "ankle": -1}
70-
for actuator, callback_fn in zip(self.actuators.values(), callback_functions or [None] * len(self.actuators)):
70+
for actuator, callback in zip(self.actuators.values(), callbacks or [None] * len(self.actuators)):
7171
actuator.home(
7272
homing_voltage=homing_voltage,
7373
homing_frequency=homing_frequency,
7474
homing_direction=homing_direction[actuator.tag],
7575
output_position_offset=output_position_offset[actuator.tag],
7676
current_threshold=current_threshold,
7777
velocity_threshold=velocity_threshold,
78-
callback_fn=callback_fn,
78+
callback=callback,
7979
)
8080

8181
LOGGER.info(

tutorials/robots/osl/homing_joints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def ankle_homing_complete():
8484
output_position_offset={"knee": 0.0, "ankle": np.deg2rad(30.0)},
8585
current_threshold=5000,
8686
velocity_threshold=0.001,
87-
callback_functions=[knee_homing_complete, ankle_homing_complete],
87+
callbacks=[knee_homing_complete, ankle_homing_complete],
8888
)
8989

9090
osl.knee.set_control_mode(CONTROL_MODES.CURRENT)

0 commit comments

Comments
 (0)