41 #include <pcl/registration/registration.h>
42 #include <pcl/visualization/pcl_visualizer.h>
56 template<
typename Po
intSource,
typename Po
intTarget,
typename Scalar =
float>
63 update_visualizer_ (),
64 first_update_flag_ (false),
67 cloud_intermediate_ (),
68 maximum_displayed_correspondences_ (0)
99 visualizer_updating_mutex_.lock ();
101 first_update_flag_ =
false;
103 visualizer_updating_mutex_.unlock ();
140 visualizer_updating_mutex_.lock ();
143 maximum_displayed_correspondences_ = maximum_displayed_correspondences;
146 visualizer_updating_mutex_.unlock();
153 return maximum_displayed_correspondences_;
163 getIndexedName (std::string &root_name, std::size_t &
id)
165 return root_name + std::to_string(
id);
172 std::thread viewer_thread_;
175 std::string registration_method_name_;
180 PointTarget> &cloud_tgt,
const pcl::Indices &indices_tgt)> update_visualizer_;
183 bool first_update_flag_;
192 std::mutex visualizer_updating_mutex_;
204 std::size_t maximum_displayed_correspondences_;
209 #include <pcl/visualization/impl/registration_visualizer.hpp>
Registration represents the base registration class for general purpose, ICP-like methods.
const std::string & getClassName() const
Abstract class get name method.
bool registerVisualizationCallback(std::function< UpdateVisualizerCallbackSignature > &visualizerCallback)
Register the user callback function which will be called from registration thread in order to update ...
RegistrationVisualizer represents the base class for rendering the intermediate positions occupied by...
void setMaximumDisplayedCorrespondences(const int maximum_displayed_correspondences)
Set maximum number of correspondence lines which will be rendered.
RegistrationVisualizer()
Empty constructor.
void stopDisplay()
Stop the viewer thread.
bool setRegistration(pcl::Registration< PointSource, PointTarget, Scalar > ®istration)
Set the registration algorithm whose intermediate steps will be rendered.
~RegistrationVisualizer()
std::size_t getMaximumDisplayedCorrespondences()
Return maximum number of correspondence lines which are rendered.
void startDisplay()
Start the viewer thread.
void updateIntermediateCloud(const pcl::PointCloud< PointSource > &cloud_src, const pcl::Indices &indices_src, const pcl::PointCloud< PointTarget > &cloud_tgt, const pcl::Indices &indices_tgt)
Updates visualizer local buffers cloud_intermediate, cloud_intermediate_indices, cloud_target_indices...
shared_ptr< PCLVisualizer > Ptr
IndicesAllocator<> Indices
Type used for indices in PCL.