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

Organized cloud can be loaded from ASCII but not from binary #10

Open
eudoxos opened this issue Apr 22, 2018 · 2 comments
Open

Organized cloud can be loaded from ASCII but not from binary #10

eudoxos opened this issue Apr 22, 2018 · 2 comments

Comments

@eudoxos
Copy link

eudoxos commented Apr 22, 2018

I am getting assertion error here:

/usr/local/lib/python3.6/dist-packages/pypcd-0.1.1-py3.6.egg/pypcd/pypcd.py in check_sanity(self)
    621         md = self.get_metadata()
    622         assert(_metadata_is_consistent(md))
--> 623         assert(len(self.pc_data) == self.points)
    624         assert(self.width*self.height == self.points)
    625         assert(len(self.fields) == len(self.count))

AssertionError: 

when loading an organized cloud from binary, but loads fine the very same cloud saved as ASCII. I can later provide a sample input files, but those I have at the moment are too big (45M for binary).

@eudoxos
Copy link
Author

eudoxos commented Apr 24, 2018

Here is a minimal cloud (10x22) showing the issue - ASCII opens flawlessly, height and width are correctly reported, while binary (both with and without compression) fail as shown above.

organized-10x22.zip

@eudoxos
Copy link
Author

eudoxos commented Apr 24, 2018

FWIW code how the cloud was created:

#include<pcl/point_types.h>
#include<pcl/point_cloud.h>
#include<pcl/io/pcd_io.h>
#include<pcl/io/ply_io.h>

#include<string>
int main(int argc, char** argv){
	int rows=10,cols=22;
	pcl::PointCloud<pcl::PointXYZI> cl;
	// PointCloud::operator(column,row){ return (points[row * this->width + column]); }
	cl.width=cols;
	cl.height=rows;
	cl.resize(cols*rows);
	cl.is_dense=false;
	assert(cl.isOrganized());
	for(int r=0; r<rows; r++){
		for(int c=0; c<cols; c++){
			cl(c,r).x=c;
			cl(c,r).y=r;
			cl(c,r).z=c;
			cl(c,r).intensity=r;
		}
	}
	std::string out("organized_height=rows="+std::to_string(rows)+"_width=cols="+std::to_string(cols));
	pcl::io::savePCDFileBinaryCompressed(out+"_bin-compressed.pcd",cl);
	pcl::io::savePCDFileBinaryCompressed(out+"_bin.pcd",cl);
	pcl::io::savePCDFileASCII(out+"_ascii.pcd",cl);
	pcl::io::savePLYFileBinary(out+"_bin.ply",cl);
	return 0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant