refactor/lekiwi robot (#863)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Simon Alibert <simon.alibert@huggingface.co> Co-authored-by: Simon Alibert <75076266+aliberts@users.noreply.github.com>
This commit is contained in:
28
examples/teleoperators/teleop_keyboard_app.py
Executable file
28
examples/teleoperators/teleop_keyboard_app.py
Executable file
@@ -0,0 +1,28 @@
|
||||
import logging
|
||||
import time
|
||||
|
||||
from lerobot.common.teleoperators.keyboard import KeyboardTeleop, KeyboardTeleopConfig
|
||||
|
||||
|
||||
def main():
|
||||
logging.info("Configuring Keyboard Teleop")
|
||||
keyboard_config = KeyboardTeleopConfig()
|
||||
keyboard = KeyboardTeleop(keyboard_config)
|
||||
|
||||
logging.info("Connecting Keyboard Teleop")
|
||||
keyboard.connect()
|
||||
|
||||
logging.info("Starting Keyboard capture")
|
||||
i = 0
|
||||
while i < 20:
|
||||
action = keyboard.get_action()
|
||||
print("Captured keys: %s", action)
|
||||
time.sleep(1)
|
||||
i += 1
|
||||
|
||||
keyboard.disconnect()
|
||||
logging.info("Finished LeKiwi cleanly")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user