From 1b8243e45230b10c1e5d82d54eedc47d47da7b41 Mon Sep 17 00:00:00 2001 From: liuXinGangChina Date: Fri, 7 Mar 2025 10:39:51 +0800 Subject: [PATCH] feat(autoware_planning_factor_interface): porting autoware_planning_factor_interface, autoware_planning_factor_interface, remove from universe : v0.0 Signed-off-by: liuXinGangChina --- .../CHANGELOG.rst | 83 ------ .../CMakeLists.txt | 11 - .../README.md | 1 - .../planning_factor_interface.hpp | 242 ------------------ .../package.xml | 29 --- .../src/planing_factor_interface.cpp | 49 ---- 6 files changed, 415 deletions(-) delete mode 100644 planning/autoware_planning_factor_interface/CHANGELOG.rst delete mode 100644 planning/autoware_planning_factor_interface/CMakeLists.txt delete mode 100644 planning/autoware_planning_factor_interface/README.md delete mode 100644 planning/autoware_planning_factor_interface/include/autoware/planning_factor_interface/planning_factor_interface.hpp delete mode 100644 planning/autoware_planning_factor_interface/package.xml delete mode 100644 planning/autoware_planning_factor_interface/src/planing_factor_interface.cpp diff --git a/planning/autoware_planning_factor_interface/CHANGELOG.rst b/planning/autoware_planning_factor_interface/CHANGELOG.rst deleted file mode 100644 index 4783fab2e1b7b..0000000000000 --- a/planning/autoware_planning_factor_interface/CHANGELOG.rst +++ /dev/null @@ -1,83 +0,0 @@ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Changelog for package autoware_planning_factor_interface -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -0.42.0 (2025-03-03) -------------------- -* Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base -* feat(autoware_utils): replace autoware_universe_utils with autoware_utils (`#10191 `_) -* feat!: replace tier4_planning_msgs/PathWithLaneId with autoware_internal_planning_msgs/PathWithLaneId (`#10023 `_) -* Contributors: Fumiya Watanabe, Ryohsuke Mitsudome, 心刚 - -0.41.2 (2025-02-19) -------------------- -* chore: bump version to 0.41.1 (`#10088 `_) -* Contributors: Ryohsuke Mitsudome - -0.41.1 (2025-02-10) -------------------- - -0.41.0 (2025-01-29) -------------------- -* Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base -* chore(planning): move package directory for planning factor interface (`#9948 `_) - * chore: add new package for planning factor interface - * chore(surround_obstacle_checker): update include file - * chore(obstacle_stop_planner): update include file - * chore(obstacle_cruise_planner): update include file - * chore(motion_velocity_planner): update include file - * chore(bpp): update include file - * chore(bvp-common): update include file - * chore(blind_spot): update include file - * chore(crosswalk): update include file - * chore(detection_area): update include file - * chore(intersection): update include file - * chore(no_drivable_area): update include file - * chore(no_stopping_area): update include file - * chore(occlusion_spot): update include file - * chore(run_out): update include file - * chore(speed_bump): update include file - * chore(stop_line): update include file - * chore(template_module): update include file - * chore(traffic_light): update include file - * chore(vtl): update include file - * chore(walkway): update include file - * chore(motion_utils): remove factor interface - --------- -* Contributors: Fumiya Watanabe, Satoshi OTA - -* Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base -* chore(planning): move package directory for planning factor interface (`#9948 `_) - * chore: add new package for planning factor interface - * chore(surround_obstacle_checker): update include file - * chore(obstacle_stop_planner): update include file - * chore(obstacle_cruise_planner): update include file - * chore(motion_velocity_planner): update include file - * chore(bpp): update include file - * chore(bvp-common): update include file - * chore(blind_spot): update include file - * chore(crosswalk): update include file - * chore(detection_area): update include file - * chore(intersection): update include file - * chore(no_drivable_area): update include file - * chore(no_stopping_area): update include file - * chore(occlusion_spot): update include file - * chore(run_out): update include file - * chore(speed_bump): update include file - * chore(stop_line): update include file - * chore(template_module): update include file - * chore(traffic_light): update include file - * chore(vtl): update include file - * chore(walkway): update include file - * chore(motion_utils): remove factor interface - --------- -* Contributors: Fumiya Watanabe, Satoshi OTA - -0.40.0 (2025-01-06) -------------------- - -0.39.0 (2024-11-25) -------------------- - -0.38.0 (2024-11-11) -------------------- diff --git a/planning/autoware_planning_factor_interface/CMakeLists.txt b/planning/autoware_planning_factor_interface/CMakeLists.txt deleted file mode 100644 index 0c25a2c21fa19..0000000000000 --- a/planning/autoware_planning_factor_interface/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(autoware_planning_factor_interface) - -find_package(autoware_cmake REQUIRED) -autoware_package() - -ament_auto_add_library(autoware_planning_factor_interface SHARED - DIRECTORY src -) - -ament_auto_package() diff --git a/planning/autoware_planning_factor_interface/README.md b/planning/autoware_planning_factor_interface/README.md deleted file mode 100644 index 7f715790995ba..0000000000000 --- a/planning/autoware_planning_factor_interface/README.md +++ /dev/null @@ -1 +0,0 @@ -# planning factor interface diff --git a/planning/autoware_planning_factor_interface/include/autoware/planning_factor_interface/planning_factor_interface.hpp b/planning/autoware_planning_factor_interface/include/autoware/planning_factor_interface/planning_factor_interface.hpp deleted file mode 100644 index a88fdbb218cd4..0000000000000 --- a/planning/autoware_planning_factor_interface/include/autoware/planning_factor_interface/planning_factor_interface.hpp +++ /dev/null @@ -1,242 +0,0 @@ -// 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. - -#ifndef AUTOWARE__PLANNING_FACTOR_INTERFACE__PLANNING_FACTOR_INTERFACE_HPP_ -#define AUTOWARE__PLANNING_FACTOR_INTERFACE__PLANNING_FACTOR_INTERFACE_HPP_ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace autoware::planning_factor_interface -{ - -using autoware_internal_planning_msgs::msg::ControlPoint; -using autoware_internal_planning_msgs::msg::PlanningFactor; -using autoware_internal_planning_msgs::msg::PlanningFactorArray; -using autoware_internal_planning_msgs::msg::SafetyFactorArray; -using geometry_msgs::msg::Pose; - -class PlanningFactorInterface -{ -public: - PlanningFactorInterface(rclcpp::Node * node, const std::string & name) - : name_{name}, - pub_factors_{ - node->create_publisher("/planning/planning_factors/" + name, 1)}, - clock_{node->get_clock()} - { - } - - /** - * @brief factor setter for single control point. - * - * @param path points. - * @param ego current pose. - * @param control point pose. (e.g. stop or slow down point pose) - * @param behavior of this planning factor. - * @param safety factor. - * @param driving direction. - * @param target velocity of the control point. - * @param shift length of the control point. - * @param detail information. - */ - template - void add( - const std::vector & points, const Pose & ego_pose, const Pose & control_point_pose, - const uint16_t behavior, const SafetyFactorArray & safety_factors, - const bool is_driving_forward = true, const double velocity = 0.0, - const double shift_length = 0.0, const std::string & detail = "") - { - const auto distance = static_cast(autoware::motion_utils::calcSignedArcLength( - points, ego_pose.position, control_point_pose.position)); - add( - distance, control_point_pose, behavior, safety_factors, is_driving_forward, velocity, - shift_length, detail); - } - - /** - * @brief factor setter for two control points (section). - * - * @param path points. - * @param ego current pose. - * @param control section start pose. (e.g. lane change start point pose) - * @param control section end pose. (e.g. lane change end point pose) - * @param behavior of this planning factor. - * @param safety factor. - * @param driving direction. - * @param target velocity of the control point. - * @param shift length of the control point. - * @param detail information. - */ - template - void add( - const std::vector & points, const Pose & ego_pose, const Pose & start_pose, - const Pose & end_pose, const uint16_t behavior, const SafetyFactorArray & safety_factors, - const bool is_driving_forward = true, const double velocity = 0.0, - const double shift_length = 0.0, const std::string & detail = "") - { - const auto start_distance = static_cast( - autoware::motion_utils::calcSignedArcLength(points, ego_pose.position, start_pose.position)); - const auto end_distance = static_cast( - autoware::motion_utils::calcSignedArcLength(points, ego_pose.position, end_pose.position)); - add( - start_distance, end_distance, start_pose, end_pose, behavior, safety_factors, - is_driving_forward, velocity, shift_length, detail); - } - - /** - * @brief factor setter for single control point. - * - * @param distance to control point. - * @param control point pose. (e.g. stop point pose) - * @param behavior of this planning factor. - * @param safety factor. - * @param driving direction. - * @param target velocity of the control point. - * @param shift length of the control point. - * @param detail information. - */ - void add( - const double distance, const Pose & control_point_pose, const uint16_t behavior, - const SafetyFactorArray & safety_factors, const bool is_driving_forward = true, - const double velocity = 0.0, const double shift_length = 0.0, const std::string & detail = "") - { - const auto control_point = autoware_internal_planning_msgs::build() - .pose(control_point_pose) - .velocity(velocity) - .shift_length(shift_length) - .distance(distance); - - const auto factor = autoware_internal_planning_msgs::build() - .module(name_) - .is_driving_forward(is_driving_forward) - .control_points({control_point}) - .behavior(behavior) - .detail(detail) - .safety_factors(safety_factors); - - factors_.push_back(factor); - } - - /** - * @brief factor setter for two control points (section). - * - * @param distance to control section start point. - * @param distance to control section end point. - * @param control section start pose. (e.g. lane change start point pose) - * @param control section end pose. (e.g. lane change end point pose) - * @param behavior of this planning factor. - * @param safety factor. - * @param driving direction. - * @param target velocity of the control point. - * @param shift length of the control point. - * @param detail information. - */ - void add( - const double start_distance, const double end_distance, const Pose & start_pose, - const Pose & end_pose, const uint16_t behavior, const SafetyFactorArray & safety_factors, - const bool is_driving_forward = true, const double velocity = 0.0, - const double shift_length = 0.0, const std::string & detail = "") - { - const auto control_start_point = autoware_internal_planning_msgs::build() - .pose(start_pose) - .velocity(velocity) - .shift_length(shift_length) - .distance(start_distance); - - const auto control_end_point = autoware_internal_planning_msgs::build() - .pose(end_pose) - .velocity(velocity) - .shift_length(shift_length) - .distance(end_distance); - - const auto factor = autoware_internal_planning_msgs::build() - .module(name_) - .is_driving_forward(is_driving_forward) - .control_points({control_start_point, control_end_point}) - .behavior(behavior) - .detail(detail) - .safety_factors(safety_factors); - - factors_.push_back(factor); - } - - /** - * @brief publish planning factors. - */ - void publish() - { - PlanningFactorArray msg; - msg.header.frame_id = "map"; - msg.header.stamp = clock_->now(); - msg.factors = factors_; - - pub_factors_->publish(msg); - - factors_.clear(); - } - -private: - std::string name_; - - rclcpp::Publisher::SharedPtr pub_factors_; - - rclcpp::Clock::SharedPtr clock_; - - std::vector factors_; -}; - -extern template void -PlanningFactorInterface::add( - const std::vector &, const Pose &, - const Pose &, const uint16_t behavior, const SafetyFactorArray &, const bool, const double, - const double, const std::string &); -extern template void PlanningFactorInterface::add( - const std::vector &, const Pose &, const Pose &, - const uint16_t behavior, const SafetyFactorArray &, const bool, const double, const double, - const std::string &); -extern template void PlanningFactorInterface::add( - const std::vector &, const Pose &, const Pose &, - const uint16_t behavior, const SafetyFactorArray &, const bool, const double, const double, - const std::string &); - -extern template void -PlanningFactorInterface::add( - const std::vector &, const Pose &, - const Pose &, const Pose &, const uint16_t behavior, const SafetyFactorArray &, const bool, - const double, const double, const std::string &); -extern template void PlanningFactorInterface::add( - const std::vector &, const Pose &, const Pose &, - const Pose &, const uint16_t behavior, const SafetyFactorArray &, const bool, const double, - const double, const std::string &); -extern template void PlanningFactorInterface::add( - const std::vector &, const Pose &, const Pose &, - const Pose &, const uint16_t behavior, const SafetyFactorArray &, const bool, const double, - const double, const std::string &); - -} // namespace autoware::planning_factor_interface - -#endif // AUTOWARE__PLANNING_FACTOR_INTERFACE__PLANNING_FACTOR_INTERFACE_HPP_ diff --git a/planning/autoware_planning_factor_interface/package.xml b/planning/autoware_planning_factor_interface/package.xml deleted file mode 100644 index 286e465d12150..0000000000000 --- a/planning/autoware_planning_factor_interface/package.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - autoware_planning_factor_interface - 0.42.0 - The autoware_planning_factor_interface package - Satoshi Ota - Mamoru Sobue - Apache License 2.0 - - Satoshi Ota - - ament_cmake_auto - autoware_cmake - - autoware_internal_planning_msgs - autoware_motion_utils - autoware_planning_msgs - autoware_utils - rclcpp - - ament_cmake_ros - ament_lint_auto - autoware_lint_common - - - ament_cmake - - diff --git a/planning/autoware_planning_factor_interface/src/planing_factor_interface.cpp b/planning/autoware_planning_factor_interface/src/planing_factor_interface.cpp deleted file mode 100644 index de9a8b760198c..0000000000000 --- a/planning/autoware_planning_factor_interface/src/planing_factor_interface.cpp +++ /dev/null @@ -1,49 +0,0 @@ -// 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. - -#include - -#include -#include - -namespace autoware::planning_factor_interface -{ -template void -PlanningFactorInterface::add( - const std::vector &, const Pose &, - const Pose &, const uint16_t behavior, const SafetyFactorArray &, const bool, const double, - const double, const std::string &); -template void PlanningFactorInterface::add( - const std::vector &, const Pose &, const Pose &, - const uint16_t behavior, const SafetyFactorArray &, const bool, const double, const double, - const std::string &); -template void PlanningFactorInterface::add( - const std::vector &, const Pose &, const Pose &, - const uint16_t behavior, const SafetyFactorArray &, const bool, const double, const double, - const std::string &); - -template void -PlanningFactorInterface::add( - const std::vector &, const Pose &, - const Pose &, const Pose &, const uint16_t behavior, const SafetyFactorArray &, const bool, - const double, const double, const std::string &); -template void PlanningFactorInterface::add( - const std::vector &, const Pose &, const Pose &, - const Pose &, const uint16_t behavior, const SafetyFactorArray &, const bool, const double, - const double, const std::string &); -template void PlanningFactorInterface::add( - const std::vector &, const Pose &, const Pose &, - const Pose &, const uint16_t behavior, const SafetyFactorArray &, const bool, const double, - const double, const std::string &); -} // namespace autoware::planning_factor_interface