Skip to content

Running demonstration with keyboard control #96

@pull-ups

Description

@pull-ups

Hi, Thank you for sharing awesome codbase.
I have a question for crafting human demonstration data.

in scripts/collect_demonstration.py, it seems that we have 2 choice for collecting human demonstrations: keyboard and spacemouse.
However, I don't have spacemouse, so when I run

python scripts/collect_demonstration.py --device keyboard --robots Panda --bddl-file $BDDL_FILE_DIR
(BDDL_FILE_DIR is one of bddl file in directory.)

below error occurs:

Traceback (most recent call last):
  File "scripts/collect_demonstration.py", line 317, in <module>
    env.viewer.add_keypress_callback("any", device.on_press)
TypeError: add_keypress_callback() takes 2 positional arguments but 3 were given

When I change as below,

        # env.viewer.add_keypress_callback("any", device.on_press)
        # env.viewer.add_keyup_callback("any", device.on_release)
        # env.viewer.add_keyrepeat_callback("any", device.on_press)
        env.viewer.add_keypress_callback(device.on_press)
        env.viewer.add_keyup_callback(device.on_release)
        env.viewer.add_keyrepeat_callback(device.on_press)

And then below error occurs:

Traceback (most recent call last):
  File "scripts/collect_demonstration.py", line 321, in <module>
    env.viewer.add_keyup_callback(device.on_release)
AttributeError: 'OpenCVRenderer' object has no attribute 'add_keyup_callback'

There was no add_keyup_callback on Robosuit's OpenCVRender in the first place.

How can I solve it?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions