Skip to content

antodld/mc_OpenVR_plugin

Repository files navigation

mc_OpenVR_plugin

This plugins provide an access to the OpenVR devices for [mc_rtc]

Dependencies

mc_rtc (for control computer)

OpenVR

UDPDataLink (On operator computer for remote devices access)

Installation

In repo directory :

mkdir build && cd build
cmake ..
make
sudo make install

Use

To enable the plugin add to your [mc_rtc] configuration file :

Plugins: [OpenVRPlugin]

Each devices are identified with their ID, they can be labeled with a name :

deviceMap: #[name ; ID]
- ["RightFoot","LHR-D756B287"]

You can access the pose or the velocity of a device in the controller by using the following function in the datastore

  auto & poseByNameFunc = ctl.datastore().get<std::function<sva::PTransformd(std::string)>>("OpenVRPlugin::getPoseByName");
  sva::PTransformd X_0_device = poseByNameFunc(deviceName);

  auto & velByNameFunc = ctl.datastore().get<std::function<sva::MotionVecd(std::string)>>("OpenVRPlugin::getVelocityByName");
  sva::MotionVecd V_device = velByNameFunc(deviceName);

  auto & getDevicesId = ctl.datastore().get<std::function<std::vector<std::string>()>>("OpenVRPlugin::getDevicesId");
  std::vector<std::string> deviceIDList = getDevicesId();

The following function are also available:

-"OpenVRPlugin::getPoseById" 

-"OpenVRPlugin::getVelocityById" 

By default, it is assumed SteamVR is running on the same computer as the one running the controller.

Distant device connection

If the devices are connected to another computer the data will be streamed using UDP. Using the following executable :

cd build
./PluginLink

On the control computer, change the configuration file

localData: false
distantData:
  port: 12338
  ip: 127.0.0.1

If the config file is modified, the project must be built again

SteamVR running on Ubuntu

This was tested on Ubuntu 20.04 with steamVR 2.2.3 Make sure the vive tracker dongle are connected before. Run the following script :

~/.steam/debian-installation/steamapps/common/SteamVR/bin/vrmonitor.sh

If your steamVR is installed somewhere else, you can locate it using the game properties on steam directly

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published