Commit dd9b42ec authored by Jerome Dias's avatar Jerome Dias
Browse files

[defaults] Upgrade python to 3.7.

Use print function with python 2 and 3 compatibility.
(See https://python-future.org/compatible_idioms.html)
parent 05d4f90a
......@@ -20,7 +20,7 @@ RUN apt-get update && \
flex \
byacc \
python-minimal \
python2.7-dev \
python3.7-dev \
libxext-dev \
libxt-dev \
libbz2-dev \
......
......@@ -30,7 +30,7 @@ function(python_module_install)
@ONLY IMMEDIATE)
add_custom_command(
COMMAND ${Python2_EXECUTABLE}
COMMAND ${Python3_EXECUTABLE}
ARGS "${compile_all_script}"
DEPENDS ${copied_python_files} ${compile_all_script}
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/compile_complete"
......
......@@ -37,7 +37,7 @@ The required Qt version is 5.10.
Qt is a desktop widget library that is used to provide user interface elements like windows and menus across the supported platforms Windows, Mac, and Linux.
### Python <a name="python"></a>
The required Python version is 2.7.
The required Python version is 3.7.
LidarView uses libpython to embed a Python interpreter in the LidarView application.
The core LidarView features are implemented in C++ libraries, and the libraries are wrapped for Python using VTK's Python wrapping tools.
......@@ -153,7 +153,7 @@ The following packages are needed to build on Ubuntu 16.04:
- flex
- byacc
- python-minimal
- python2.7-dev
- python3.7-dev
- libxext-dev
- libxt-dev
- libbz2-dev
......@@ -161,6 +161,8 @@ The following packages are needed to build on Ubuntu 16.04:
- freeglut3-dev
- pkg-config
Note that **CMake version 3.12 or higher** is needed, it is available at <https://cmake.org/>.
#### If using qt5 system:
- qtbase5-dev
- qtmultimedia5-dev
......
from __future__ import print_function
import numpy as np
import vtk
import ctypes as C
......
......@@ -19,7 +19,7 @@
# closest to the current camera center location. If the p-percentil points
# cardinal is less than 3, compute the mean instead
#==============================================================================
from __future__ import print_function
import numpy as np
# -----------------------------------------------------------------------------
......
......@@ -5,6 +5,7 @@ It doesn't use Paraview animation mechanism, and isn't based on data timestamps.
This script moves the camera along an absolute orbit path, and saves snapshots
along trajectory.
"""
from __future__ import print_function
import os
import paraview.simple as smp
import camera_path as cp
......@@ -44,4 +45,4 @@ for i in range(nb_frames):
# Save render view snapshot
image_name = os.path.join(frames_out_dir, "%06d.png" % (i))
smp.SaveScreenshot(image_name)
print i
print(i)
from __future__ import print_function
from scipy.spatial.transform import Rotation
import numpy as np
......@@ -70,7 +71,7 @@ class CameraPath:
else:
return 1.0 / (1.0 + (w / (1.0 - w)) ** (-beta))
else:
print "Invalid transition mode: ", self.transition_mode
print("Invalid transition mode: ", self.transition_mode)
return 0.0
def interpolate_position(self, step, R_lidar, T_lidar, prev_cam_pos):
......
......@@ -53,7 +53,7 @@ This point cloud is colored by label:
- green:other
"""
from __future__ import print_function
import paraview.simple as smp
import os
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment