1 #define PCL_NO_PRECOMPILE 5 #include <boost/thread/mutex.hpp> 6 #include <nav_msgs/Path.h> 7 #include <geometry_msgs/PoseStamped.h> 8 #include <geometry_msgs/TransformStamped.h> 9 #include <std_srvs/Empty.h> 11 #include <pcl/point_types.h> 12 #include <pcl/point_cloud.h> 29 double voxelgrid_size_save,
32 std::string output_filename,
51 void poseCallback(
const geometry_msgs::PoseStampedConstPtr& current_pose);
65 bool saveCloud(std_srvs::Empty::Request &req, std_srvs::Empty::Request &resp);
68 bool togglePause(std_srvs::Empty::Request &req, std_srvs::Empty::Request &resp);
CloudAccumulator(double voxelgrid_size_display, double voxelgrid_size_save, double min_distance, double max_distance, std::string output_filename, bool keep_high_res, bool start_paused)
void trajectoryCallback(const nav_msgs::PathConstPtr &path)
Replace all saved camera poses by those in path.
bool pause_
Whether to ignore input data.
void poseCallback(const geometry_msgs::PoseStampedConstPtr ¤t_pose)
Saves camera pose.
ros::Time last_pose_stamp_
tf2_ros::Buffer tf_buffer_
Stores the history of poses and allows to interpolate.
void pointCloudCallback(const pointcloud_t::ConstPtr &pointcloud)
For each cloud.
double voxelgrid_size_save_
Filter size for the saved cloud.
Displays one cloud using the PCLVisualizer.
boost::thread viewer_thread_
pointcloud_t::Ptr display_cloud_
Cloud that is displayed.
std::string output_filename_
Where to save the cloud.
std::deque< pointcloud_t::Ptr > clouds_
Storage for later corraection and saving.
double voxelgrid_size_display_
Filter size for the display cloud.
double min_distance_
Discard points closer than this.
boost::mutex display_cloud_mutex_
boost::mutex tf_buffer_mutex_
Eigen::Affine3f lookupTransform(double timestamp)
double max_distance_
Discard points farther than this.
Demonstration for how to create a registered point cloud map using the rc_visard. ...
pointcloud_t::Ptr rebuildCloud()
For all saved clouds.
bool saveCloud(std_srvs::Empty::Request &req, std_srvs::Empty::Request &resp)
size_t num_poses_
Keep track of pose count (to show a good error message)
bool togglePause(std_srvs::Empty::Request &req, std_srvs::Empty::Request &resp)
Toggle whether to ignore incoming data.
pcl::PointCloud< point_t > pointcloud_t
bool keep_high_res_
If false, do not store clouds. On save, save display cloud.