-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Purge
- Loading branch information
Showing
18 changed files
with
182 additions
and
112 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from .PointField import * | ||
from .PointCloud import * | ||
from .Visualizer import * | ||
|
||
from .io import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
add_cython_target(_io CXX) | ||
add_library(_io MODULE ${_io}) | ||
target_link_libraries(_io ${PCL_LIBRARIES}) | ||
python_extension_module(_io) | ||
install(TARGETS _io LIBRARY DESTINATION pcl/io) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from ._io import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from cython.operator cimport dereference as deref | ||
from libcpp cimport bool | ||
|
||
from pcl.PointCloud cimport PointCloud | ||
from pcl.io.pcd_io cimport loadPCDFile, savePCDFile | ||
from pcl.io.ply_io cimport loadPLYFile, savePLYFile | ||
|
||
cdef str _nonzero_error_msg = "Function {0} returned {1}, please check stderr output!" | ||
|
||
# TODO: Inference point type from fields | ||
cpdef PointCloud load_pcd(str path): | ||
cdef PointCloud cloud = PointCloud() | ||
cdef int retval = loadPCDFile(path.encode('ascii'), deref(cloud._ptr), cloud._origin, cloud._orientation) | ||
if retval != 0: raise RuntimeError(_nonzero_error_msg.format("loadPCDFile", retval)) | ||
return cloud | ||
|
||
cpdef void save_pcd(str path, PointCloud cloud, bool binary=False): | ||
cdef int retval = savePCDFile(path.encode('ascii'), deref(cloud._ptr), cloud._origin, cloud._orientation, binary) | ||
if retval != 0: raise RuntimeError(_nonzero_error_msg.format("savePCDFile", retval)) | ||
|
||
# TODO: Inference point type from fields | ||
def load_ply(str path, type return_type=PointCloud): | ||
cdef: | ||
PointCloud cloud | ||
int retval | ||
|
||
if return_type == PointCloud: | ||
cloud = PointCloud() | ||
retval = loadPLYFile(path.encode('ascii'), deref(cloud._ptr), cloud._origin, cloud._orientation) | ||
if retval != 0: raise RuntimeError(_nonzero_error_msg.format("loadPLYFile", retval)) | ||
return cloud | ||
else: | ||
raise TypeError("Unsupported return type!") | ||
|
||
cpdef void save_ply(str path, PointCloud cloud, bool binary=False, bool use_camera=True): | ||
cdef int retval = savePLYFile(path.encode('ascii'), deref(cloud._ptr), cloud._origin, cloud._orientation, binary, use_camera) | ||
if retval != 0: raise RuntimeError(_nonzero_error_msg.format("savePLYFile", retval)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.