Skip to content

Fix ICP viewpoint adaptation issue by aligning sensor coordinates #6280

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions registration/include/pcl/registration/impl/registration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,21 @@ Registration<PointSource, PointTarget, Scalar>::align(PointCloudSource& output,

computeTransformation(output, guess);

// The resulting point cloud 'output' is aligned with the input_ point cloud in terms of point values,
// but coordinate frames have not been taken into account.
// In other words, the 'output' is still expressed in the coordinate frame of the input_ sensor.
// to resolve this , we can simply reassign the sensor_origin_ and sensor_orientation_ of the output cloud to the target cloud.

if (input_->sensor_orientation_!= target_->sensor_orientation_ || input_->sensor_origin_ != target_->sensor_origin_) {
output.sensor_orientation_ = target_->sensor_orientation_;
output.sensor_origin_ = target_->sensor_origin_;

PCL_WARN("[pcl::%s::align] The sensor_origin_ and sensor_orientation_ of the source and target clouds differ.\n"
" The output cloud will remain in the source sensor's coordinate frame.\n"
" Original sensor-to-sensor relative pose information may be lost.\n",
getClassName().c_str());
}

deinitCompute();
}

Expand Down
Loading