Skip to content

Commit

Permalink
some fixes for python 3 compatibility
Browse files Browse the repository at this point in the history
closes #3 and #4
  • Loading branch information
Geoffrey Pascoe committed Apr 7, 2017
1 parent 739febd commit f66f13b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/build_pointcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def build_pointcloud(lidar_dir, poses_file, extrinsics_dir, start_time, end_time
scan = np.fromfile(scan_file, np.double)
scan_file.close()

scan = scan.reshape((len(scan) / 3, 3)).transpose()
scan = scan.reshape((len(scan) // 3, 3)).transpose()

if lidar != 'ldmrs':
# LMS scans are tuples of (x, y, reflectance)
Expand Down
2 changes: 1 addition & 1 deletion python/project_laser_into_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

plt.imshow(image)
plt.hold(True)
plt.scatter(uv[0, :], uv[1, :], s=2, c=depth, edgecolors='none', cmap='jet')
plt.scatter(np.ravel(uv[0, :]), np.ravel(uv[1, :]), s=2, c=depth, edgecolors='none', cmap='jet')
plt.xlim(0, image.shape[1])
plt.ylim(image.shape[0], 0)
plt.xticks([])
Expand Down
2 changes: 1 addition & 1 deletion python/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def so3_to_quaternion(so3):
y = sqrt(1 + R_yy - R_xx - R_zz) / 2
z = sqrt(1 + R_zz - R_yy - R_xx) / 2

max_index = max(xrange(4), key=[w, x, y, z].__getitem__)
max_index = max(range(4), key=[w, x, y, z].__getitem__)

if max_index == 0:
x = (R_zy - R_yz) / (4 * w)
Expand Down

0 comments on commit f66f13b

Please sign in to comment.