Merge pull request #5 from fkie/fix-pointcloud2-projection

Fix pointcloud2 projections
This commit is contained in:
hersh 2013-10-30 11:10:10 -07:00
commit ab31d9005c

View File

@ -424,7 +424,7 @@ const boost::numeric::ublas::matrix<double>& LaserProjection::getUnitVectors_(do
for (size_t i = 0; i < n_pts; ++i) for (size_t i = 0; i < n_pts; ++i)
{ {
//check to see if we want to keep the point //check to see if we want to keep the point
if (scan_in.ranges[i] <= range_cutoff && scan_in.ranges[i] >= scan_in.range_min) if (scan_in.ranges[i] < range_cutoff && scan_in.ranges[i] >= scan_in.range_min)
{ {
float *pstep = (float*)&cloud_out.data[count * cloud_out.point_step]; float *pstep = (float*)&cloud_out.data[count * cloud_out.point_step];
@ -515,7 +515,7 @@ const boost::numeric::ublas::matrix<double>& LaserProjection::getUnitVectors_(do
//ensure that we use the correct timestamps //ensure that we use the correct timestamps
channel_options |= channel_option::Index; channel_options |= channel_option::Index;
projectLaser_(scan_in, cloud_out, -1.0, channel_options); projectLaser_(scan_in, cloud_out, range_cutoff, channel_options);
//we'll assume no associated viewpoint by default //we'll assume no associated viewpoint by default
bool has_viewpoint = false; bool has_viewpoint = false;