Skip to content

ROS package for publishing HTV VIVE device locations.

License

Notifications You must be signed in to change notification settings

IIT-SoftBots/vive_ros

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

87 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

jntlb_logo

Vive ROS package extended, based on knorth55/vive_ros

ROS Interface package for HTC Vive and Valve Index

πŸ“– Table of Contents

Table of Contents
  1. ➀ About The Project
  2. ➀ Requirements
  3. ➀ Folder Structure
  4. ➀ Installation
  5. ➀ Usage
  6. ➀ Troubleshoot
  7. ➀ Contributors

-----------------------------------------------------

πŸ“ About The Project

Vive ROS package is made by two nodes:

-vive_ctrl: Publishes the hmd and controllers poses tracked by the system into a ROS topic in geometry_msgs/PoseStamped format. In addition, it publishes also the commands coming from the controller buttons. Runs at 100Hz.

-vive_hmd: Reads two topics in sensor_msgs/ImageCompressed format and stream the input image streams into the lenses of the hmd. Runs 45 Hz.

-----------------------------------------------------

⚠️ Requirements

Hardware Requirements:

  • VR-Ready GPU (>= Scheda grafica NVIDIA GeForce RTX 2070 Max-Q in our case)

System Requirements:

  • OS: Ubuntu 20.04 lts, kernel: 5.11.0-27-generic
  • Nvidia GPU Drivers : >=470.57.02
  • Compiler: cmake C/CXX GNU 7.5.0
  • Framework: Ros Noetic

Software requirements:

  • libglew-dev
  • OpenVR : 1.3.22
  • Steam API: v020 | package version: 1647446817
  • SteamVR : 1.22.6 Beta version or 1.21.12

-----------------------------------------------------

🌡 Folder Structure

vive_ros
. 
|
β”œβ”€β”€ conf
β”‚Β Β  β”œβ”€β”€ index_param.yaml
β”‚Β Β  └── vive_param.yaml
|
β”œβ”€β”€ images
β”‚Β Β  β”œβ”€β”€ controller_frame.jpg
β”‚Β Β  β”œβ”€β”€ hmd_frame.jpg
β”‚Β Β  β”œβ”€β”€ jntlb_logo.png
β”‚Β Β  └── lighthouse_frame.jpg
|
β”œβ”€β”€ include
β”‚Β Β  β”œβ”€β”€ hellovr_opengl_main.h
β”‚Β Β  β”œβ”€β”€ hellovr_vulkan_main.h
β”‚Β Β  └── vr_interface.h
|
β”œβ”€β”€ launch
β”‚Β Β  β”œβ”€β”€ vive_ctrl.launch
β”‚Β Β  β”œβ”€β”€ vive_framework.launch
β”‚Β Β  └── vive_hmd.launch
|
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ vive_ctrl.cpp
β”‚   β”œβ”€β”€ vive_hmd.cpp
|   └── vr_interface.cpp
|
β”œβ”€β”€ CMakeLists.txt
β”œβ”€β”€ LICENSE
β”œβ”€β”€ package.xml
└── README.md

-----------------------------------------------------

πŸ‘©β€πŸ’» Installation

  • GLEW OpenGL Extension Wrangler library installation:

     ```sh
     $ sudo apt update
     $ sudo apt install libglew-dev
     ```
    
  • Valve's OpenVR SDK installation:

    1. Download Valve's OpenVR SDK

      $ cd ~
      $ mkdir libraries
      $ cd libraries
      $ git clone https://github.com/ValveSoftware/openvr.git -b v1.3.22 
    2. Build the SDK

      $ cd openvr
      $ mkdir build
      $ cd build
      $ cmake -DCMAKE_BUILD_TYPE=Release ../
      $ make
  • Steam and SteamVR installation:

    1. Download Steam latest version. You should get the file steam_latest.deb in your ~/Downloads folder

    2. Run Steam

      $ sudo apt install steam
    3. Setup or log in into your Steam account and install SteamVR from the Steam store

  • Install ROS package:

    1. Install vive_ros package in the catkin_ws

      $ cd ~/catkin_ws/src
      $ git clone https://github.com/JOiiNT-LAB/vive_ros.git
      $ cd ..
      $ catkin_make

-----------------------------------------------------

βš™οΈ Usage

  • [ATTENTION] Disconnect all the HMD cable from the computer before to turn it on, this is to avoid the pc and steamVR to recognize the HMD as an external monitor and trigger the extended display mode. We want our HMD to be in direct mode.

  • Launch ROS nodes:

    1. Start roscore:

        $ roscore
    2. Edit the launch file to select the desired VR-set and the topic names for the input video

        <!-- VALVE INDEX SPECS -->
        <arg name="interpupillar_distance" default="200.0"/>
        <arg name="cam_f" default="720"/>
      
        <!-- HTC VIVE SPECS -->
        <!-- <arg name="interpupillar_distance" default="100.0"/> -->
        <!-- <arg name="cam_f" default="600"/> -->
      
        <arg name="image_left" default="/camera/left/image_raw/compressed"/>
        <arg name="image_right" default="/camera/right/image_raw/compressed"/>
        <arg name="image_left_info" default="/camera/left/camera_info" />
        <arg name="image_right_info" default="/camera/right/camera_info" />
      
    3. Launch controllers node:

        $ roslaunch vive_ros vive_ctrl.launch
    4. Launch HMD node:

        $ roslaunch vive_ros vive_hmd.launch
    5. There is also a launcher dedicated to the Joiint Lab teleoperation framework called vive_framework launcher. It works similarly to the other launch files.

    6. The sensor frame orientations are shown in the images below, they are similar for the INDEX set. (DISCLAIMER) The origin of the reference frames drawn is not the real one.

    Alt text

    Alt text

    Alt text

  • Controllers tracking without HMD:

It is possible to use track the controllers without connecting the HMD, but the controllers must be connected via USB. To set this mode:

  1. Enable a null (simulated) headset editing

      gedit ~/.steam/steam/steamapps/common/SteamVR/resources/settings/default.vrsettings
  2. Change the third line from "requireHmd" : true to "requireHmd" : false

  3. Add "activateMultipleDrivers" : true

  4. Add the line "forcedDriver": "null" beneath it.

  5. Open default.vrsettings

      $ gedit ~/.steam/steam/steamapps/common/SteamVR/drivers/null/resources/settings/default.vrsettings
  6. Set "enable": true to enable it.

  7. Now launch Steam and SteamVR and then the nodes as already explained.

-----------------------------------------------------

βš™οΈ Troubleshoot

A list of the most common problems found during installation and usage:

  • The system is using vulkan driver for the wrong graphic card, Force the system to use nvidia graphic card SteamVR takes the wrong Vulkan implementation. Try this:

    sudo mv /usr/share/vulkan/icd.d/intel_icd.x86_64.json /usr/share/vulkan/icd.d/intel_icd.x86_64.json.disabled
  • SteamVR use extended mode instead of direct mode

    1. Disconnect the HMD reboot the system, launch Steam, connect the HMD, launch SteamVR again.
    2. Check SteamVR is in the right version. To switch to 1.22.6 beta version: open Steam, go into library, right click on SteamVR icon, select properties, then in the BETA panel(select on the left side), search for beta
    3. Check the ubuntu 20 kernel version running "uname -r" inside a terminal. If the kernel version is not 5.11.0-27-generic try to reboot the system and select the right kernel when booting the os.
  • After selecting Ubuntu 20 in the grub the computer get stuck with black screen and blinking cursor on top-left side of the screen

    1. Press ctrl+alt+F3 to open a terminal, insert your credentials if needed, use the command "sudo service gdm3 restart"

About

ROS package for publishing HTV VIVE device locations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.9%
  • CMake 1.1%