Skip to content

Commit

Permalink
Compliant modes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-decoster committed Aug 20, 2024
1 parent 952999e commit a131a71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions airo-robots/airo_robots/drives/hardware/kelo_robile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ def timeout_awaitable() -> bool:

return AwaitableAction(timeout_awaitable)

def enable_compliant_mode(self, enabled: bool):
def enable_compliant_mode(self, enabled: bool, compliant_level: int = 1): # TODO: Use enum variants, document.
if enabled:
self._kelo_robile.set_driver_type(PlatformDriverType.COMPLIANT)
if compliant_level == 1:
self._kelo_robile.set_driver_type(PlatformDriverType.COMPLIANT_WEAK)
elif compliant_level == 2:
self._kelo_robile.set_driver_type(PlatformDriverType.COMPLIANT_MODERATE)
else:
self._kelo_robile.set_driver_type(PlatformDriverType.COMPLIANT_STRONG)
else:
self._kelo_robile.set_driver_type(PlatformDriverType.VELOCITY)
2 changes: 1 addition & 1 deletion airo-robots/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"click",
"airo-typing",
"airo-spatial-algebra",
"airo-tulip==0.0.3",
"airo-tulip==0.0.4",
],
packages=setuptools.find_packages(),
package_data={"airo_robots": ["py.typed"]},
Expand Down

0 comments on commit a131a71

Please sign in to comment.