-
Notifications
You must be signed in to change notification settings - Fork 658
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor naive method and fix the multithreading issue
Signed-off-by: vividf <[email protected]>
- Loading branch information
Showing
16 changed files
with
349 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+482 KB
sensing/autoware_pointcloud_preprocessor/docs/image/concatenate_all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.4 KB
sensing/autoware_pointcloud_preprocessor/docs/image/concatenate_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.1 KB
sensing/autoware_pointcloud_preprocessor/docs/image/concatenate_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+280 KB
sensing/autoware_pointcloud_preprocessor/docs/image/concatenate_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
...include/autoware/pointcloud_preprocessor/concatenate_data/collector_matching_strategy.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// Copyright 2024 TIER IV, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#pragma once | ||
|
||
#include "cloud_collector.hpp" | ||
|
||
#include <rclcpp/node.hpp> | ||
|
||
#include <sensor_msgs/msg/point_cloud2.hpp> | ||
|
||
#include <list> | ||
#include <memory> | ||
#include <optional> | ||
#include <string> | ||
#include <unordered_map> | ||
#include <vector> | ||
|
||
namespace autoware::pointcloud_preprocessor | ||
{ | ||
|
||
struct MatchingParams | ||
{ | ||
std::string topic_name; | ||
double cloud_timestamp; | ||
double cloud_arrival_time; | ||
}; | ||
|
||
class CollectorMatchingStrategy | ||
{ | ||
public: | ||
virtual ~CollectorMatchingStrategy() = default; | ||
|
||
[[nodiscard]] virtual std::optional<std::shared_ptr<CloudCollector>> match_cloud_to_collector( | ||
const std::list<std::shared_ptr<CloudCollector>> & cloud_collectors, | ||
const MatchingParams & params) const = 0; | ||
virtual void set_collector_timestamp( | ||
std::shared_ptr<CloudCollector> & collector, const MatchingParams & matching_params) = 0; | ||
}; | ||
|
||
class NaiveMatchingStrategy : public CollectorMatchingStrategy | ||
{ | ||
public: | ||
explicit NaiveMatchingStrategy(rclcpp::Node & node); | ||
[[nodiscard]] std::optional<std::shared_ptr<CloudCollector>> match_cloud_to_collector( | ||
const std::list<std::shared_ptr<CloudCollector>> & cloud_collectors, | ||
const MatchingParams & params) const override; | ||
void set_collector_timestamp( | ||
std::shared_ptr<CloudCollector> & collector, const MatchingParams & matching_params) override; | ||
}; | ||
|
||
class AdvancedMatchingStrategy : public CollectorMatchingStrategy | ||
{ | ||
public: | ||
explicit AdvancedMatchingStrategy(rclcpp::Node & node, std::vector<std::string> input_topics); | ||
|
||
[[nodiscard]] std::optional<std::shared_ptr<CloudCollector>> match_cloud_to_collector( | ||
const std::list<std::shared_ptr<CloudCollector>> & cloud_collectors, | ||
const MatchingParams & params) const override; | ||
void set_collector_timestamp( | ||
std::shared_ptr<CloudCollector> & collector, const MatchingParams & matching_params) override; | ||
|
||
private: | ||
std::vector<std::string> input_topics_; | ||
std::unordered_map<std::string, double> topic_to_offset_map_; | ||
std::unordered_map<std::string, double> topic_to_noise_window_map_; | ||
}; | ||
|
||
std::shared_ptr<CollectorMatchingStrategy> parse_matching_strategy(rclcpp::Node & node); | ||
|
||
} // namespace autoware::pointcloud_preprocessor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.