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

Hydro backport 764 #766

Merged
merged 1 commit into from
May 12, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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