Skip to content

hucebot/vive_controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

3d_teleoperation_interface

License Ros Version Ros Version

Control Cartesio - RVIZ Control Real Robot Workspace
Control Cartesio Control Real Robot Control Real Robot

Table of Contents

Get Started

Prerequisites

The following dependencies are required to use this package:

  • Docker
  • NVIDIA Container Toolkit (if you are using an NVIDIA GPU)
  • SteamVR (optional, you can use the joystick + cable)
  • OpenVR
  • Hardware:
    • Vive Tracker (optional)
    • Vive Joystick (optional)
    • Vive Base Station (mandatory, at least one)

Installation

From Docker

The easiest way to get started is to use the provided Docker image. You can find the Dockerfile in the docker folder. To build the image, run the following command:

sh build_ros1.sh
sh build_ros2.sh

To run the development container, use the following command:

sh run_ros1_dev_docker.sh
sh run_ros2_dev_docker.sh

Usage

Reference Frames

Vive Controller Frames

TODO

Steam VR Instructions

Install Steam

The easiest way to install Steam is to install through a command line. To do this, run the following command:

sudo apt install steam

Once Steam is installed, open it and log in with your account. If you don't have an account, you can create one for free. Then, go to the Steam Store and search for SteamVR. Install it. Then you need to RUN the BETA Version.

Using without headset

Basically you need to edit the following files:

  • default.vrsettings located in Steam Directory/steamapps/common/SteamVR/drivers/null/resources/settings/default.vrsettings
    • On the null driver secction replace: "enable": false to "enable": true
  • default.vrsettings located in Steam Directory/steamapps/common/SteamVR/resources/settings/default.vrsettings
    • On the steamvr section replace: "requireHmd": true to "requireHmd": false
    • On the steamvr section replace: "forcedDriver": "" to "forcedDriver": "null"
    • On the steamvr section replace: "activateMultipleDrivers": true to "activateMultipleDrivers": false

On the steamvr_config folder there are 3 examples of this files.

Connect Devices

Once SteamVR is installed, open it and go to the settings. In the settings, go the paired devices and pair your Vive Tracker and Vive Joystick. Once the devices are paired, you will see a small window with the devices and their status. Make sure that all devices are connected. Finally, you can close SteamVR.

ROS

ROS1

Calibrate Workspace

It is important to calibrate the workspace before using the joystick. By calibrating the workspace, you define the limites of the tracking area. To calibrate the workspace, run the following command:

rosrun ros1_vive_controller calibrate_workspace.py

The idea is to move the joystick in every direction, with this you will create a PointCloud that represents the workspace. The recomendations it's to use RVIZ to visualize this point cloud over the topic /workspace_pointcloud, in this way it will be more easly to see the limits of the workspace.

Visualize and generate the workspace

Once the workspace is calibrated, you can visualize the representation of it, the convexhull and the bounding box representing the workspace ( After removing the outliers). If you feel that you should remove more outliers you can change the parameter z_threshold on the config file.

To visualize and generate the workspace, run the following command:

cd /ros_ws/src/ros1_vive_controller/tools && python visualize_workspace.py

Run Joystick Node

Finally, you can run the joystick node. With the workspace calibrated, you will fell a vibration if you are near the limits of the workspace (By default is setup to 20 cm, but can be modified on the config file). To run the joystick node, run the following command:

rosrun ros1_vive_controller joystick_node.py

ROS2

Tracker Node

The tracker node is responsible for publishing the position and orientation of the vive tracker. To run the tracker node, run the following command:

ros2 run ros2_vive_controller vive_tracker

About

ROS1 and ROS2 Package to use HTC Vive Controller and Tracker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published