Skip to content

Commit

Permalink
Merge pull request #764 from vrabaud/indigo-devel
Browse files Browse the repository at this point in the history
fix #762
  • Loading branch information
wjwwood committed May 11, 2014
2 parents 69448a7 + e2f5667 commit 2ce5891
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/rviz/default_plugin/point_cloud_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,10 @@ bool PointCloudCommon::transformCloud(const CloudInfoPtr& cloud_info, bool updat
cloud_points.clear();

size_t size = cloud_info->message_->width * cloud_info->message_->height;
cloud_points.resize(size);
PointCloud::Point default_pt;
default_pt.color = Ogre::ColourValue(1, 1, 1);
default_pt.position = Ogre::Vector3::ZERO;
cloud_points.resize(size, default_pt);

{
boost::recursive_mutex::scoped_lock lock(transformers_mutex_);
Expand All @@ -847,17 +850,8 @@ bool PointCloudCommon::transformCloud(const CloudInfoPtr& cloud_info, bool updat
return false;
}

bool res = xyz_trans->transform(cloud_info->message_, PointCloudTransformer::Support_XYZ, transform, cloud_points);
res &= color_trans->transform(cloud_info->message_, PointCloudTransformer::Support_Color, transform, cloud_points);
// In case there was a problem, assign a default value
if (!res)
{
PointCloud::Point default_pt;
default_pt.color = Ogre::ColourValue(1, 1, 1);
default_pt.position = Ogre::Vector3::ZERO;
cloud_points.clear();
cloud_points.resize(size, default_pt);
}
xyz_trans->transform(cloud_info->message_, PointCloudTransformer::Support_XYZ, transform, cloud_points);
color_trans->transform(cloud_info->message_, PointCloudTransformer::Support_Color, transform, cloud_points);
}

for (V_PointCloudPoint::iterator cloud_point = cloud_points.begin(); cloud_point != cloud_points.end(); ++cloud_point)
Expand Down

0 comments on commit 2ce5891

Please sign in to comment.