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

Fix Disappearing cloud from Selection #814

Merged
merged 1 commit into from
Aug 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
21 changes: 16 additions & 5 deletions apps/cloud_composer/src/merge_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ pcl::cloud_composer::MergeSelection::performAction (ConstItemList input_data, Po

pcl::ExtractIndices<pcl::PCLPointCloud2> filter;
pcl::PCLPointCloud2::Ptr merged_cloud (new pcl::PCLPointCloud2);
//To Save the pose of the first original item
Eigen::Vector4f source_origin;
Eigen::Quaternionf source_orientation;
bool pose_found = false;
foreach (const CloudItem* input_cloud_item, selected_item_index_map_.keys ())
{
//If this cloud hasn't been completely selected
Expand All @@ -72,8 +76,13 @@ pcl::cloud_composer::MergeSelection::performAction (ConstItemList input_data, Po
filter.filter (*selected_points);

qDebug () << "Original minus indices is "<<original_minus_indices->width;
Eigen::Vector4f source_origin = input_cloud_item->data (ItemDataRole::ORIGIN).value<Eigen::Vector4f> ();
Eigen::Quaternionf source_orientation = input_cloud_item->data (ItemDataRole::ORIENTATION).value<Eigen::Quaternionf> ();

if (!pose_found)
{
source_origin = input_cloud_item->data (ItemDataRole::ORIGIN).value<Eigen::Vector4f> ();
source_orientation = input_cloud_item->data (ItemDataRole::ORIENTATION).value<Eigen::Quaternionf> ();
pose_found = true;
}
CloudItem* new_cloud_item = new CloudItem (input_cloud_item->text ()
, original_minus_indices
, source_origin
Expand All @@ -95,11 +104,13 @@ pcl::cloud_composer::MergeSelection::performAction (ConstItemList input_data, Po
concatenatePointCloud (*merged_cloud, *input_cloud, *temp_cloud);
merged_cloud = temp_cloud;
}

CloudItem* cloud_item = new CloudItem ("Cloud from Selection"
, merged_cloud);
, merged_cloud
, source_origin
, source_orientation);

output.append (cloud_item);

return output;
}
}