Skip to content

Commit 4dc6874

Browse files
Upgrade demo to python 3, also closes peteanderson80#42
1 parent cb196b6 commit 4dc6874

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ target_link_libraries(mattersim_main MatterSim)
5656

5757
add_subdirectory(pybind11)
5858

59-
find_package(PythonInterp 2.7)
59+
find_package(PythonInterp 3)
6060
message(${PYTHON_EXECUTABLE})
6161

6262
# Need to search for python executable again to pick up an activated

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,13 @@ nvidia-docker run -it -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix --mount type=b
155155
cd /root/mount/Matterport3DSimulator
156156
```
157157

158+
If you get an error like `Error: BadShmSeg (invalid shared segment parameter) 128` you may also need to include `-e="QT_X11_NO_MITSHM=1"` in the docker run command above.
159+
158160
Build the simulator using any rendering option. Commands for running both python and C++ demos are provided below. These are very simple demos designed to illustrate the use of the simulator in python and C++. By default, these demos have depth rendering on. Check the code and turn it off if you haven't preprocessed the depth outputs (see Depth Outputs above).
159161

160162
Python demo:
161163
```
162-
python src/driver/driver.py
164+
python3 src/driver/driver.py
163165
```
164166
C++ demo:
165167
```

src/driver/driver.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import sys
2-
sys.path.append('build')
1+
32
import MatterSim
43
import time
54
import math
@@ -18,7 +17,7 @@
1817
sim = MatterSim.Simulator()
1918
sim.setCameraResolution(WIDTH, HEIGHT)
2019
sim.setCameraVFOV(VFOV)
21-
sim.setDepthEnabled(True)
20+
sim.setDepthEnabled(False) # Turn on depth only after running ./scripts/depth_to_skybox.py (see README.md)
2221
sim.initialize()
2322
#sim.newEpisode(['2t7WUuJeko7'], ['1e6b606b44df4a6086c0f97e826d4d15'], [0], [0])
2423
#sim.newEpisode(['1LXtFkjw3qL'], ['0b22fa63d0f54a529c525afbf2e8bb25'], [0], [0])
@@ -29,9 +28,10 @@
2928
location = 0
3029
ANGLEDELTA = 5 * math.pi / 180
3130

32-
print '\nPython Demo'
33-
print 'Use arrow keys to move the camera.'
34-
print 'Use number keys (not numpad) to move to nearby viewpoints indicated in the RGB view.\n'
31+
print('\nPython Demo')
32+
print('Use arrow keys to move the camera.')
33+
print('Use number keys (not numpad) to move to nearby viewpoints indicated in the RGB view.')
34+
print('Depth outputs are turned off by default - check driver.py:L20 to enable.\n')
3535

3636
while True:
3737
sim.makeAction([location], [heading], [elevation])

0 commit comments

Comments
 (0)