-
Notifications
You must be signed in to change notification settings - Fork 675
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(autoware_control_evaluator): add new boundary_distance metrics (#…
…9984) * add boundary_distance metric Signed-off-by: xtk8532704 <[email protected]> * pre-commit Signed-off-by: xtk8532704 <[email protected]> * use path topic instead of lanenet. Signed-off-by: xtk8532704 <[email protected]> * remove unused import Signed-off-by: xtk8532704 <[email protected]> * apply is_point_left_of_line Signed-off-by: xtk8532704 <[email protected]> * fix typo Signed-off-by: xtk8532704 <[email protected]> * fix test bug Signed-off-by: xtk8532704 <[email protected]> * manual pre-commit Signed-off-by: xtk8532704 <[email protected]> --------- Signed-off-by: xtk8532704 <[email protected]> Co-authored-by: t4-adc <[email protected]>
- Loading branch information
1 parent
1a1a18a
commit bca9030
Showing
11 changed files
with
219 additions
and
26 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
2 changes: 1 addition & 1 deletion
2
...toware_control_evaluator/include/autoware/control_evaluator/metrics/deviation_metrics.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
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
62 changes: 62 additions & 0 deletions
62
...r/autoware_control_evaluator/include/autoware/control_evaluator/metrics/metrics_utils.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,62 @@ | ||
// Copyright 2025 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__CONTROL_EVALUATOR__METRICS__METRICS_UTILS_HPP_ | ||
#define AUTOWARE__CONTROL_EVALUATOR__METRICS__METRICS_UTILS_HPP_ | ||
|
||
#include <autoware/route_handler/route_handler.hpp> | ||
#include <autoware/universe_utils/geometry/boost_geometry.hpp> | ||
|
||
#include <vector> | ||
namespace control_diagnostics | ||
{ | ||
namespace metrics | ||
{ | ||
namespace utils | ||
{ | ||
using autoware::route_handler::RouteHandler; | ||
using geometry_msgs::msg::Point; | ||
using geometry_msgs::msg::Pose; | ||
|
||
/** | ||
* @brief Get the closest lanelets to the ego vehicle, considering shoulder lanelets. | ||
* @param [in] route_handler route handler | ||
* @param [in] ego_pose ego vehicle pose | ||
* @return closest lanelets to the ego vehicle | ||
**/ | ||
lanelet::ConstLanelets get_current_lanes(const RouteHandler & route_handler, const Pose & ego_pose); | ||
|
||
/** | ||
* @brief Calculate the Euler distance between the vehicle and the lanelet. | ||
* @param [in] vehicle_footprint vehicle footprint | ||
* @param [in] line lanelet line | ||
* @return distance between the vehicle footprint and the lanelet, 0.0 if the vehicle intersects | ||
*with the line | ||
**/ | ||
double calc_distance_to_line( | ||
const autoware::universe_utils::LinearRing2d & vehicle_footprint, | ||
const autoware::universe_utils::LineString2d & line); | ||
|
||
/** | ||
* @brief Check if the point is on the left side of the line. | ||
* @param [in] point point | ||
* @param [in] line line | ||
* @return true if the ego vehicle is on the left side of the lanelet line, false otherwise | ||
**/ | ||
bool is_point_left_of_line(const Point & point, const std::vector<Point> & line); | ||
|
||
} // namespace utils | ||
} // namespace metrics | ||
} // namespace control_diagnostics | ||
#endif // AUTOWARE__CONTROL_EVALUATOR__METRICS__METRICS_UTILS_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
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
2 changes: 1 addition & 1 deletion
2
evaluator/autoware_control_evaluator/src/metrics/deviation_metrics.cpp
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.