Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Commit

Permalink
- CoppeliaSim namechange fix
Browse files Browse the repository at this point in the history
- Temporary files are saved in %TEMP% directory
  • Loading branch information
Boris committed Dec 17, 2019
1 parent 329568b commit 80b5921
Show file tree
Hide file tree
Showing 22 changed files with 444 additions and 477 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# V-REP-VR-Toolbox
This repository contains virtual reality tools for VREP. V-REP is a robotics simulation software package that is available here: http://www.coppeliarobotics.com/
# CoppeliaSim-VR-Toolbox
This repository contains virtual reality tools for VREP. CoppeliaSim is a robotics simulation software package that is available here: http://www.coppeliarobotics.com/

Currently two tools are available
- V-REP-VR-Interface
- CoppeliaSim-VR-Interface
- VR 360 cam (omnidirectional stereo renderer)

# V-REP-VR-Interface
This repository contains the code to experience V-REP in VR. It can visualize V-REP scenes in openvr compatible devices (HTC-VIVE and HTC-VIVE Pro are tested) and return user manipulations to V-REP. It is also able to visualize the coverage of camera systems (later more).
# CoppeliaSim-VR-Interface
This repository contains the code to experience CoppeliaSim in VR. It can visualize CoppeliaSim scenes in openvr compatible devices (HTC-VIVE and HTC-VIVE Pro are tested) and return user manipulations to CoppeliaSim. It is also able to visualize the coverage of camera systems (later more).

Installation instructions and a feature overview is now also available in a youtube video:
https://www.youtube.com/watch?v=_GXVdgihVgQ
Expand All @@ -21,27 +21,27 @@ Some Youtube videos showing the interface in action:
- https://www.youtube.com/watch?v=QYX7WIiahbw (courtesy of Mathieu Lauret and Amir Beddiaf)

The interface has the following capabilities:
- Read all renderable geometry from V-REP (colors, opacities and (moving) textures are also transfered)
- Read all renderable geometry from CoppeliaSim (colors, opacities and (moving) textures are also transfered)
- Read dynamically generated geometry
- Synchronize all poses in real time
- Send the positions of controllers and headset to V-REP
- Send all controller buttonpress/buttontouch events to V-REP as string signals
- Send trackpad position to V-REP
- Send the positions of controllers and headset to CoppeliaSim
- Send all controller buttonpress/buttontouch events to CoppeliaSim as string signals
- Send trackpad position to CoppeliaSim
- Import standard interactions as dummies, that can be attatched to controllers
- Add a customizable menu in VR that when menu items are selected, triggers the execution of V-REP scripts.
- Add a customizable menu in VR that when menu items are selected, triggers the execution of CoppeliaSim scripts.
- Visibility layers are respected, which allows for the possibility of hiding objects.

# VR 360 cam
This tool renders omnidirectional stereo images for a V-REP vision sensor. You don't need any physical VR device to use this tool (only to view the result). The theory behind this rendering process is exelently explained here : https://developers.google.com/vr/jump/rendering-ods-content.pdf.
This tool renders omnidirectional stereo images for a CoppeliaSim vision sensor. You don't need any physical VR device to use this tool (only to view the result). The theory behind this rendering process is exelently explained here : https://developers.google.com/vr/jump/rendering-ods-content.pdf.

Some videos produced with this tool:
- https://youtu.be/7O629j58bTI
- https://youtu.be/pFAptrCYhaQ

To use this tool, import the VR360_cam.ttm model in your V-REP scene. Next launch VR360_cam.exe (maybe as administrator, a file is saved in the location of the .exe file, this action could require administrator privileges).
To use this tool, import the VR360_cam.ttm model in your CoppeliaSim scene. Next launch VR360_cam.exe (maybe as administrator, a file is saved in the location of the .exe file, this action could require administrator privileges).
This process is demonstrated at the end of this video https://youtu.be/ozam2Ew7RdA.

Note that the HTC_VIVE.ttm model must be in the V-REP scene to do this (you don't need a VIVE for this to work).
Note that the HTC_VIVE.ttm model must be in the CoppeliaSim scene to do this (you don't need a VIVE for this to work).

Currently the performance is quite decent 1 image in a complex scene renders in approximately 15 seconds (requires 16.384 individual renders, approx 1100 fps).

Expand All @@ -52,17 +52,17 @@ Installation instructions are now also available on youtube: https://www.youtube

This repository can be installed by an installer package available under the release tab in this repository.

After running the installer the user needs to run the bat file (copyToVREP.bat) as administrator. This bat file can be found in the installation directory of the interface typically (C:\Program Files (x86)\V-REP VR interface).
IMPORTANT if V-REP is not installed in the default (my default at least) location (C:\Program Files\V-REP3\V-REP_PRO_EDU), than the correct folder should be identified in the bat file. The bat file can be changed by opening it in your favorite text editor (be very precise in the way you specify the folder, no spaces etc).
After running the installer the user needs to run the bat file (copyToVREP.bat) as administrator. This bat file can be found in the installation directory of the interface typically (C:\Program Files (x86)\CoppeliaSim VR interface).
IMPORTANT if CoppeliaSim is not installed in the default (my default at least) location (C:\Program Files\CoppeliaSim3\CoppeliaSim_PRO_EDU), than the correct folder should be identified in the bat file. The bat file can be changed by opening it in your favorite text editor (be very precise in the way you specify the folder, no spaces etc).

The bat file will copy following files to your V-REP installation folder:
- Lua scripts that will be accesed by V-REP objects belonging to the interface (required)
The bat file will copy following files to your CoppeliaSim installation folder:
- Lua scripts that will be accesed by CoppeliaSim objects belonging to the interface (required)
- A custom remoteApiConnections.txt file which opens more ports (required, if coverage visualization is used at least)
- Models used by the VR-interface (usefull)
- Example scenes (usefull)

# Usage
The basic principle of the interface is simple. Activate steam and make shure the device is running and recognized. And run the V-REP VR Interface.exe program. If the user starts a simulation in V-REP (if the scene contains the HTC-VIVE.ttm object) the interface will read all geometry and start the visualization. If the user stops the simulation, the interface will stop the visualization and wait for the next simulation start (can ba a different scene, doesn't matter).
The basic principle of the interface is simple. Activate steam and make shure the device is running and recognized. And run the CoppeliaSim VR Interface.exe program. If the user starts a simulation in CoppeliaSim (if the scene contains the HTC-VIVE.ttm object) the interface will read all geometry and start the visualization. If the user stops the simulation, the interface will stop the visualization and wait for the next simulation start (can ba a different scene, doesn't matter).

More specific instructions are provided in demo scenes. The logical order of which are
- Hello_vr_world.ttt
Expand Down
7 changes: 3 additions & 4 deletions V-REP VR Interface/V-REP VR Interface.vcxproj

Large diffs are not rendered by default.

Binary file modified V-REP data/Models/HTC_VIVE.ttm
Binary file not shown.
Binary file modified V-REP data/Scenes/Hello_camera_coverage.ttt
Binary file not shown.
Binary file modified V-REP data/Scenes/Hello_controls.ttt
Binary file not shown.
Binary file modified V-REP data/Scenes/Hello_signals.ttt
Binary file not shown.
Binary file modified V-REP data/Scenes/Hello_vr_world.ttt
Binary file not shown.
Binary file modified V-REP data/Scenes/VR_sensorPlacement_harbour.ttt
Binary file not shown.
2 changes: 1 addition & 1 deletion V-REP data/Scripts/Camera_feeder.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Copyright (c) 2018, Boris Bogaerts
-- Copyright (c) 2020, Boris Bogaerts
-- All rights reserved.

-- Redistribution and use in source and binary forms, with or without
Expand Down
8 changes: 5 additions & 3 deletions V-REP data/Scripts/HTC_VIVE.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Copyright (c) 2018, Boris Bogaerts
-- Copyright (c) 2020, Boris Bogaerts
-- All rights reserved.

-- Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -135,8 +135,10 @@ end

getTextureInformation = function(inInts,inFloats,inStrings,inBuffer)
a=sim.getShapeViz(inInts[1],0)
sim.saveImage(a.texture.texture,a.texture.resolution,1,"textureTransfer.png",100)
return {}, a.texture.coordinates, {sim.getStringParameter(sim.stringparam_application_path) .."/textureTransfer.png"}, ''
tempName = os.getenv("TEMP")
os.execute("mkdir " .. tempName.."\\CoppeliaSimVR")
sim.saveImage(a.texture.texture,a.texture.resolution,1,tempName.."\\CoppeliaSimVR\\textureTransfer.png",100)
return {}, a.texture.coordinates, {tempName.."\\CoppeliaSimVR\\textureTransfer.png"}, ''
end

helloCams = function(inInts, inFloats, inStrings,inBuffer)
Expand Down
2 changes: 1 addition & 1 deletion V-REP data/Scripts/voxelField.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Copyright (c) 2018, Boris Bogaerts
-- Copyright (c) 2020, Boris Bogaerts
-- All rights reserved.

-- Redistribution and use in source and binary forms, with or without
Expand Down
Loading

0 comments on commit 80b5921

Please sign in to comment.