Skip to content

Commit

Permalink
Update viewer to 0.2.5 (#49)
Browse files Browse the repository at this point in the history
* Check if navigator.xr exists in viewer app.js

* Add missing dependencies for viewer in setup.py

* Bump version to 0.2.5
  • Loading branch information
johnwason authored Jul 29, 2023
1 parent 8f9fb4b commit df6b19d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tesseract_viewer_python/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="3">
<name>tesseract_viewer_python</name>
<version>0.2.4</version>
<version>0.2.5</version>
<description>The tesseract_viewer_python package</description>
<maintainer email="[email protected]">John Wason</maintainer>
<license>Apache 2.0</license>
Expand Down
2 changes: 1 addition & 1 deletion tesseract_viewer_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
packages=['tesseract_robotics_viewer','tesseract_robotics_viewer.resources'],
package_data={'tesseract_robotics_viewer.resources':['static/index.html','static/app.js','geometries.json']},
license='Apache-2.0',
install_requires=['numpy','tesseract_robotics>=0.2.0','opencv-contrib-python'],
install_requires=['numpy','tesseract_robotics>=0.2.0','opencv-contrib-python','aiohttp','importlib-resources'],
long_description='Tesseract Robotics viewer package for Python'
)
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ class TesseractViewer {
document.body.appendChild( renderer.domElement );

const controls = new OrbitControls( camera, renderer.domElement );

// Only add VR button if it is supported
if (await navigator.xr.isSessionSupported( 'immersive-vr' ))
if ( 'xr' in navigator )
{
document.body.appendChild( VRButton.createButton( renderer ) );
if (await navigator.xr.isSessionSupported( 'immersive-vr' ))
{
document.body.appendChild( VRButton.createButton( renderer ) );
}
}

renderer.setAnimationLoop( this.render.bind(this) );
Expand Down

0 comments on commit df6b19d

Please sign in to comment.