Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VR System #318

Merged
merged 45 commits into from
Jan 13, 2024
Merged

VR System #318

merged 45 commits into from
Jan 13, 2024

Conversation

wensi-ai
Copy link
Contributor

@wensi-ai wensi-ai commented Nov 8, 2023

Features

  • Teleoperation System for OmniGibson
    • Supports OpenXR (Meta Quest), SteamVR (HTC VIVE), SpaceMouse, Keyboard teleoperation
    • Added BehaviorRobot
    • 3 demo provided for scene touring, controller teleoperating, and hand tracking
  • Assisted Grasping for ManipulationRobot
    • Fully tested with Fetch, Franka, Allegro, and Behaviorbot
    • Grasping demo updated

Known issues

  • [Solved] Tiago IK is not quite working possibly due to low joint stiffness/friction, so not tested with VR
  • [Solved] Fetch base is very unstable, especially when moving back and forth repetitively

@wensi-ai wensi-ai added the enhancement New feature or request label Nov 8, 2023
@wensi-ai wensi-ai self-assigned this Nov 8, 2023
@wensi-ai wensi-ai force-pushed the xr branch 2 times, most recently from 8f27401 to 5179552 Compare November 8, 2023 17:23
@wensi-ai wensi-ai marked this pull request as ready for review November 9, 2023 19:22
omnigibson/__init__.py Outdated Show resolved Hide resolved
Copy link
Contributor

@cremebrule cremebrule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Rubber stamped the xr_utils.py since there's a lot of magic number shenanigans going on there but I assume it's all been validated to work. Is there any unit test we can add?

@wensi-ai wensi-ai linked an issue Jan 12, 2024 that may be closed by this pull request
Copy link
Member

@ChengshuLi ChengshuLi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, feel free to merge!

@wensi-ai wensi-ai merged commit 9822783 into og-develop Jan 13, 2024
4 checks passed
@wensi-ai wensi-ai deleted the xr branch January 13, 2024 00:40
@Bailey-24
Copy link

hello, I can't use the vr system with Data Collection / Playback, how to solve.

I have try

    cfg = dict(scene=scene_cfg, robots=[robot_cfg], objects=object_cfg)
    # Create the environment
    env = og.Environment(configs=cfg)
    # Wrap the environment with DataCollectionWrapper
    data_env = DataCollectionWrapper(
        env=env,
        output_path=collect_hdf5_path,
        only_successes=False,  # Set to True if you only want to record successful episodes
    )
    # Use the wrapped environment as you would normally
    obs, info = data_env.reset()
    
    # update viewer camera pose
    og.sim.viewer_camera.set_position_orientation(position=[-0.22, 0.99, 1.09], orientation=[-0.14, 0.47, 0.84, -0.23])
    # Start teleoperation system
    robot = env.robots[0]

    # Initialize teleoperation system
    teleop_sys = TeleopSystem(config=teleop_config, robot=robot, show_control_marker=False)
    teleop_sys.start()

    # main simulation loop
    for _ in range(2000):
        # Get observation from the original env's robot
        # obs = teleop_sys.get_obs()
        action = teleop_sys.get_action(obs)
        # Step through the data collection wrapper
        obs, reward, terminated, truncated, info = data_env.step(action)
        
    # Save the collected data
    print(f"Saving data to {collect_hdf5_path}")
    data_env.save_data()
    # Shut down the environment cleanly at the end
    # og.sim.stop()  
    # teleop_sys.stop()
    og.clear()
    print("Data collection finished!")

but the system can't receive the control input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
4 participants