Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Sérgio Agostinho
    @SergioRAgostinho
    In general no. OMP enabled classes are more the exception than the rule.
    Sérgio Agostinho
    @SergioRAgostinho
    It doesn’t mean that they can’t be optimized. It’s just not a priority in the short to mid-term future. If it is something that you’re personally interested, then I would recommend "getting your hands dirty” and dig into PCLs code and try to enable OMP or accelerate the classes which are most critical for you.
    Witek-
    @Witek-
    That's too bad. I guess I'll have to do it if standard performance turns out to be too slow.... At least I know it is not me making some trivial mistake, but it's the way PCL works.
    Sérgio Agostinho
    @SergioRAgostinho
    Yep. The expectation were too high from the start :)
    For your level of requirements, you’re gonna need to get your hands dirty often.
    Witek-
    @Witek-
    Yeah, kind of. I was just stunned that my quite powerful desktop is doing things so slow.... I worked with PCL before on an old PC (dual core, I suppose) and the processing time was less than 1 fps (but we didn't care so much) so I automatically (and little naively) assumed that having a modern CPU will result in much shorter times. It turns out, however, that with multicore CPU, the overall performance will be similar to an older machine with less cores. Well, as you said, we will have to get our hands dirty a little...
    Anyway, thanks for your help - it clarified the situation
    Sergey Alexandrov
    @taketwo
    For maximum performance compile PCL yourself (this will enable -march=native) and in Release mode. You probably have done this already, but just in case.
    Witek-
    @Witek-
    No, I haven't. I used PCL-1.9.1-AllInOne-msvc2017-win64.exe. Of course I am using Release mode. The march=native option will increase performance marginally, I suppose, as still one cor will be busy, right?
    Sergey Alexandrov
    @taketwo
    Oh, march=native is from the Linux world, I don't know what's the equivalent in Windows. It ensures that all processor intrinsics are utilized (SSE, AVX, and friends). When a packaged version is compiled, the maintainer does not know on which processor it will run, so naturally the resulting assembly is not optimized. But you are right, it certainly won't double your performance, so may be considered as marginal improvement.
    Kunal Tyagi
    @kunaltyagi

    These routines are geerally not internally parallelized, I cannot gain much by optimizing my code, can I?

    Well, you can expect massive speedups because of pipelining your function through different cores. That means each core is working on a different part. If you have 5 functions and 5 cores, it means you can expect framerate to be limited by the slowest function instead of the total processing

    Kunal Tyagi
    @kunaltyagi
    In an ideal world, it means 5x speed. Then you can modify the slow function and make it faster (somehow).
    If each copy of your big function is ran on a different core, it also implies a similar speedup.
    Witek-
    @Witek-
    The problem is that these functions have to be executed one after another, so I cannot simply grab a frame and process it by having each core do something. I think that your suggestion about queuing the frames and processing them in separate threads would be the best approach. I have never done that, though, but I guess I will figure it out.
    Kunal Tyagi
    @kunaltyagi
    @Witek- I'm making a dummy example for you that might become a good starting point. Also, could you give me the links to the functions that would make good parallelization candidates. I'll take a look into if we can add execution_agent into them (see std::for_each)
    HabibaZImam
    @HabibaZImam

    Hello everyone,

    I am very new to PCL and Programming in general so my questions might sound very basic to most of you. I have been working on registration algorithms. My task is to register a damaged model with a nominal one. For that I chose pairwise incremental registration found on the PCL website. I have two questions:
    1) Is this the right code for what I'm trying to achieve.
    2) The input to this code is a pcd file. So, I have to convert a ply to pcd and I followed the following https://github.com/saimanoj18/ply2pcd
    I am able to build it and debug it but when I run it on the command prompt I get this:

    C:\PCLProjects\ply2pcd-master\Debug>ply2pcd.exe Damaged_model.ply
    Usage:
    ply2pcd.exe [-a] input.ply output.pcd
    -a ASCII output
    How do I get a pcd file from here?
    I've been trying to understand all this for a couple of weeks now and if anyone could nudge me in the right direction I would greatly appreciate it! Thanks in advance.

    Sérgio Agostinho
    @SergioRAgostinho
    1) From what you wrote, you seem to be on the right track. Can you link the exact tutorial you’re following, just to be sure? Keep in mind that registration is very specific to its application. So whatever work in the tutorials, might need some changes to work for your case.

    2) The code you linked it’s not officially maintained by us. Nevertheless, you’re not calling the executable correctly. That is why, it is printing its usage help message. The idea seems to be invoke it like

    ply2pcd.exe Damaged_model.ply Damaged_model.pcd

    It needs you to specify the input and output folder. It seems you only specified the input.

    HabibaZImam
    @HabibaZImam

    Hi Sergio,
    Thanks for your quick reply. I made the changes and was finally able to get a pcd file.
    Great! That makes me very relieved and I'm linking the code below for you to double check.

    http://pointclouds.org/documentation/tutorials/pairwise_incremental_registration.php

    HabibaZImam
    @HabibaZImam

    Also, this is what I get when I convert it. I sampled my stl file and saved it in ply in cloud compare and checked ASCII but when I convert it I get it in binary.

    C:\PCL\bin>pcl_ply2pcd_release originalcyl.ply originalcyl.pcd
    Convert a PLY file to PCD format. For more information, use: pcl_ply2pcd_release -h
    PCD output format: binary

    Loading originalcyl.ply [pcl::PLYReader] originalcyl.ply:11: property 'list uint8 int32 vertex_indices' of element 'face' is not handled
    [done, 23 ms : 66 points]
    Available dimensions: x y z
    Saving originalcyl.pcd [done, 0 ms : 66 points]

    pavelbangladeshi
    @pavelbangladeshi
    Hello
    Witek-
    @Witek-

    @Kunal Tyagi- I'm making a dummy example for you that might become a good starting point. Also, could you give me the links to the functions that would make good parallelization candidates. I'll take a look into if we can add execution_agent into them (see std::for_each)

    Thank you. That would be very helpful. I will look at the code today and list the functions here.

    Ghada
    @hackora
    Hi everyone,
    I am using a VLP 16 lidar and wanted to know if there is a specific order to the point cloud that is saved as a pcd file when using pcl::io::savePCDFileASCII.
    Sérgio Agostinho
    @SergioRAgostinho

    I'm linking the code below for you to double check.
    http://pointclouds.org/documentation/tutorials/pairwise_incremental_registration.php

    This is a good approach to try first.

    Sérgio Agostinho
    @SergioRAgostinho

    checked ASCII but when I convert it I get it in binary.

    You need to indicate explicitly if you want an ASCII output, because in general is not storage efficient. Most of these converter tools you’ve been using were replaced by single one with the name pcl_converter, which can convert from and to any of the formats you’ve been dealing. For your particular case

    pcl_converter --format ascii  originalcyl.ply originalcyl.pcd

    should do the trick. I would advice to stick to using pcl_converter only from now on.

    I am using a VLP 16 lidar and wanted to know if there is a specific order to the point cloud that is saved as a pcd file when using pcl::io::savePCDFileASCII.

    Disclaimer: I did not check the source code. It should follow the same order of points of the PointCloud container which you passed to pcl::io::savePCDFileASCII.

    Ghada
    @hackora
    Thank you Sergio for the quick response. I am using a pcl::VLPGrabber object with an ipaddress and port number to acquire the data so I'm not quite sure if there will be an order for the point cloud collected. I would like to identify the points coming from each full rotation of the lidar and I would appreciate any ideas or pointers on how to achieve that.
    Sérgio Agostinho
    @SergioRAgostinho
    I never used a velodyne, so I can’t really advise on this. My first step would be to incrementally plot the poincloud, adding one point each time, to validate if there’s a specific ordering to the way points are added. I suspect there should be.
    Ghada
    @hackora
    Thanks! I'll look into that.
    HabibaZImam
    @HabibaZImam
    @SergioRAgostinho Thanks a ton. This works better!
    Witek-
    @Witek-
    @kunaltyagi When it comes to optimizing certain routines, I think most filters and extractions could be parallelized as they iterate through points, so making it multicore should be relatively easy, I think. Filters such as NaN removal or passthrough are the easiest to optimize, but the gain will be marginal, as they are quick. However applying a similar parallelization to outliers removal or segmentation routines should bring a substantial speedup. I wonder if this would be very hard to implement?
    Kunal Tyagi
    @kunaltyagi
    Thanks for the starting point @Witek- . I'll take a look at the code. The modifications might not be hard (naively, convert loop body to lambda and use for_each), but testing to make sure that they are zero-cost (runtime and if possible compile time as well) for non-parallel use-case might be hard.
    @SergioRAgostinho @taketwo do we have any micro-benchmarks or framework to compare results easily?
    Gauthier-Clerc François
    @Enderdead
    Hi everyone,
    I'm using PCL into my 2D lidar project. But many implementations with PointXY are missing. Like normal estimation, centroid and more... So I have to reimplement many algorithms instead of using PCL native features. It's a PCL community wills or oversight, to only focus on 3D?
    Kunal Tyagi
    @kunaltyagi
    Why don't you use PointXYZ with z = 0? Just a hack, but I haven't looked into why PointXY is not at feature parity with PointXYZ
    Kunal Tyagi
    @kunaltyagi
    @Witek- I seem to be making a really silly error kunaltyagi/parallel_frames_pcl#1 The code should be sufficient to give you an idea of how to make your code parallel. I'd welcome your help in getting this up and running for others too
    Gauthier-Clerc François
    @Enderdead

    @kunaltyagi

    Why don't you use PointXYZ with z = 0? Just a hack, but I haven't looked into why PointXY is not at feature parity with PointXYZ

    Because if i compute normal with your trick i will have only (0,0,1) normal.

    Witek-
    @Witek-

    @kunaltyagi

    @Witek- I seem to be making a really silly error kunaltyagi/parallel_frames_pcl#1 The code should be sufficient to give you an idea of how to make your code parallel. I'd welcome your help in getting this up and running for others too

    Capital L in PointCLoud is the problem.

    Kunal Tyagi
    @kunaltyagi
    Thanks. My brain didn't seem to find this
    Kunal Tyagi
    @kunaltyagi
    @Witek- Thanks. I've pushed a finished version. It was a fun exercise :)
    In 30 seconds and 300 target fps, it missed 6 frames. Not too shabby. You might have to give the loop rate to be around 5% more than what you require
    Kunal Tyagi
    @kunaltyagi
    Use of taskflow isn't strictly required, I added that in case your steps can also be parallelized
    Kunal Tyagi
    @kunaltyagi
    What does PCL_INSTANTIATE(removeNanFromPointCloud, PCL_XYZ_POINT_TYPES) expand to? It's in filter_indices.cpp, line 64
    Witek-
    @Witek-
    @kunaltyagi Thanks a lot. I just managed to get your code running with my VS2017 - I never used taskflow before so I had to get a grasp of it. Now I am going to (understand it and) get it running with my application. I will probably bother you later :) Thanks again.
    Sérgio Agostinho
    @SergioRAgostinho

    @SergioRAgostinho @taketwo do we have any micro-benchmarks or framework to compare results easily?

    The closest we have is something Sergey wrote. https://github.com/taketwo/pcl-transforms

    Kunal Tyagi
    @kunaltyagi
    I just thought that having benchmarks for compile time and runtimes would be interesting to plot since PCL is moving from boost to std. Plus they are also a factor during refactoring code
    Sérgio Agostinho
    @SergioRAgostinho
    I don't think anyone would say no to that. Not a personal priority of mine though.
    Kunal Tyagi
    @kunaltyagi
    It's too complicated for me to work on :P So I'll leave that as a wish list
    Not complicated, just messy.
    HabibaZImam
    @HabibaZImam

    Hi
    I am trying to estimate surface normals for one set of point clouds, this is the code I followed:

    var code = "formatted";
    #include <pcl/io/io.h>
    #include <pcl/io/pcd_io.h>
    #include <pcl/point_types.h>
    #include <pcl/features/normal_3d.h>
    #include <pcl/features/integral_image_normal.h>
    #include <pcl/visualization/cloud_viewer.h>
    #include <iostream>
    #include <limits>
    #include <pcl/point_cloud.h>
    #include <pcl/filters/filter.h>
    #define _CRT_SECURE_NO_WARNINGS
    int
    main()
    {
    pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
    pcl::io::loadPCDFile("damagedscan.pcd", *cloud);
    
    // Create the normal estimation class, and pass the input dataset to it
    pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne;
    ne.setInputCloud(cloud);
    
    // Create an empty kdtree representation, and pass it to the normal estimation object.
    // Its content will be filled inside the object, based on the given input dataset (as no other search surface is given).
    pcl::search::KdTree<pcl::PointXYZ>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZ>());
    ne.setSearchMethod(tree);
    
    // Output datasets
    pcl::PointCloud<pcl::Normal>::Ptr cloud_normals(new pcl::PointCloud<pcl::Normal>);
    
    ne.setKSearch(8);
    
    // Compute the features
    ne.compute(*cloud_normals);
    for (int ix = 0; ix < cloud_normals->points.size(); ix++)
    {
        if (isnan(cloud_normals->points[ix].normal_x) ||
            isnan(cloud_normals->points[ix].normal_y) ||
            isnan(cloud_normals->points[ix].normal_z))
        {
            continue;
        }
    }
    // cloud_normals->points.size () should have the same size as the input cloud->points.size ()*
    //pcl::removeNaNNormalsFromPointCloud((const pcl::PointCloud< PointT > &cloud, pcl::PointCloud< PointT > &cloud_normals, std::vector< int > &index)
      // visualize normals 
      // visualize normals 
    pcl::visualization::PCLVisualizer viewer("PCL Viewer");
    viewer.setBackgroundColor(5, 55, 10);
    
    viewer.addPointCloudNormals<pcl::PointXYZ, pcl::Normal>(cloud, cloud_normals,25, 0.15, "normals");
    while (!viewer.wasStopped())
    {
        viewer.spinOnce();
    }
    
    
    pcl::io::savePCDFileASCII("test_pcd.pcd", *cloud_normals);
    
    return 0;
    }

    The file that I get looks fine to me but I can't visualize the normals when I try to. I also tried pcd_viewer -normals in cmd window but it only shows me point clouds.
    I think there's something wrong in the line ne.setKSearch(8); when I tried with ne.setRadiusSearch (0.03) I get all NaN points in my output file. Please tell me what I am doing wrong. I would appreciate all the help!

    Sérgio Agostinho
    @SergioRAgostinho

    when I tried with ne.setRadiusSearch (0.03) I get all NaN points in my output file.

    The search radius might be simply too small.