Coder Social home page Coder Social logo

cpu_tsdf's People

Contributors

api55 avatar hfinger avatar sdmiller avatar thesvend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpu_tsdf's Issues

Sorting problem

When i provide the clouds with their poses , lets say clouds1-100
the algorithm runs first for cloud 10 then cloud 1 2-3...9 etc , i think it might be a problem with
the sorting function

Example data for tests

Hi,

first of all, thanks for your work!

It would be possible for you to share a sample folder with some data for testing, eg. pcd files with the .txt poses?

Thanks

complied error with pcl1.10

When I make the project with pcl 1.10, the build error as follows:

/usr/local/include/pcl-1.10/pcl/common/io.h:65:77: required from here
/usr/include/c++/7/bits/predefined_ops.h:283:11: error: no match for call to ‘(pcl::getFieldIndex(const pcl::PCLPointCloud2&, const string&)::<lambda(int)>) (const pcl::PCLPointField&)’
{ return bool(_M_pred(*__it)); }
^~~~~~~~~~~~~~~~~~~~
Compiled environment:
ubuntu18.04
pcl1.10

Add example data set

I've been away from Stanford for a couple years, and as such haven't used this code much. So I'm afraid my current OSX machine doesn't have any example datasets of point clouds + poses to help people get started.

If any of you happen to have something laying around -- maybe a ~10 frame example -- I'd love to host it and provide a tutorial to accompany this. Let me know!

Coordinate frame of point cloud expected

I am noticing if I use 1 cloud (with min weight set to 1), it seems like the cloud is cropped and I dont always get the full data. If I set the min sensor bounds to -5.0, then I can get a little bit of extra data but it is noisy. What is the format of the point cloud expected?

I am using RealSense R200 sensors which have (from the cameras perspective) Z pointing out towards the scene, X pointing right and Y pointing down.

Wall in TSDF

Hi there,

I'm trying to use a tsdf in my reconstruction project. However, when reconstructing the surface (with marching cubes) that is represented by the tsdf volume I get vertices also for the wall, which originally has NANs for the x,y,z coordinates. I still don't get why the wall appears even after some hours of experimenting. The wall does not appear at the boundary of the tsdf volume by the way (and such a case is handled nicely in the code of cpu_tsdf::MarchingCubesTSDFOctree::reconstructVoxel).
The parameters for gridSize, resolution of tsdf, the sensor distance bounds, and depth truncation don't seem to affect this effect.

Is there any idea why this might happen?

Image

pcd file format

Hi, thank you so much for providing this fusion version.

I met with problem in testing data from my Kinect v1 and orbslam2. I collected key frames' pose as well as pcd. But the mesh.ply seems not work very well for me.

Take an example, the following is the completed point cloud, and the mesh should be almost same as this one.

screenshot from 2018-08-02 20-55-55

However, my mesh.ply look like this. Only a few points.
screenshot from 2018-08-02 20-58-25

I fail to find out where the problem is. But I found that my pcd files are different from the sample database.
Left is sample database's pcd file( opened in sublime). Right is mine. Is this a problem?
screenshot from 2018-08-02 20-59-57

Sorry to bother but I am really desperate in dealing with it.

Question about tsdf

Hi,

Is what I can calculate tsdf for a cloud of points not for depth images ?
You can help me with an idea

Thank you for your help.

Linker Error with boost::program_options (Boost 1.57.0 & PCL 1.9.0)

Hello when I am compiling the program,
everything works fine except for the "integrate.cpp target". When compiling I get Linker errors saying that I am having unresolved symbols to boost::program_options. Might this be an issue with my boost Version or do you have any other suggestions what I can do? I have linked the correct file with ...\boost_1_57_0\stage\lib\libboost_program_options-vc120-mt-gd-1_57.lib

I have to mention that I am using windows and change the CMake a little so linking works and all the other dependencies linked correctly.

Thanks in advance!

The Error messages are:
error LNK2001: Unresolved external Symbol ""public: static unsigned int const boost::program_options::options_description::m_default_line_length" (?m_default_line_length@options_description@program_options@boost@@2IB)". C:\Users\...\Desktop\cpu_tsdf\build\integrate.obj

error LNK2001: Unresolved external Symbol ""class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > boost::program_options::arg" (?arg@program_options@boost@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)". C:\Users\...\Desktop\cpu_tsdf\build\integrate.obj

How to run my local data?

Hi, Stephen
Thanks for your meaningful work of this project.
I have build this project on Wins10 with VS2019 successfully, run the Augmented ICL-NUIM dataset , and get right output.
But when i use my own local data(obtained from my own scanner with images (320*256) and poses correspondingly, transform the image into point clouds with the my intrinsics_files ), and i try to modify the base parameter of the camera intrinsics , image size and tsdf_size, cell_size in integrate.cpp like below:
1665309878673

1665310153096

and i try to modify the tsdf_size, cell_size many times, but it cames out like below:
1665310555091

Why there is no *.ply mesh files in the --out path?

Looking forward for your reply. Thanks.

How to run with a list of point cloud.

I follow the readme file to construct tsdf from a list of point cloud, but the result is null.

#include <cpu_tsdf/tsdf_interface.h>
#include <cpu_tsdf/tsdf_volume_octree.h>
#include <cpu_tsdf/marching_cubes_tsdf_octree.h>

#include <pcl/console/print.h>
#include <pcl/io/ply_io.h>
#include <pcl/io/pcd_io.h>

#include <string>
#include <vector>

using namespace std;
using namespace cpu_tsdf;
using namespace pcl;

int main (int argc, char** argv)
{
    if (argc < 3)
    {
        PCL_INFO ("This is a utility program meant to render a mesh from a TSDF Volume, which can be saved to disk via TSDFVolumeOctree::save(const std::string &filename).\n");
        PCL_INFO ("Usage: %s  foo.ply pcd_file.txt", argv[0]);
        return (1);
    }
    string mesh_file = argv[1];

    TSDFVolumeOctree::Ptr tsdf (new TSDFVolumeOctree);
    tsdf->setGridSize (0.5, 0.5, 0.5); 
    tsdf->setResolution (128, 128, 128); 

    tsdf->setIntegrateColor (true); 
    Eigen::Affine3d tsdf_center;
    tsdf->setGlobalTransform (tsdf_center);
    tsdf->reset ();

    ifstream pcdFile(argv[2], ifstream::in);
    string pcdFileName;
    while(pcdFile >> pcdFileName)
    {
        PointCloud<pcl::PointXYZRGB>::Ptr cloud(new PointCloud<PointXYZRGB>);
        if (io::loadPCDFile <PointXYZRGB>(pcdFileName, *cloud) != -1)
        {
            tsdf->integrateCloud (*cloud, PointCloud<Normal> (), Eigen::Affine3d::Identity ()); // Integrate the cloud
        }
    // Note, the normals aren't being used in the default settings. Feel free to pass in an empty cloud
    }
    // Now what do you want to do with it?
    float distance;
    PointXYZ query_point (0, 0, 0);
    tsdf->getFxn (query_point, distance); 
    tsdf->save ("output1.vol");

    // Mesh with marching cubes
    MarchingCubesTSDFOctree mc;
    mc.setInputTSDF (tsdf);
    mc.setMinWeight (2);
    mc.setColorByRGB (true); 
    PolygonMesh mesh;
    mc.reconstruct (mesh);
    cout << mesh.cloud.data.size() << endl;
    io::savePLYFileBinary (mesh_file, mesh);

}

I had convert the pcd file to the same view that the pose is Eigen::Affine3d::Identity () , and the cloud is small for reconstructing object that I set setGridSize (0.5, 0.5, 0.5). But the after reconstruct the result of mesh is null, I don't know how to revise.
Thank you!
@sdmiller

Can't generate tsdf2mesh executable when I switch pcl version to pcl 1.10

When I compile CMakeLists which depend on pcl1.10,the output error as follow:

Could NOT find PCL_COMMON (missing: PCL_COMMON_LIBRARY)
-- Could NOT find PCL_KDTREE (missing: PCL_KDTREE_LIBRARY)
-- Could NOT find PCL_OCTREE (missing: PCL_OCTREE_LIBRARY)
-- Could NOT find PCL_SEARCH (missing: PCL_SEARCH_LIBRARY)
-- Could NOT find PCL_SAMPLE_CONSENSUS (missing: PCL_SAMPLE_CONSENSUS_LIBRARY)
-- Could NOT find PCL_FILTERS (missing: PCL_FILTERS_LIBRARY)
-- Found PCL_2D: /usr/local/include/pcl-1.10
-- Found PCL_GEOMETRY: /usr/local/include/pcl-1.10
-- Could NOT find PCL_IO (missing: PCL_IO_LIBRARY)
-- Could NOT find PCL_FEATURES (missing: PCL_FEATURES_LIBRARY)
-- Could NOT find PCL_ML (missing: PCL_ML_LIBRARY)
-- Could NOT find PCL_SEGMENTATION (missing: PCL_SEGMENTATION_LIBRARY)
-- Could NOT find PCL_VISUALIZATION (missing: PCL_VISUALIZATION_LIBRARY)
-- Could NOT find PCL_SURFACE (missing: PCL_SURFACE_LIBRARY)
-- Could NOT find PCL_REGISTRATION (missing: PCL_REGISTRATION_LIBRARY)
-- Could NOT find PCL_KEYPOINTS (missing: PCL_KEYPOINTS_LIBRARY)
-- Could NOT find PCL_TRACKING (missing: PCL_TRACKING_LIBRARY)
-- Could NOT find PCL_RECOGNITION (missing: PCL_RECOGNITION_LIBRARY)
-- Could NOT find PCL_STEREO (missing: PCL_STEREO_LIBRARY)
-- Could NOT find PCL_OUTOFCORE (missing: PCL_OUTOFCORE_LIBRARY)
-- Could NOT find PCL_PEOPLE (missing: PCL_PEOPLE_LIBRARY)

After build process, the project can generate shared library , however, can't generate the tsdf2mesh executable file.
By the way, If I compile with pcl 1.8, pcl/surface/include/pcl/surface/marching_cubes.h can't definite protected data: size_voxel_ upper_boundary_ lower_boundary_
It will occur the bug : cant find the deifnition of the above protected data.
So, the project depend on which version of pcl?

cpu_tsdf cannot compile with pcl 1.8.1

Hi

In the beginning, I compiled cpu_tsdf with pcl 1.8.1. Then I ran the demo application "integrate", and I got a segmentation fault. Then I recompiled cpu_tsdf with pcl 1.7.2, everything is fine. I do not know how to change the code to make it compatible with pcl 1.8.1. Could you help me?

Thank you very much!

Import TSDF from other algorithms

Hi,

I am trying to use the Kinfu remake algorithm (https://github.com/Nerei/kinfu_remake) to create a TSDF volume and then save it in a file. Later on, I would like to use your library to load this TSDF and either integrate some other point clouds or just creating a mesh file with your marching cubes code.

To import the TSDF, I was thinking of creating a tsdf structure and load the data of each voxel to be the same as the one in the imported data, but I was wondering if you can give me a suggestion of how to do this, since I don't see any function to set a voxel. I was thinking probably something like the updateVoxel function.

Thanks in advance for your help,
Pablo

Empty PointCloud for Reconstruction

I am not quite sure if reconstruction is actually taking place, because when u try to save the pcd file it tells [pcl::io::savePLYFile] Input point cloud has no data!.

I am using PCL 1.7 version. Any issues with pcl library 1.7 ??

Output mesh seems wrong

image
I run in Window platform, but output mesh seems wrong, vertex always (-6.0029 -6.0029 -6.0029).

Decimation effects when gridsize is not an integer

Hi,

I seem to be getting incorrect looking meshes (large lines throughout the entire mesh, as if some voxel indexing is off by one for certain rows/columns in the grid) when I pick a gridsize that's not an integer, even though I think it should accept float values. My resolution is 1024.

In your example you use 10.0 as grid size. Could you try changing it to e.g. 10.1, 10.5 and see if you get similar artifacts in your reconstructions? If so, it might be a problem with the voxel indexing or some implicit float/integer conversion within the code?

I came across this because I auto-generates the grid-sizes for my particular problem size. For now I will just ceil(...) them...

Thanks!

build with pcl 1.8.1 failure

when I try build the code, the follow error occur:

mkdir build && cd build && cmake .. && make -j8
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Checking for module 'eigen3'
-- Found eigen3, version 3.3.4
-- Found eigen: /usr/include/eigen3
-- Checking for module 'libopenni'
-- Found libopenni, version 1.5.4.0
-- Found openni: /usr/lib/libOpenNI.so
-- Found libusb-1.0: /usr/include
-- Checking for module 'flann'
-- Found flann, version 1.9.1
-- Found Flann: /usr/lib/x86_64-linux-gnu/libflann_cpp_s.a
-- Found qhull: /usr/lib/x86_64-linux-gnu/libqhull.so
-- Found PCL_COMMON: /usr/lib/x86_64-linux-gnu/libpcl_common.so
-- Found PCL_OCTREE: /usr/lib/x86_64-linux-gnu/libpcl_octree.so
-- Found PCL_IO: /usr/lib/x86_64-linux-gnu/libpcl_io.so
-- Found PCL_KDTREE: /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so
-- Found PCL_SEARCH: /usr/lib/x86_64-linux-gnu/libpcl_search.so
-- Found PCL_SAMPLE_CONSENSUS: /usr/lib/x86_64-linux-gnu/libpcl_sample_consensus.so
-- Found PCL_FILTERS: /usr/lib/x86_64-linux-gnu/libpcl_filters.so
-- Found PCL_2D: /usr/include/pcl-1.8
-- Found PCL_GEOMETRY: /usr/include/pcl-1.8
-- Found PCL_FEATURES: /usr/lib/x86_64-linux-gnu/libpcl_features.so
-- Found PCL_ML: /usr/lib/x86_64-linux-gnu/libpcl_ml.so
-- Found PCL_SEGMENTATION: /usr/lib/x86_64-linux-gnu/libpcl_segmentation.so
-- Found PCL_VISUALIZATION: /usr/lib/x86_64-linux-gnu/libpcl_visualization.so
-- Found PCL_SURFACE: /usr/lib/x86_64-linux-gnu/libpcl_surface.so
-- Found PCL_REGISTRATION: /usr/lib/x86_64-linux-gnu/libpcl_registration.so
-- Found PCL_KEYPOINTS: /usr/lib/x86_64-linux-gnu/libpcl_keypoints.so
-- Found PCL_TRACKING: /usr/lib/x86_64-linux-gnu/libpcl_tracking.so
-- Found PCL_RECOGNITION: /usr/lib/x86_64-linux-gnu/libpcl_recognition.so
-- Found PCL_STEREO: /usr/lib/x86_64-linux-gnu/libpcl_stereo.so
-- Found PCL_APPS: /usr/lib/x86_64-linux-gnu/libpcl_apps.so
-- Found PCL_IN_HAND_SCANNER: /usr/include/pcl-1.8
-- Found PCL_MODELER: /usr/include/pcl-1.8
-- Found PCL_POINT_CLOUD_EDITOR: /usr/include/pcl-1.8
-- Found PCL_OUTOFCORE: /usr/lib/x86_64-linux-gnu/libpcl_outofcore.so
-- Found PCL_PEOPLE: /usr/lib/x86_64-linux-gnu/libpcl_people.so
-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- program_options
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xlla/git/cpu_tsdf/build
Scanning dependencies of target get_intrinsics
Scanning dependencies of target cpu_tsdf
[ 9%] Building CXX object CMakeFiles/cpu_tsdf.dir/src/lib/octree.cpp.o
[ 18%] Building CXX object CMakeFiles/cpu_tsdf.dir/src/lib/marching_cubes_tsdf_octree.cpp.o
[ 27%] Building CXX object CMakeFiles/cpu_tsdf.dir/src/lib/tsdf_interface.cpp.o
[ 36%] Building CXX object CMakeFiles/cpu_tsdf.dir/src/lib/tsdf_volume_octree.cpp.o
[ 45%] Building CXX object CMakeFiles/get_intrinsics.dir/src/prog/get_intrinsics.cpp.o
/home/xlla/git/cpu_tsdf/src/lib/marching_cubes_tsdf_octree.cpp: In member function ‘void cpu_tsdf::MarchingCubesTSDFOctree::setInputTSDF(cpu_tsdf::TSDFVolumeOctree::ConstPtr)’:
/home/xlla/git/cpu_tsdf/src/lib/marching_cubes_tsdf_octree.cpp:82:3: error: ‘size_voxel_’ was not declared in this scope
size_voxel_ = (upper_boundary_ - lower_boundary_)* Eigen::Array3f(res_x_, res_y_, res_z_).inverse();
^~~~~~~~~~~
/home/xlla/git/cpu_tsdf/src/lib/marching_cubes_tsdf_octree.cpp:82:3: note: suggested alternative: ‘size_x’
size_voxel_ = (upper_boundary_ - lower_boundary_)* Eigen::Array3f(res_x_, res_y_, res_z_).inverse();
^~~~~~~~~~~
size_x
/home/xlla/git/cpu_tsdf/src/lib/marching_cubes_tsdf_octree.cpp:82:18: error: ‘upper_boundary_’ was not declared in this scope
size_voxel_ = (upper_boundary_ - lower_boundary_)* Eigen::Array3f(res_x_, res_y_, res_z_).inverse();
^~~~~~~~~~~~~~~
/home/xlla/git/cpu_tsdf/src/lib/marching_cubes_tsdf_octree.cpp:82:36: error: ‘lower_boundary_’ was not declared in this scope
size_voxel_ = (upper_boundary_ - lower_boundary_)* Eigen::Array3f(res_x_, res_y_, res_z_).inverse();
^~~~~~~~~~~~~~~
In file included from /home/xlla/git/cpu_tsdf/src/prog/get_intrinsics.cpp:42:0:
/usr/include/pcl-1.8/pcl/visualization/cloud_viewer.h:202:14: warning: ‘template class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
std::auto_ptr<CloudViewer_impl> impl_;
^~~~~~~~
In file included from /usr/include/c++/7/memory:80:0,
from /usr/include/boost/config/no_tr1/memory.hpp:21,
from /usr/include/boost/smart_ptr/shared_ptr.hpp:23,
from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/pcl-1.8/pcl/correspondence.h:45,
from /usr/include/pcl-1.8/pcl/visualization/pcl_visualizer.h:42,
from /usr/include/pcl-1.8/pcl/visualization/cloud_viewer.h:39,
from /home/xlla/git/cpu_tsdf/src/prog/get_intrinsics.cpp:42:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
template class auto_ptr;
^~~~~~~~
CMakeFiles/cpu_tsdf.dir/build.make:134: recipe for target 'CMakeFiles/cpu_tsdf.dir/src/lib/marching_cubes_tsdf_octree.cpp.o' failed
make[2]: *** [CMakeFiles/cpu_tsdf.dir/src/lib/marching_cubes_tsdf_octree.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/cpu_tsdf.dir/all' failed
make[1]: *** [CMakeFiles/cpu_tsdf.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 54%] Linking CXX executable get_intrinsics
[ 54%] Built target get_intrinsics
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

if I comment that line, ... size_voxel_ ..., then it built.

is the hpp file:tsdf_volume_octree.hpp any useful in this project?

i am a rookie of PCL and these other libs involved and find this project is quite interesting. But when i look into this source code, i am confused by this tsdf_volume_octree.hpp file in the folder of impl. The main confusion is that i did NOT find any usage of this file in this project, so what is the purpose of this hpp file?

How can it supports for multiple depth cameras ?

Dear the author,

It's really a great work, thank you for share it.

With one camera, it maps really well. Then at present, the data of multiple cameras need to be merged together, and the algorithm is found to be related to the internal parameters of the camera. How can multiple cameras be used to build a map?

I am looking forward to your reply.

Thank you very much.

use of normal vectors

hey stephen,
in the usage section in the readme file you state that normals aren't used with the default settings. To me this sounds like there is some setting for supporting surface normals. But browsing through the implementation i cannot find any usage of them. Could you clarify on how one would go about using the normals(if possible at all)?
Thanks in advance
Janos

Generated surface is offset by a voxel width

I made a test for accuracy where I am generating a small surface using cpu_tsdf and comparing it with the expected surface I have from my own software.
The cpu_tsdf surface always seems to be one voxel width behind the expected surface. Increasing the resolution(decreasing the voxel size) brings it closer to the expected surface. Any clues?
screen shot 2017-10-13 at 12 28 36 pm
screen shot 2017-10-13 at 12 29 38 pm

The wireframe is the expected surface, whereas the solid one is from cpu_tsdf.
Thanks!

PCD with relative Pose TXT file problems

If for some reason some PCD file or some TXT file is missing in "integrate" program loading process fail to map each PCD file with corresponding TXT. For example if i load correctly this list:

1.pcd -> 1.txt
2.pcd -> 2.txt
3.pcd -> 3.txt
5.pcd -> 4.txt

and "2.pcd" is missing, i load instead:

1.pcd -> 1.txt
3.pcd -> 2.txt
4.pcd -> 3.txt

Turn it to windows

Dear the author,

It's really a great work, thank you for share it. I have a question that it seems run in the linux but how could I turn it to the windows and compile and use in visual stdio?

I am looking forward to your reply.

Thank you very much.

TSDF on unorganised smoothed clouds

Hi there,

Firstly great work with the TSDF code! One thing I wondered is whether there is a way to get this to work with unorganised clouds? My input data from my sensor is very noisy so I tend to range filter, downsample and apply smoothing like stastical outlier removal or MLS. The issue is then I cannot give this cloud to the TSDF. My planar surfaces become very bumpy as a result.

Any advice?

Reprojection yielded 0 valid points :(

Greetings @sdmiller

Tying to get up and running with cpu_tsdf (thanks for making it!).

I'm exporting data from wonderful RTABMAP in an attempt to run it throught cpu_tsdf because such things are exciting to me. Everything looks like it compiled just fine, but i'm getting a error i don't quite understand.

I've created the pose files, put them in the right place (alongside the pcds)
image

And formatted the content as indicated in the instructions.

image

When i run the integrate command it runs very quicky. with --verbose i can see that the pose files are parsed correctly, but it seems the issue is that Reprojection yielded 0 valid points, of initial 28644 on each of the pcd frames that I've provided.

Any tips on what the issue might be? is it that the size of the volume is incorrect? or not matched to the unit system of the poses?

Reprojection yielded 0 valid points, of initial 28395
Cloud bounds: [inf, -inf], [inf, -inf], [inf, -inf]
On frame 40 / 430

Should it be producing some bounds (not inf)? might it be an issue with the pcd files? it does appear that the correct number of points are being found.

Any help/pointers here would be greatly appreciated.
The subect material is cool too (a russian submarine) as you can see (click to see on sketchfab)
image.

I would love to see how much better the tsdf will be than this one (which was created with poisson).

verbose output from the command here.

https://gist.github.com/eric-schleicher/2cf75842a597a41d953e8312459c4b16

rtabmap+cputsdf+pcl1.8.1

when I build cputsdf, cmake .. & make, and there is an error.
[ 18%] Built target get_intrinsics
[ 27%] Building CXX object CMakeFiles/cpu_tsdf.dir/src/lib/marching_cubes_tsdf_octree.cpp.o
In file included from /home/hty/Downloads/cpu_tsdf-master/include/cpu_tsdf/marching_cubes_tsdf_octree.h:46:0,
from /home/hty/Downloads/cpu_tsdf-master/src/lib/marching_cubes_tsdf_octree.cpp:41:
/usr/include/pcl-1.8/pcl/surface/impl/marching_cubes.hpp: In member function ‘virtual void pcl::MarchingCubes::performReconstruction(pcl::PointCloud&, std::vectorpcl::Vertices&)’:
/usr/include/pcl-1.8/pcl/surface/impl/marching_cubes.hpp:298:3: error: ‘size_voxel_’ was not declared in this scope
size_voxel_ = (upper_boundary_ - lower_boundary_) * Eigen::Array3f (res_x_, res_y_, res_z_).inverse ();
^~~~~~~~~~~
/usr/include/pcl-1.8/pcl/surface/impl/marching_cubes.hpp:298:18: error: ‘upper_boundary_’ was not declared in this scope
size_voxel_ = (upper_boundary_ - lower_boundary_) * Eigen::Array3f (res_x_, res_y_, res_z_).inverse ();
^~~~~~~~~~~~~~~
/usr/include/pcl-1.8/pcl/surface/impl/marching_cubes.hpp:298:36: error: ‘lower_boundary_’ was not declared in this scope
size_voxel_ = (upper_boundary_ - lower_boundary_) * Eigen::Array3f (res_x_, res_y_, res_z_).inverse ();
^~~~~~~~~~~~~~~
CMakeFiles/cpu_tsdf.dir/build.make:134: recipe for target 'CMakeFiles/cpu_tsdf.dir/src/lib/marching_cubes_tsdf_octree.cpp.o' failed
make[2]: *** [CMakeFiles/cpu_tsdf.dir/src/lib/marching_cubes_tsdf_octree.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/cpu_tsdf.dir/all' failed
make[1]: *** [CMakeFiles/cpu_tsdf.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

and then I comment that line, the error will be solved, but when I build rtabmap with cputsdf, it cannot be used with cputsdf meshing, there are no polygon.
so, I think this error should not be solved in this way, but how to solve it?

wrong include path

Is it possible that the include path in CPUTSDFConfig file ist wrong? The cmake file is setting CPUTSDF_INCLUDE_DIR as @CMAKE_INSTALL_PREFIX@/include/cpu_tsdf. But
for example in your integrate script you are including #include <cpu_tsdf/tsdf_volume_octree.h> so this wont compile. To make everything work I think one hsould set CPUTSDF_INCLUDE_DIR to @CMAKE_INSTALL_PREFIX@/include.

integrateCloud segmentation faullt

Hi

I am using your program for generating TSDF volumes. I had pointclouds from 3d Scanner calibrated on the robot. I also have transformation matrixes of the camera frame in world coorditane system. When I try to call your integrateCloud method I always get segmentation fault.
Here is my code

/*
 * Copyright (c) 2013-, Stephen Miller
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, 
 * with or without modification, are permitted provided 
 * that the following conditions are met:
 * 
 * 1. Redistributions of source code must retain the 
 * above copyright notice, this list of conditions 
 * and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the 
 * above copyright notice, this list of conditions and 
 * the following disclaimer in the documentation and/or 
 * other materials provided with the distribution.
 * 
 * 3. Neither the name of the copyright holder nor the 
 * names of its contributors may be used to endorse or
 * promote products derived from this software without 
 * specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 
 * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 
 * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 * POSSIBILITY OF SUCH DAMAGE.
 */


#include <pcl/console/print.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/io/pcd_grabber.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/ply_io.h>
#include <pcl/io/vtk_lib_io.h>
#include <pcl/pcl_macros.h>

#include <boost/filesystem/convenience.hpp>
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>

#include <string>
#include <vector>

#include <cpu_tsdf/tsdf_interface.h>
#include <cpu_tsdf/tsdf_volume_octree.h>
#include <cpu_tsdf/marching_cubes_tsdf_octree.h>


using  namespace cpu_tsdf;

int width_ = 2064;
int height_= 1544;

int main (int argc, char** argv)
{

    cpu_tsdf::TSDFVolumeOctree::Ptr tsdf (new TSDFVolumeOctree);
     tsdf->setGridSize (10., 10., 10.); // 10m x 10m x 10m
     tsdf->setResolution (4096, 4096, 4096); // Smallest cell size = 10m / 2048 = about half a centimeter
     tsdf->setIntegrateColor (false); // Set to true if you want the TSDF to store color
     tsdf->setImageSize (width_, height_);
     //Eigen::Affine3d tsdf_center; // Optionally offset the center
     //tsdf->setGlobalTransform (tsdf_center);
     tsdf->reset (); // Initialize it to be empty

     std::vector<pcl::PointCloud<pcl::PointXYZRGBA>::Ptr> clouds;
     std::vector<Eigen::Affine3d> transformations;

     for (size_t i = 1; i < 12; i++)
     {

         //int width_ = 640;
        // int height_ = 480;
         pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_out (new pcl::PointCloud<pcl::PointXYZRGBA>);
         pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud_organized (new pcl::PointCloud<pcl::PointXYZRGBA> (width_, height_));

         if (pcl::io::loadPLYFile<pcl::PointXYZRGBA>(
                 "/home/mirec/catkin_ws/clouds/cloud_from_phoxi/cloud" + std::to_string(i) + ".ply",
                 *cloud_out) == -1) //* load the file
         {
             PCL_ERROR ("Couldn't read file I! \n");
             return (-1);
         }
         else {
             //scale
             double N = 0.001;
             Eigen::Matrix4f transform = Eigen::Matrix4f::Identity();
             transform (0,0) = transform (0,0) * N;
             transform (1,1) = transform (1,1) * N;
             transform (2,2) = transform (2,2) * N;
             pcl::transformPointCloud (*cloud_out, *cloud_out, transform);

             for (long int x=0;x<= cloud_out->size();x++){

                     cloud_organized->points[x] = cloud_out->points[x];

             }


             pcl::io::savePLYFileBinary("/home/mirec/catkin_ws/clouds/cloud_from_phoxi/clouda" + std::to_string(i) + ".ply",*cloud_organized);
             std::cout << "VEELKOST:" << cloud_organized->width << std::endl;

             std::ifstream input_file1;
             std::ifstream input_file2;

             input_file1.open("/home/mirec/catkin_ws/clouds/point_for_phoxi/cloud" + std::to_string(i) + ".txt");
             if (!input_file1) {
                 std::cout << "ERROR OPENING FILE /home/mirec/catkin_ws/clouds/point_for_phoxi/cloud" + std::to_string(i) + ".txt"<< std::endl;
                 return false;
             }
             Eigen::Quaterniond rot;
             Eigen::Vector3d translation;

             input_file1 >> translation.x() >> translation.y() >> translation.z();
             input_file1 >> rot.x() >> rot.y() >> rot.z() >> rot.w();

             Eigen::Matrix4d transformation_matrix;

             Eigen::Matrix3d rotacia(rot.toRotationMatrix());
             std::cout << rotacia << std::endl;

             for (int i = 0; i<3;i++){
                 for (int x = 0; x<3;x++){
                     transformation_matrix(i,x) = rotacia(i,x);
                 }
             }

             transformation_matrix(0,3) = translation.x();
             transformation_matrix(1,3) = translation.y();
             transformation_matrix(2,3) = translation.z();
             transformation_matrix(3,3) = 1;
             transformation_matrix(3,0) = 0;
             transformation_matrix(3,1) = 0;
             transformation_matrix(3,2) = 0;


             std::cout << transformation_matrix << std::endl;


             Eigen::Affine3d transformation;
             transformation = transformation_matrix;
             clouds.push_back(cloud_organized);
             transformations.push_back(transformation);
             //tsdf->integrateCloud (*cloud_organized, pcl::PointCloud<pcl::Normal>(), transformation);
         }

     }

    for (size_t i = 0; i < clouds.size (); i++)
    {
        tsdf->integrateCloud (*clouds[i], pcl::PointCloud<pcl::Normal>(), transformations[i]);
        // Integrate the cloud
        // Note, the normals aren't being used in the default settings. Feel free to pass in an empty cloud
    }
     // Now what do you want to do with it?
     float distance; pcl::PointXYZ query_point (1.0, 2.0, -1.0);
     tsdf->getFxn (query_point, distance); // distance is normalized by the truncation limit -- goes from -1 to 1
     //pcl::PointCloud<pcl::PointNormal>::Ptr raytraced = tsdf->renderView (pose_to_render_from); // Optionally can render it
     tsdf->save ("output.vol"); // Save it?

     // Mesh with marching cubes
     MarchingCubesTSDFOctree mc;
     mc.setInputTSDF (tsdf);
     mc.setMinWeight (2); // Sets the minimum weight -- i.e. if a voxel sees a point less than 2 times, it will not render  a mesh triangle at that location
     mc.setColorByRGB (false); // If true, tries to use the RGB values of the TSDF for meshing -- required if you want a colored mesh
     pcl::PolygonMesh mesh;
     mc.reconstruct (mesh);
}

Here is GDB output

please can you help me what am I doing wrong

Thread 1 "dp_test" received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0xa1) at malloc.c:2951
2951 malloc.c: No such file or directory.
(gdb) bt
#0 __GI___libc_free (mem=0xa1) at malloc.c:2951
#1 0x00007ffff5884244 in cpu_tsdf::TSDFVolumeOctree::getFrustumCulledVoxels(Eigen::Transform<double, 3, 2, 0> const&, std::vector<boost::shared_ptr<cpu_tsdf::OctreeNode>, std::allocator<boost::shared_ptr<cpu_tsdf::OctreeNode> > >&) const
() from /home/mirec/cpu_tsdf/build/libcpu_tsdf.so
#2 0x0000000000411c23 in bool cpu_tsdf::TSDFVolumeOctree::integrateCloud<pcl::PointXYZRGBA, pcl::Normal>(pcl::PointCloudpcl::PointXYZRGBA const&, pcl::PointCloudpcl::Normal const&, Eigen::Transform<double, 3, 2, 0> const&) ()
#3 0x000000000040dd8e in main ()

Thank you for your time

Core dumped when I run integrate

When I run integrate executable file , as follows:
./integrate --in ../sample_data/ --out ../output_data/
The output error is :
Found PCD files with prefix: ../sample_data/cloud_, poses with prefix: ../sample_data/pose_ poses
Reading in ascii pose files
Segmentation fault (core dumped)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.