Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Eigen Memory.h] PCL 1.11.1 -> PCL 1.14.1, the same code went wrong #6167

Open
Neo-YH opened this issue Nov 12, 2024 · 4 comments
Open

[Eigen Memory.h] PCL 1.11.1 -> PCL 1.14.1, the same code went wrong #6167

Neo-YH opened this issue Nov 12, 2024 · 4 comments
Labels
kind: bug Type of issue status: triage Labels incomplete

Comments

@Neo-YH
Copy link

Neo-YH commented Nov 12, 2024

Describe the bug

PCL 1.11.1 -> PCL 1.14.1, the same code went wrong
It might be my fault, but I couldn't find the reason. Sorry for put the question here.

Context

void pcltools::filter_passthrough(pcl::PointCloud<pcl::PointXYZ>::Ptr Inputcloud, pcl::PointCloud<pcl::PointXYZ>::Ptr filteredcloud, double min_bound, double max_bound, string axis)
{
	pcl::PassThrough<pcl::PointXYZ> pass;
	pass.setInputCloud(Inputcloud);           
	pass.setFilterFieldName(axis);         
	pass.setFilterLimits(min_bound, max_bound);        
	pass.filter(*filteredcloud);            
}

I want to define this function, it can be successfully invoked in PCL 1.11.1, but went wrong in PCL 1.14.1.
Does PCL 1.14.1 have stricter memory management?

Expected behavior

filter_passthrough(cloud_input, cloud_in_parkinglot, PARKINGLOT_X_MIN, PARKINGLOT_X_MAX, "x");
I hope that similar types of syntax can be executed correctly.

Current Behavior

/** \internal Frees memory allocated with aligned_malloc. */
EIGEN_DEVICE_FUNC inline void aligned_free(void *ptr)
{
  #if (EIGEN_DEFAULT_ALIGN_BYTES==0) || EIGEN_MALLOC_ALREADY_ALIGNED

    EIGEN_USING_STD(free)
    free(ptr);

  #else
    handmade_aligned_free(ptr);
  #endif
}

In PCL 1.14.1, calling free(ptr) sometimes triggers an error, whereas PCL 1.11.1 does not trigger this error.

Your Environment (please complete the following information):

  • OS: Windows10
  • Compiler: MSVC (Visual Studio 2022)
  • PCL Version: PCL 1.11.1/PCL 1.14.1

Possible Solution

Has PCL 1.14.1 introduced stricter restrictions, such as ensuring that the input or output point clouds for filters cannot be null?
The issue I'm encountering doesn't seem to be caused by an empty point cloud, but I suspect there may be such limitations.

@Neo-YH Neo-YH added kind: bug Type of issue status: triage Labels incomplete labels Nov 12, 2024
@mvieth
Copy link
Member

mvieth commented Nov 12, 2024

@Neo-YH Hi, do you use CMake to build your code? If not, I would recommend you to use it. There are some compiler options that need to be set the same when compiling PCL and when compiling your own code (e.g. AVX/AVX2 enabled). CMake automatically takes care of this. It is possible to set these manually in Visual Studio, but using CMake is easier. See also https://pcl.readthedocs.io/projects/tutorials/en/master/using_pcl_pcl_config.html

@Neo-YH
Copy link
Author

Neo-YH commented Nov 12, 2024

@mvieth Thank you so much for your reply.
I'm using released all-in-one package.

[PCL-1.14.1-AllInOne-msvc2022-win64.exe](https://github.com/PointCloudLibrary/pcl/releases/download/pcl-1.14.1/PCL-1.14.1-AllInOne-msvc2022-win64.exe

Is it ok to use this, or should I build PCL from source using CMake? Could using PCL-1.14.1-AllInOne-msvc2022-win64.exe cause any issues?

@mvieth
Copy link
Member

mvieth commented Nov 12, 2024

@Neo-YH Using the AllInOne installer is fine, but like I said, I would recommend you to use CMake when compiling your own code/your own project. Then you should be able to use the AllInOne installer without problems.

@Neo-YH
Copy link
Author

Neo-YH commented Nov 12, 2024

I will have a try. I'll reach out to you again if I run into any problems. Thank you for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Type of issue status: triage Labels incomplete
Projects
None yet
Development

No branches or pull requests

2 participants