Skip to content

Commit

Permalink
Update arms.py and mobile_base.py dosctrings
Browse files Browse the repository at this point in the history
  • Loading branch information
glannuzel committed Oct 9, 2024
1 parent c634faf commit d3bb808
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/reachy2_sdk/parts/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,21 +232,21 @@ def turn_off_smoothly(self) -> None:

def is_on(self) -> bool:
"""
Returns True if all actuators of the arm are stiff.
Check if all actuators of the arm are stiff.
Returns:
a boolean value. It will return `True` if all actuators of the arm are stiff, and `False` otherwise.
bool: `True` if all actuators of the arm are stiff, `False` otherwise.
"""
if not super().is_on():
return False
return True

def is_off(self) -> bool:
"""
Returns True if all actuators of the arm are stiff.
Check if all actuators of the arm are compliant.
Returns:
a boolean value. It will return True if all actuators of the arm are stiff, otherwise it will return False.
bool: `True` if all actuators of the arm are compliant, `False` otherwise.
"""
if not super().is_off():
return False
Expand Down
14 changes: 12 additions & 2 deletions src/reachy2_sdk/parts/mobile_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,21 @@ def _distance_to_goto_goal(self) -> Dict[str, float]:
return distance

def is_on(self) -> bool:
"""Return True if the mobile base is not compliant."""
"""
Check if the mobile base is currently stiff (not in free-wheel mode).
Returns:
bool: `True` if the mobile base is not compliant, `False` otherwise.
"""
return not self._drive_mode == "free_wheel"

def is_off(self) -> bool:
"""Return True if the mobile base is compliant."""
"""
Check if the mobile base is currently compliant (in free-wheel mode).
Returns:
bool: `True` if the mobile base is compliant, `False` otherwise.
"""
if self._drive_mode == "free_wheel":
return True
return False
Expand Down

0 comments on commit d3bb808

Please sign in to comment.