forked from autowarefoundation/autoware_universe
-
Notifications
You must be signed in to change notification settings - Fork 37
feat(trajectory_safety_filter): boundary departure prevention filter with diagnostics #2699
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
Merged
zulfaqar-azmi-t4
merged 8 commits into
feat/v0.48/e2e
from
cp-unmerged-commit-safety-filter-bdp
Feb 20, 2026
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d29b8f
fix: cherry-pick return optional commit
zulfaqar-azmi-t4 d7ebcb5
feat(trajectory_safety_filter): add diagnostic
zulfaqar-azmi-t4 00f724d
feat: boundary departure prevention safety filter
zulfaqar-azmi-t4 fc04813
feat: experimental bdp
zulfaqar-azmi-t4 d1c1ebe
fix: enabling bdp in debug mode
zulfaqar-azmi-t4 86d07f9
fix(boundary_departure): invalid swapped points
zulfaqar-azmi-t4 f7eac3a
fix: is debug more syntax
zulfaqar-azmi-t4 d4e55d1
fix: throttle debug message
zulfaqar-azmi-t4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
2 changes: 1 addition & 1 deletion
2
planning/autoware_trajectory_safety_filter/config/trajectory_safety_filter.param.yaml
This file contains hidden or 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 hidden or 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 hidden or 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
66 changes: 66 additions & 0 deletions
66
...clude/autoware/trajectory_safety_filter/filters/uncrossable_boundary_departure_filter.hpp
This file contains hidden or 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,66 @@ | ||
| // Copyright 2026 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. | ||
|
|
||
| #ifndef AUTOWARE__TRAJECTORY_SAFETY_FILTER__FILTERS__UNCROSSABLE_BOUNDARY_DEPARTURE_FILTER_HPP_ | ||
| #define AUTOWARE__TRAJECTORY_SAFETY_FILTER__FILTERS__UNCROSSABLE_BOUNDARY_DEPARTURE_FILTER_HPP_ | ||
|
|
||
| #include "autoware/trajectory_safety_filter/safety_filter_interface.hpp" | ||
|
|
||
| #include <autoware/boundary_departure_checker/uncrossable_boundary_departure_checker.hpp> | ||
| #include <rclcpp/rclcpp.hpp> | ||
|
|
||
| #include <any> | ||
| #include <memory> | ||
| #include <string> | ||
| #include <unordered_map> | ||
| namespace autoware::trajectory_safety_filter::plugin | ||
| { | ||
| class UncrossableBoundaryDepartureFilter : public SafetyFilterInterface | ||
| { | ||
| public: | ||
| UncrossableBoundaryDepartureFilter() : SafetyFilterInterface("UncrossableBoundaryDepartureFilter") | ||
| { | ||
| } | ||
|
|
||
| tl::expected<void, std::string> is_feasible( | ||
| const TrajectoryPoints & traj_points, const FilterContext & context) final; | ||
| void set_parameters( | ||
| [[maybe_unused]] const std::unordered_map<std::string, std::any> & params) final {}; | ||
|
|
||
| private: | ||
| std::unique_ptr<autoware::boundary_departure_checker::UncrossableBoundaryDepartureChecker> | ||
| uncrossable_boundary_departure_checker_ptr_; | ||
| rclcpp::Logger log_ = rclcpp::get_logger(name_); | ||
| std::shared_ptr<rclcpp::Clock> clock_ = std::make_shared<rclcpp::Clock>(RCL_SYSTEM_TIME); | ||
|
|
||
| [[nodiscard]] std::optional<std::string> is_invalid_input( | ||
| const TrajectoryPoints & traj_points, const FilterContext & context) const; | ||
|
|
||
| [[nodiscard]] bool is_debug_mode() const final { return true; } | ||
|
|
||
| template <typename... Args> | ||
| void warn_throttle(const char * fmt) | ||
| { | ||
| RCLCPP_WARN_THROTTLE(log_, *clock_, 5000, fmt); | ||
| } | ||
|
|
||
| template <typename... Args> | ||
| void warn_throttle(const char * fmt, Args... args) | ||
| { | ||
| RCLCPP_WARN_THROTTLE(log_, *clock_, 5000, fmt, args...); | ||
| } | ||
| }; | ||
| } // namespace autoware::trajectory_safety_filter::plugin | ||
|
|
||
| #endif // AUTOWARE__TRAJECTORY_SAFETY_FILTER__FILTERS__UNCROSSABLE_BOUNDARY_DEPARTURE_FILTER_HPP_ | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.