PointCloudCrafter
Loading...
Searching...
No Matches
pointcloudcrafter_file.hpp
1/*
2 * Copyright 2024 Markus Pielmeier, Florian Sauerbeck,
3 * Dominik Kulmer, Maximilian Leitenstern
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#include <rclcpp/clock.hpp>
21#include <rclcpp/rclcpp.hpp>
22
23#include <pcl/PCLPointCloud2.h>
24
25#include <string>
26#include <utility>
27#include <vector>
28#include <unordered_map>
29#include <Eigen/Eigen>
30
31#include "cli/cli_config.hpp"
32
33namespace pointcloudcrafter
34{
38class PCFile
39{
40public:
41 explicit PCFile(const config::FileConfig & cfg);
42 void run();
43
44protected:
45 void process_pointcloud(const std::string & input_path,
46 const size_t & file_index, const bool & last_file);
47
48private:
50 rclcpp::Logger logger_;
51 std::vector<std::string> pc_files_{};
52 int64_t processed_frames_{0};
53 int64_t stride_frames_{0};
54 std::vector<Eigen::Affine3d> file_transforms_{};
55 pcl::PCLPointCloud2::Ptr merged_cloud{new pcl::PCLPointCloud2()};
56};
57
58} // namespace pointcloudcrafter
void run()
Run the point cloud file processing.
Definition pointcloudcrafter_file.cpp:84
PCFile(const config::FileConfig &cfg)
PCFile class.
Definition pointcloudcrafter_file.cpp:39
void process_pointcloud(const std::string &input_path, const size_t &file_index, const bool &last_file)
Process a single pointcloud file.
Definition pointcloudcrafter_file.cpp:131
FileConfig input configuration.
Definition cli_config.hpp:178