diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index dc745760cb7d0..4c01604c51ee4 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -156,6 +156,7 @@ perception/traffic_light_multi_camera_fusion/** shunsuke.miura@tier4.jp tao.zhon perception/traffic_light_occlusion_predictor/** shunsuke.miura@tier4.jp tao.zhong@tier4.jp perception/traffic_light_visualization/** tao.zhong@tier4.jp yukihiro.saito@tier4.jp planning/autoware_remaining_distance_time_calculator/** ahmed.ebrahim@leodrive.ai +planning/autoware_static_centerline_generator/** kosuke.takeuchi@tier4.jp takayuki.murooka@tier4.jp planning/behavior_path_avoidance_by_lane_change_module/** fumiya.watanabe@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp zulfaqar.azmi@tier4.jp planning/behavior_path_avoidance_module/** fumiya.watanabe@tier4.jp go.sakayori@tier4.jp kyoichi.sugahara@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp takamasa.horibe@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp zulfaqar.azmi@tier4.jp planning/behavior_path_dynamic_avoidance_module/** kosuke.takeuchi@tier4.jp satoshi.ota@tier4.jp takayuki.murooka@tier4.jp yuki.takagi@tier4.jp @@ -208,7 +209,6 @@ planning/sampling_based_planner/frenet_planner/** maxime.clement@tier4.jp planning/sampling_based_planner/path_sampler/** maxime.clement@tier4.jp planning/sampling_based_planner/sampler_common/** maxime.clement@tier4.jp planning/scenario_selector/** fumiya.watanabe@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp -planning/static_centerline_generator/** kosuke.takeuchi@tier4.jp takayuki.murooka@tier4.jp planning/surround_obstacle_checker/** satoshi.ota@tier4.jp sensing/gnss_poser/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp koji.minoda@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp sensing/image_diagnostics/** dai.nguyen@tier4.jp yoshi.ri@tier4.jp diff --git a/planning/.pages b/planning/.pages index 942a5a0b32158..645a32b4b05fa 100644 --- a/planning/.pages +++ b/planning/.pages @@ -67,7 +67,7 @@ nav: - 'About Motion Velocity Smoother': planning/motion_velocity_smoother - 'About Motion Velocity Smoother (Japanese)': planning/motion_velocity_smoother/README.ja - 'Scenario Selector': planning/scenario_selector - - 'Static Centerline Generator': planning/static_centerline_generator + - 'Static Centerline Generator': planning/autoware_static_centerline_generator - 'API and Library': - 'Costmap Generator': planning/costmap_generator - 'External Velocity Limit Selector': planning/external_velocity_limit_selector diff --git a/planning/static_centerline_generator/CMakeLists.txt b/planning/autoware_static_centerline_generator/CMakeLists.txt similarity index 78% rename from planning/static_centerline_generator/CMakeLists.txt rename to planning/autoware_static_centerline_generator/CMakeLists.txt index 991d12097cc08..08a97c9010008 100644 --- a/planning/static_centerline_generator/CMakeLists.txt +++ b/planning/autoware_static_centerline_generator/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.14) -project(static_centerline_generator) +project(autoware_static_centerline_generator) find_package(autoware_cmake REQUIRED) @@ -9,7 +9,7 @@ find_package(rosidl_default_generators REQUIRED) find_package(std_msgs REQUIRED) rosidl_generate_interfaces( - static_centerline_generator + autoware_static_centerline_generator "srv/LoadMap.srv" "srv/PlanRoute.srv" "srv/PlanPath.srv" @@ -29,10 +29,10 @@ ament_auto_add_executable(main if(${rosidl_cmake_VERSION} VERSION_LESS 2.5.0) rosidl_target_interfaces(main - static_centerline_generator "rosidl_typesupport_cpp") + autoware_static_centerline_generator "rosidl_typesupport_cpp") else() rosidl_get_typesupport_target( - cpp_typesupport_target static_centerline_generator "rosidl_typesupport_cpp") + cpp_typesupport_target autoware_static_centerline_generator "rosidl_typesupport_cpp") target_link_libraries(main "${cpp_typesupport_target}") endif() @@ -43,6 +43,10 @@ ament_auto_package( rviz ) +target_include_directories(main PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/src +) + if(BUILD_TESTING) add_launch_test( test/test_static_centerline_generator.test.py diff --git a/planning/static_centerline_generator/README.md b/planning/autoware_static_centerline_generator/README.md similarity index 88% rename from planning/static_centerline_generator/README.md rename to planning/autoware_static_centerline_generator/README.md index 00572b754645c..844d0af15f2a5 100644 --- a/planning/static_centerline_generator/README.md +++ b/planning/autoware_static_centerline_generator/README.md @@ -34,7 +34,7 @@ We can run with the following command by designating `` ```sh -ros2 launch static_centerline_generator run_planning_server.launch.xml vehicle_model:= +ros2 launch autoware_static_centerline_generator run_planning_server.launch.xml vehicle_model:= ``` FYI, port ID of the http server is 4010 by default. @@ -50,7 +50,7 @@ The optimized centerline can be generated from the command line interface by des - `` ```sh -ros2 launch static_centerline_generator static_centerline_generator.launch.xml run_backgrond:=false lanelet2_input_file_path:= lanelet2_output_file_path:= start_lanelet_id:= end_lanelet_id:= vehicle_model:= +ros2 launch autoware_static_centerline_generator static_centerline_generator.launch.xml run_backgrond:=false lanelet2_input_file_path:= lanelet2_output_file_path:= start_lanelet_id:= end_lanelet_id:= vehicle_model:= ``` The default output map path containing the optimized centerline locates `/tmp/lanelet2_map.osm`. diff --git a/planning/static_centerline_generator/config/common.param.yaml b/planning/autoware_static_centerline_generator/config/common.param.yaml similarity index 100% rename from planning/static_centerline_generator/config/common.param.yaml rename to planning/autoware_static_centerline_generator/config/common.param.yaml diff --git a/planning/static_centerline_generator/config/nearest_search.param.yaml b/planning/autoware_static_centerline_generator/config/nearest_search.param.yaml similarity index 100% rename from planning/static_centerline_generator/config/nearest_search.param.yaml rename to planning/autoware_static_centerline_generator/config/nearest_search.param.yaml diff --git a/planning/static_centerline_generator/config/static_centerline_generator.param.yaml b/planning/autoware_static_centerline_generator/config/static_centerline_generator.param.yaml similarity index 100% rename from planning/static_centerline_generator/config/static_centerline_generator.param.yaml rename to planning/autoware_static_centerline_generator/config/static_centerline_generator.param.yaml diff --git a/planning/static_centerline_generator/config/vehicle_info.param.yaml b/planning/autoware_static_centerline_generator/config/vehicle_info.param.yaml similarity index 100% rename from planning/static_centerline_generator/config/vehicle_info.param.yaml rename to planning/autoware_static_centerline_generator/config/vehicle_info.param.yaml diff --git a/planning/static_centerline_generator/launch/run_planning_server.launch.xml b/planning/autoware_static_centerline_generator/launch/run_planning_server.launch.xml similarity index 53% rename from planning/static_centerline_generator/launch/run_planning_server.launch.xml rename to planning/autoware_static_centerline_generator/launch/run_planning_server.launch.xml index 1493078317458..cb368ca336316 100644 --- a/planning/static_centerline_generator/launch/run_planning_server.launch.xml +++ b/planning/autoware_static_centerline_generator/launch/run_planning_server.launch.xml @@ -2,11 +2,11 @@ - + - + diff --git a/planning/static_centerline_generator/launch/static_centerline_generator.launch.xml b/planning/autoware_static_centerline_generator/launch/static_centerline_generator.launch.xml similarity index 93% rename from planning/static_centerline_generator/launch/static_centerline_generator.launch.xml rename to planning/autoware_static_centerline_generator/launch/static_centerline_generator.launch.xml index ae71b0ae6e925..2a2fbe4340fa8 100644 --- a/planning/static_centerline_generator/launch/static_centerline_generator.launch.xml +++ b/planning/autoware_static_centerline_generator/launch/static_centerline_generator.launch.xml @@ -55,7 +55,7 @@ - + @@ -79,11 +79,11 @@ - + - + diff --git a/planning/static_centerline_generator/media/rviz.png b/planning/autoware_static_centerline_generator/media/rviz.png similarity index 100% rename from planning/static_centerline_generator/media/rviz.png rename to planning/autoware_static_centerline_generator/media/rviz.png diff --git a/planning/static_centerline_generator/media/unsafe_footprints.png b/planning/autoware_static_centerline_generator/media/unsafe_footprints.png similarity index 100% rename from planning/static_centerline_generator/media/unsafe_footprints.png rename to planning/autoware_static_centerline_generator/media/unsafe_footprints.png diff --git a/planning/static_centerline_generator/msg/PointsWithLaneId.msg b/planning/autoware_static_centerline_generator/msg/PointsWithLaneId.msg similarity index 100% rename from planning/static_centerline_generator/msg/PointsWithLaneId.msg rename to planning/autoware_static_centerline_generator/msg/PointsWithLaneId.msg diff --git a/planning/static_centerline_generator/package.xml b/planning/autoware_static_centerline_generator/package.xml similarity index 93% rename from planning/static_centerline_generator/package.xml rename to planning/autoware_static_centerline_generator/package.xml index 6573f6e439c43..96e17595d49ee 100644 --- a/planning/static_centerline_generator/package.xml +++ b/planning/autoware_static_centerline_generator/package.xml @@ -1,9 +1,9 @@ - static_centerline_generator + autoware_static_centerline_generator 0.1.0 - The static_centerline_generator package + The autoware_static_centerline_generator package Takayuki Murooka Kosuke Takeuchi Apache License 2.0 diff --git a/planning/static_centerline_generator/rviz/static_centerline_generator.rviz b/planning/autoware_static_centerline_generator/rviz/static_centerline_generator.rviz similarity index 97% rename from planning/static_centerline_generator/rviz/static_centerline_generator.rviz rename to planning/autoware_static_centerline_generator/rviz/static_centerline_generator.rviz index 62b4c9b75ec87..002af580c2f00 100644 --- a/planning/static_centerline_generator/rviz/static_centerline_generator.rviz +++ b/planning/autoware_static_centerline_generator/rviz/static_centerline_generator.rviz @@ -130,7 +130,7 @@ Visualization Manager: Filter size: 10 History Policy: Keep Last Reliability Policy: Reliable - Value: /static_centerline_generator/input_centerline + Value: /autoware_static_centerline_generator/input_centerline Value: true View Drivable Area: Alpha: 0.9990000128746033 @@ -179,7 +179,7 @@ Visualization Manager: Filter size: 10 History Policy: Keep Last Reliability Policy: Reliable - Value: /static_centerline_generator/output_centerline + Value: /autoware_static_centerline_generator/output_centerline Value: true View Footprint: Alpha: 1 @@ -222,7 +222,7 @@ Visualization Manager: Filter size: 10 History Policy: Keep Last Reliability Policy: Reliable - Value: /static_centerline_generator/debug/raw_centerline + Value: /autoware_static_centerline_generator/debug/raw_centerline Value: false View Drivable Area: Alpha: 0.9990000128746033 @@ -268,7 +268,7 @@ Visualization Manager: Durability Policy: Transient Local History Policy: Keep Last Reliability Policy: Reliable - Value: /static_centerline_generator/debug/unsafe_footprints + Value: /autoware_static_centerline_generator/debug/unsafe_footprints Value: true Enabled: false Name: debug diff --git a/planning/static_centerline_generator/scripts/app.py b/planning/autoware_static_centerline_generator/scripts/app.py similarity index 91% rename from planning/static_centerline_generator/scripts/app.py rename to planning/autoware_static_centerline_generator/scripts/app.py index c1cb0473da040..f37737a0de4e4 100755 --- a/planning/static_centerline_generator/scripts/app.py +++ b/planning/autoware_static_centerline_generator/scripts/app.py @@ -17,15 +17,15 @@ import json import uuid +from autoware_static_centerline_generator.srv import LoadMap +from autoware_static_centerline_generator.srv import PlanPath +from autoware_static_centerline_generator.srv import PlanRoute from flask import Flask from flask import jsonify from flask import request from flask_cors import CORS import rclpy from rclpy.node import Node -from static_centerline_generator.srv import LoadMap -from static_centerline_generator.srv import PlanPath -from static_centerline_generator.srv import PlanRoute rclpy.init() node = Node("static_centerline_generator_http_server") @@ -51,7 +51,7 @@ def get_map(): map_id = map_uuid # create client - cli = create_client(LoadMap, "/planning/static_centerline_generator/load_map") + cli = create_client(LoadMap, "/planning/autoware_static_centerline_generator/load_map") # request map loading req = LoadMap.Request(map=data["map"]) @@ -85,7 +85,7 @@ def post_planned_route(): print("map_id is not correct.") # create client - cli = create_client(PlanRoute, "/planning/static_centerline_generator/plan_route") + cli = create_client(PlanRoute, "/planning/autoware_static_centerline_generator/plan_route") # request route planning req = PlanRoute.Request( @@ -123,7 +123,7 @@ def post_planned_path(): print("map_id is not correct.") # create client - cli = create_client(PlanPath, "/planning/static_centerline_generator/plan_path") + cli = create_client(PlanPath, "/planning/autoware_static_centerline_generator/plan_path") # request path planning route_lane_ids = [eval(i) for i in request.args.getlist("route[]")] diff --git a/planning/static_centerline_generator/scripts/centerline_updater_helper.py b/planning/autoware_static_centerline_generator/scripts/centerline_updater_helper.py similarity index 98% rename from planning/static_centerline_generator/scripts/centerline_updater_helper.py rename to planning/autoware_static_centerline_generator/scripts/centerline_updater_helper.py index fec3d21d20bec..cec4e5b457c7f 100755 --- a/planning/static_centerline_generator/scripts/centerline_updater_helper.py +++ b/planning/autoware_static_centerline_generator/scripts/centerline_updater_helper.py @@ -155,7 +155,7 @@ def __init__(self): transient_local_qos = QoSProfile(depth=1, durability=QoSDurabilityPolicy.TRANSIENT_LOCAL) self.sub_whole_centerline = self.create_subscription( Trajectory, - "/static_centerline_generator/output_whole_centerline", + "/autoware_static_centerline_generator/output_whole_centerline", self.onWholeCenterline, transient_local_qos, ) diff --git a/planning/static_centerline_generator/scripts/show_lanelet2_map_diff.py b/planning/autoware_static_centerline_generator/scripts/show_lanelet2_map_diff.py similarity index 94% rename from planning/static_centerline_generator/scripts/show_lanelet2_map_diff.py rename to planning/autoware_static_centerline_generator/scripts/show_lanelet2_map_diff.py index 912226511f1d9..00d06ca2213d1 100755 --- a/planning/static_centerline_generator/scripts/show_lanelet2_map_diff.py +++ b/planning/autoware_static_centerline_generator/scripts/show_lanelet2_map_diff.py @@ -98,8 +98,8 @@ def remove_diff_to_ignore(osm_root): ) args = parser.parse_args() - original_osm_file_name = "/tmp/static_centerline_generator/input/lanelet2_map.osm" - modified_osm_file_name = "/tmp/static_centerline_generator/output/lanelet2_map.osm" + original_osm_file_name = "/tmp/autoware_static_centerline_generator/input/lanelet2_map.osm" + modified_osm_file_name = "/tmp/autoware_static_centerline_generator/output/lanelet2_map.osm" # load LL2 maps original_osm_tree = ET.parse(original_osm_file_name) @@ -118,7 +118,7 @@ def remove_diff_to_ignore(osm_root): remove_diff_to_ignore(modified_osm_root) # write LL2 maps - output_dir_path = "/tmp/static_centerline_generator/show_lanelet2_map_diff/" + output_dir_path = "/tmp/autoware_static_centerline_generator/show_lanelet2_map_diff/" os.makedirs(output_dir_path + "original/", exist_ok=True) os.makedirs(output_dir_path + "modified/", exist_ok=True) diff --git a/planning/autoware_static_centerline_generator/scripts/tmp/bag_ego_trajectory_based_centerline.sh b/planning/autoware_static_centerline_generator/scripts/tmp/bag_ego_trajectory_based_centerline.sh new file mode 100755 index 0000000000000..e7f86062a9d20 --- /dev/null +++ b/planning/autoware_static_centerline_generator/scripts/tmp/bag_ego_trajectory_based_centerline.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ros2 launch autoware_static_centerline_generator static_centerline_generator.launch.xml centerline_source:="bag_ego_trajectory_base" run_background:=false lanelet2_input_file_path:="$HOME/autoware_map/sample_map/lanelet2_map.osm" bag_filename:="$(ros2 pkg prefix autoware_static_centerline_generator --share)/test/data/bag_ego_trajectory.db3" vehicle_model:=lexus diff --git a/planning/autoware_static_centerline_generator/scripts/tmp/optimization_trajectory_based_centerline.sh b/planning/autoware_static_centerline_generator/scripts/tmp/optimization_trajectory_based_centerline.sh new file mode 100755 index 0000000000000..488091989d1fa --- /dev/null +++ b/planning/autoware_static_centerline_generator/scripts/tmp/optimization_trajectory_based_centerline.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ros2 launch autoware_static_centerline_generator static_centerline_generator.launch.xml centerline_source:="optimization_trajectory_base" run_background:=false lanelet2_input_file_path:="$HOME/autoware_map/sample_map/lanelet2_map.osm" start_lanelet_id:=125 end_lanelet_id:=132 vehicle_model:=lexus diff --git a/planning/static_centerline_generator/src/centerline_source/bag_ego_trajectory_based_centerline.cpp b/planning/autoware_static_centerline_generator/src/centerline_source/bag_ego_trajectory_based_centerline.cpp similarity index 91% rename from planning/static_centerline_generator/src/centerline_source/bag_ego_trajectory_based_centerline.cpp rename to planning/autoware_static_centerline_generator/src/centerline_source/bag_ego_trajectory_based_centerline.cpp index 4e541b1aff527..447773d7a6535 100644 --- a/planning/static_centerline_generator/src/centerline_source/bag_ego_trajectory_based_centerline.cpp +++ b/planning/autoware_static_centerline_generator/src/centerline_source/bag_ego_trajectory_based_centerline.cpp @@ -12,15 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "static_centerline_generator/centerline_source/bag_ego_trajectory_based_centerline.hpp" +#include "centerline_source/bag_ego_trajectory_based_centerline.hpp" #include "rclcpp/serialization.hpp" #include "rosbag2_cpp/reader.hpp" -#include "static_centerline_generator/static_centerline_generator_node.hpp" +#include "static_centerline_generator_node.hpp" #include -namespace static_centerline_generator +#include +#include + +namespace autoware::static_centerline_generator { std::vector generate_centerline_with_bag(rclcpp::Node & node) { @@ -79,4 +82,4 @@ std::vector generate_centerline_with_bag(rclcpp::Node & node) return centerline_traj_points; } -} // namespace static_centerline_generator +} // namespace autoware::static_centerline_generator diff --git a/planning/static_centerline_generator/include/static_centerline_generator/centerline_source/bag_ego_trajectory_based_centerline.hpp b/planning/autoware_static_centerline_generator/src/centerline_source/bag_ego_trajectory_based_centerline.hpp similarity index 62% rename from planning/static_centerline_generator/include/static_centerline_generator/centerline_source/bag_ego_trajectory_based_centerline.hpp rename to planning/autoware_static_centerline_generator/src/centerline_source/bag_ego_trajectory_based_centerline.hpp index 30b2e55c36bba..2275f88184c6f 100644 --- a/planning/static_centerline_generator/include/static_centerline_generator/centerline_source/bag_ego_trajectory_based_centerline.hpp +++ b/planning/autoware_static_centerline_generator/src/centerline_source/bag_ego_trajectory_based_centerline.hpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_ -#define STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_ +#ifndef CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_ +#define CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_ #include "rclcpp/rclcpp.hpp" -#include "static_centerline_generator/type_alias.hpp" +#include "type_alias.hpp" #include -namespace static_centerline_generator +namespace autoware::static_centerline_generator { std::vector generate_centerline_with_bag(rclcpp::Node & node); -} // namespace static_centerline_generator -#endif // STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_ +} // namespace autoware::static_centerline_generator +#endif // CENTERLINE_SOURCE__BAG_EGO_TRAJECTORY_BASED_CENTERLINE_HPP_ diff --git a/planning/static_centerline_generator/src/centerline_source/optimization_trajectory_based_centerline.cpp b/planning/autoware_static_centerline_generator/src/centerline_source/optimization_trajectory_based_centerline.cpp similarity index 95% rename from planning/static_centerline_generator/src/centerline_source/optimization_trajectory_based_centerline.cpp rename to planning/autoware_static_centerline_generator/src/centerline_source/optimization_trajectory_based_centerline.cpp index 7980ae4e8d2d7..2825381937674 100644 --- a/planning/static_centerline_generator/src/centerline_source/optimization_trajectory_based_centerline.cpp +++ b/planning/autoware_static_centerline_generator/src/centerline_source/optimization_trajectory_based_centerline.cpp @@ -12,17 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "static_centerline_generator/centerline_source/optimization_trajectory_based_centerline.hpp" +#include "centerline_source/optimization_trajectory_based_centerline.hpp" #include "motion_utils/resample/resample.hpp" #include "motion_utils/trajectory/conversion.hpp" #include "obstacle_avoidance_planner/node.hpp" #include "path_smoother/elastic_band_smoother.hpp" -#include "static_centerline_generator/static_centerline_generator_node.hpp" -#include "static_centerline_generator/utils.hpp" +#include "static_centerline_generator_node.hpp" #include "tier4_autoware_utils/ros/parameter.hpp" +#include "utils.hpp" -namespace static_centerline_generator +#include + +namespace autoware::static_centerline_generator { namespace { @@ -180,4 +182,4 @@ std::vector OptimizationTrajectoryBasedCenterline::optimize_tra return whole_optimized_traj_points; } -} // namespace static_centerline_generator +} // namespace autoware::static_centerline_generator diff --git a/planning/static_centerline_generator/include/static_centerline_generator/centerline_source/optimization_trajectory_based_centerline.hpp b/planning/autoware_static_centerline_generator/src/centerline_source/optimization_trajectory_based_centerline.hpp similarity index 72% rename from planning/static_centerline_generator/include/static_centerline_generator/centerline_source/optimization_trajectory_based_centerline.hpp rename to planning/autoware_static_centerline_generator/src/centerline_source/optimization_trajectory_based_centerline.hpp index 7e7cdea31e9f1..88def6fa7bd4c 100644 --- a/planning/static_centerline_generator/include/static_centerline_generator/centerline_source/optimization_trajectory_based_centerline.hpp +++ b/planning/autoware_static_centerline_generator/src/centerline_source/optimization_trajectory_based_centerline.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT -#define STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT +#ifndef CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT +#define CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT #include "rclcpp/rclcpp.hpp" -#include "static_centerline_generator/type_alias.hpp" +#include "type_alias.hpp" #include -namespace static_centerline_generator +namespace autoware::static_centerline_generator { class OptimizationTrajectoryBasedCenterline { @@ -37,7 +37,7 @@ class OptimizationTrajectoryBasedCenterline rclcpp::Publisher::SharedPtr pub_raw_path_with_lane_id_{nullptr}; rclcpp::Publisher::SharedPtr pub_raw_path_{nullptr}; }; -} // namespace static_centerline_generator +} // namespace autoware::static_centerline_generator // clang-format off -#endif // STATIC_CENTERLINE_GENERATOR__CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT +#endif // CENTERLINE_SOURCE__OPTIMIZATION_TRAJECTORY_BASED_CENTERLINE_HPP_ // NOLINT // clang-format on diff --git a/planning/static_centerline_generator/src/main.cpp b/planning/autoware_static_centerline_generator/src/main.cpp similarity index 85% rename from planning/static_centerline_generator/src/main.cpp rename to planning/autoware_static_centerline_generator/src/main.cpp index 981cf54fc9274..9f52f271cd5e5 100644 --- a/planning/static_centerline_generator/src/main.cpp +++ b/planning/autoware_static_centerline_generator/src/main.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "static_centerline_generator/static_centerline_generator_node.hpp" +#include "static_centerline_generator_node.hpp" int main(int argc, char * argv[]) { @@ -21,7 +21,8 @@ int main(int argc, char * argv[]) // initialize node rclcpp::NodeOptions node_options; auto node = - std::make_shared(node_options); + std::make_shared( + node_options); // get ros parameter const bool run_background = node->declare_parameter("run_background"); diff --git a/planning/static_centerline_generator/src/static_centerline_generator_node.cpp b/planning/autoware_static_centerline_generator/src/static_centerline_generator_node.cpp similarity index 95% rename from planning/static_centerline_generator/src/static_centerline_generator_node.cpp rename to planning/autoware_static_centerline_generator/src/static_centerline_generator_node.cpp index ec24f47dacc27..8388bb61748f1 100644 --- a/planning/static_centerline_generator/src/static_centerline_generator_node.cpp +++ b/planning/autoware_static_centerline_generator/src/static_centerline_generator_node.cpp @@ -12,8 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "static_centerline_generator/static_centerline_generator_node.hpp" +#include "static_centerline_generator_node.hpp" +#include "autoware_static_centerline_generator/msg/points_with_lane_id.hpp" +#include "centerline_source/bag_ego_trajectory_based_centerline.hpp" #include "lanelet2_extension/utility/message_conversion.hpp" #include "lanelet2_extension/utility/query.hpp" #include "lanelet2_extension/utility/utilities.hpp" @@ -21,12 +23,10 @@ #include "map_projection_loader/load_info_from_lanelet2_map.hpp" #include "motion_utils/resample/resample.hpp" #include "motion_utils/trajectory/conversion.hpp" -#include "static_centerline_generator/centerline_source/bag_ego_trajectory_based_centerline.hpp" -#include "static_centerline_generator/msg/points_with_lane_id.hpp" -#include "static_centerline_generator/type_alias.hpp" -#include "static_centerline_generator/utils.hpp" #include "tier4_autoware_utils/geometry/geometry.hpp" #include "tier4_autoware_utils/ros/parameter.hpp" +#include "type_alias.hpp" +#include "utils.hpp" #include #include @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -54,7 +55,7 @@ #include #include -namespace static_centerline_generator +namespace autoware::static_centerline_generator { namespace { @@ -168,7 +169,7 @@ std::vector resample_trajectory_points( StaticCenterlineGeneratorNode::StaticCenterlineGeneratorNode( const rclcpp::NodeOptions & node_options) -: Node("static_centerline_generator", node_options) +: Node("autoware_static_centerline_generator", node_options) { // publishers pub_map_bin_ = @@ -216,19 +217,19 @@ StaticCenterlineGeneratorNode::StaticCenterlineGeneratorNode( // services callback_group_ = create_callback_group(rclcpp::CallbackGroupType::MutuallyExclusive); srv_load_map_ = create_service( - "/planning/static_centerline_generator/load_map", + "/planning/autoware_static_centerline_generator/load_map", std::bind( &StaticCenterlineGeneratorNode::on_load_map, this, std::placeholders::_1, std::placeholders::_2), rmw_qos_profile_services_default, callback_group_); srv_plan_route_ = create_service( - "/planning/static_centerline_generator/plan_route", + "/planning/autoware_static_centerline_generator/plan_route", std::bind( &StaticCenterlineGeneratorNode::on_plan_route, this, std::placeholders::_1, std::placeholders::_2), rmw_qos_profile_services_default, callback_group_); srv_plan_path_ = create_service( - "/planning/static_centerline_generator/plan_path", + "/planning/autoware_static_centerline_generator/plan_path", std::bind( &StaticCenterlineGeneratorNode::on_plan_path, this, std::placeholders::_1, std::placeholders::_2), @@ -246,7 +247,7 @@ StaticCenterlineGeneratorNode::StaticCenterlineGeneratorNode( return CenterlineSource::BagEgoTrajectoryBase; } throw std::logic_error( - "The centerline source is not supported in static_centerline_generator."); + "The centerline source is not supported in autoware_static_centerline_generator."); }(); } @@ -319,7 +320,7 @@ CenterlineWithRoute StaticCenterlineGeneratorNode::generate_centerline_with_rout return CenterlineWithRoute{bag_centerline, route_lane_ids}; } throw std::logic_error( - "The centerline source is not supported in static_centerline_generator."); + "The centerline source is not supported in autoware_static_centerline_generator."); }(); // resample @@ -339,7 +340,7 @@ CenterlineWithRoute StaticCenterlineGeneratorNode::generate_centerline_with_rout void StaticCenterlineGeneratorNode::load_map(const std::string & lanelet2_input_file_path) { // copy the input LL2 map to the temporary file for debugging - const std::string debug_input_file_dir{"/tmp/static_centerline_generator/input/"}; + const std::string debug_input_file_dir{"/tmp/autoware_static_centerline_generator/input/"}; std::filesystem::create_directories(debug_input_file_dir); std::filesystem::copy( lanelet2_input_file_path, debug_input_file_dir + "lanelet2_map.osm", @@ -542,7 +543,7 @@ void StaticCenterlineGeneratorNode::on_plan_path( if (!current_lanelet_points.empty()) { // register points with lane_id - static_centerline_generator::msg::PointsWithLaneId points_with_lane_id; + autoware_static_centerline_generator::msg::PointsWithLaneId points_with_lane_id; points_with_lane_id.lane_id = lanelet.id(); points_with_lane_id.points = current_lanelet_points; response->points_with_lane_ids.push_back(points_with_lane_id); @@ -646,10 +647,10 @@ void StaticCenterlineGeneratorNode::save_map( RCLCPP_INFO(get_logger(), "Saved map."); // copy the output LL2 map to the temporary file for debugging - const std::string debug_output_file_dir{"/tmp/static_centerline_generator/output/"}; + const std::string debug_output_file_dir{"/tmp/autoware_static_centerline_generator/output/"}; std::filesystem::create_directories(debug_output_file_dir); std::filesystem::copy( lanelet2_output_file_path, debug_output_file_dir + "lanelet2_map.osm", std::filesystem::copy_options::overwrite_existing); } -} // namespace static_centerline_generator +} // namespace autoware::static_centerline_generator diff --git a/planning/static_centerline_generator/include/static_centerline_generator/static_centerline_generator_node.hpp b/planning/autoware_static_centerline_generator/src/static_centerline_generator_node.hpp similarity index 82% rename from planning/static_centerline_generator/include/static_centerline_generator/static_centerline_generator_node.hpp rename to planning/autoware_static_centerline_generator/src/static_centerline_generator_node.hpp index c1d92c06a8e05..9baa1c3fbb892 100644 --- a/planning/static_centerline_generator/include/static_centerline_generator/static_centerline_generator_node.hpp +++ b/planning/autoware_static_centerline_generator/src/static_centerline_generator_node.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef STATIC_CENTERLINE_GENERATOR__STATIC_CENTERLINE_GENERATOR_NODE_HPP_ -#define STATIC_CENTERLINE_GENERATOR__STATIC_CENTERLINE_GENERATOR_NODE_HPP_ +#ifndef STATIC_CENTERLINE_GENERATOR_NODE_HPP_ +#define STATIC_CENTERLINE_GENERATOR_NODE_HPP_ +#include "autoware_static_centerline_generator/srv/load_map.hpp" +#include "autoware_static_centerline_generator/srv/plan_path.hpp" +#include "autoware_static_centerline_generator/srv/plan_route.hpp" +#include "centerline_source/optimization_trajectory_based_centerline.hpp" #include "rclcpp/rclcpp.hpp" -#include "static_centerline_generator/centerline_source/optimization_trajectory_based_centerline.hpp" -#include "static_centerline_generator/srv/load_map.hpp" -#include "static_centerline_generator/srv/plan_path.hpp" -#include "static_centerline_generator/srv/plan_route.hpp" -#include "static_centerline_generator/type_alias.hpp" +#include "type_alias.hpp" #include "vehicle_info_util/vehicle_info_util.hpp" #include @@ -34,11 +34,11 @@ #include #include -namespace static_centerline_generator +namespace autoware::static_centerline_generator { -using static_centerline_generator::srv::LoadMap; -using static_centerline_generator::srv::PlanPath; -using static_centerline_generator::srv::PlanRoute; +using autoware_static_centerline_generator::srv::LoadMap; +using autoware_static_centerline_generator::srv::PlanPath; +using autoware_static_centerline_generator::srv::PlanRoute; struct CenterlineWithRoute { @@ -115,5 +115,5 @@ class StaticCenterlineGeneratorNode : public rclcpp::Node // vehicle info vehicle_info_util::VehicleInfo vehicle_info_; }; -} // namespace static_centerline_generator -#endif // STATIC_CENTERLINE_GENERATOR__STATIC_CENTERLINE_GENERATOR_NODE_HPP_ +} // namespace autoware::static_centerline_generator +#endif // STATIC_CENTERLINE_GENERATOR_NODE_HPP_ diff --git a/planning/static_centerline_generator/include/static_centerline_generator/type_alias.hpp b/planning/autoware_static_centerline_generator/src/type_alias.hpp similarity index 87% rename from planning/static_centerline_generator/include/static_centerline_generator/type_alias.hpp rename to planning/autoware_static_centerline_generator/src/type_alias.hpp index 2dcb9cbbd099f..fb54804db105d 100644 --- a/planning/static_centerline_generator/include/static_centerline_generator/type_alias.hpp +++ b/planning/autoware_static_centerline_generator/src/type_alias.hpp @@ -11,8 +11,8 @@ // 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 STATIC_CENTERLINE_GENERATOR__TYPE_ALIAS_HPP_ -#define STATIC_CENTERLINE_GENERATOR__TYPE_ALIAS_HPP_ +#ifndef TYPE_ALIAS_HPP_ +#define TYPE_ALIAS_HPP_ #include "route_handler/route_handler.hpp" #include "tier4_autoware_utils/geometry/geometry.hpp" @@ -26,7 +26,7 @@ #include "autoware_planning_msgs/msg/lanelet_route.hpp" #include "visualization_msgs/msg/marker_array.hpp" -namespace static_centerline_generator +namespace autoware::static_centerline_generator { using autoware_auto_mapping_msgs::msg::HADMapBin; using autoware_auto_perception_msgs::msg::PredictedObjects; @@ -41,6 +41,6 @@ using tier4_autoware_utils::LinearRing2d; using tier4_autoware_utils::LineString2d; using tier4_autoware_utils::Point2d; using visualization_msgs::msg::MarkerArray; -} // namespace static_centerline_generator +} // namespace autoware::static_centerline_generator -#endif // STATIC_CENTERLINE_GENERATOR__TYPE_ALIAS_HPP_ +#endif // TYPE_ALIAS_HPP_ diff --git a/planning/static_centerline_generator/src/utils.cpp b/planning/autoware_static_centerline_generator/src/utils.cpp similarity index 98% rename from planning/static_centerline_generator/src/utils.cpp rename to planning/autoware_static_centerline_generator/src/utils.cpp index ddfd3e11036ce..4ea56e10935b2 100644 --- a/planning/static_centerline_generator/src/utils.cpp +++ b/planning/autoware_static_centerline_generator/src/utils.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "static_centerline_generator/utils.hpp" +#include "utils.hpp" #include "behavior_path_planner_common/data_manager.hpp" #include "behavior_path_planner_common/utils/drivable_area_expansion/static_drivable_area.hpp" @@ -21,7 +21,10 @@ #include #include -namespace static_centerline_generator + +#include + +namespace autoware::static_centerline_generator { namespace { @@ -228,4 +231,4 @@ MarkerArray create_distance_text_marker( return marker_array; } } // namespace utils -} // namespace static_centerline_generator +} // namespace autoware::static_centerline_generator diff --git a/planning/static_centerline_generator/include/static_centerline_generator/utils.hpp b/planning/autoware_static_centerline_generator/src/utils.hpp similarity index 86% rename from planning/static_centerline_generator/include/static_centerline_generator/utils.hpp rename to planning/autoware_static_centerline_generator/src/utils.hpp index c8cf8f8b90590..6c6257bee59a3 100644 --- a/planning/static_centerline_generator/include/static_centerline_generator/utils.hpp +++ b/planning/autoware_static_centerline_generator/src/utils.hpp @@ -12,11 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef STATIC_CENTERLINE_GENERATOR__UTILS_HPP_ -#define STATIC_CENTERLINE_GENERATOR__UTILS_HPP_ +#ifndef UTILS_HPP_ +#define UTILS_HPP_ #include "route_handler/route_handler.hpp" -#include "static_centerline_generator/type_alias.hpp" +#include "type_alias.hpp" #include @@ -24,7 +24,7 @@ #include #include -namespace static_centerline_generator +namespace autoware::static_centerline_generator { namespace utils { @@ -53,6 +53,6 @@ MarkerArray create_distance_text_marker( const geometry_msgs::msg::Pose & pose, const double dist, const std::array & marker_color, const rclcpp::Time & now, const size_t idx); } // namespace utils -} // namespace static_centerline_generator +} // namespace autoware::static_centerline_generator -#endif // STATIC_CENTERLINE_GENERATOR__UTILS_HPP_ +#endif // UTILS_HPP_ diff --git a/planning/static_centerline_generator/srv/LoadMap.srv b/planning/autoware_static_centerline_generator/srv/LoadMap.srv similarity index 100% rename from planning/static_centerline_generator/srv/LoadMap.srv rename to planning/autoware_static_centerline_generator/srv/LoadMap.srv diff --git a/planning/autoware_static_centerline_generator/srv/PlanPath.srv b/planning/autoware_static_centerline_generator/srv/PlanPath.srv new file mode 100644 index 0000000000000..3a8d0321ffb9a --- /dev/null +++ b/planning/autoware_static_centerline_generator/srv/PlanPath.srv @@ -0,0 +1,6 @@ +uint32 map_id +int64[] route +--- +autoware_static_centerline_generator/PointsWithLaneId[] points_with_lane_ids +string message +int64[] unconnected_lane_ids diff --git a/planning/static_centerline_generator/srv/PlanRoute.srv b/planning/autoware_static_centerline_generator/srv/PlanRoute.srv similarity index 100% rename from planning/static_centerline_generator/srv/PlanRoute.srv rename to planning/autoware_static_centerline_generator/srv/PlanRoute.srv diff --git a/planning/static_centerline_generator/test/data/bag_ego_trajectory.db3 b/planning/autoware_static_centerline_generator/test/data/bag_ego_trajectory.db3 similarity index 100% rename from planning/static_centerline_generator/test/data/bag_ego_trajectory.db3 rename to planning/autoware_static_centerline_generator/test/data/bag_ego_trajectory.db3 diff --git a/planning/static_centerline_generator/test/data/lanelet2_map.osm b/planning/autoware_static_centerline_generator/test/data/lanelet2_map.osm similarity index 100% rename from planning/static_centerline_generator/test/data/lanelet2_map.osm rename to planning/autoware_static_centerline_generator/test/data/lanelet2_map.osm diff --git a/planning/static_centerline_generator/test/test_static_centerline_generator.test.py b/planning/autoware_static_centerline_generator/test/test_static_centerline_generator.test.py similarity index 84% rename from planning/static_centerline_generator/test/test_static_centerline_generator.test.py rename to planning/autoware_static_centerline_generator/test/test_static_centerline_generator.test.py index 29ee49a11e3b3..3011abccd48ca 100644 --- a/planning/static_centerline_generator/test/test_static_centerline_generator.test.py +++ b/planning/autoware_static_centerline_generator/test/test_static_centerline_generator.test.py @@ -28,11 +28,12 @@ @pytest.mark.launch_test def generate_test_description(): lanelet2_map_path = os.path.join( - get_package_share_directory("static_centerline_generator"), "test/data/lanelet2_map.osm" + get_package_share_directory("autoware_static_centerline_generator"), + "test/data/lanelet2_map.osm", ) static_centerline_generator_node = Node( - package="static_centerline_generator", + package="autoware_static_centerline_generator", executable="main", output="screen", parameters=[ @@ -50,7 +51,7 @@ def generate_test_description(): "mission_planner.param.yaml", ), os.path.join( - get_package_share_directory("static_centerline_generator"), + get_package_share_directory("autoware_static_centerline_generator"), "config/static_centerline_generator.param.yaml", ), os.path.join( @@ -74,15 +75,15 @@ def generate_test_description(): "config/lanelet2_map_loader.param.yaml", ), os.path.join( - get_package_share_directory("static_centerline_generator"), + get_package_share_directory("autoware_static_centerline_generator"), "config/common.param.yaml", ), os.path.join( - get_package_share_directory("static_centerline_generator"), + get_package_share_directory("autoware_static_centerline_generator"), "config/nearest_search.param.yaml", ), os.path.join( - get_package_share_directory("static_centerline_generator"), + get_package_share_directory("autoware_static_centerline_generator"), "config/vehicle_info.param.yaml", ), ], @@ -94,7 +95,7 @@ def generate_test_description(): LaunchDescription( [ static_centerline_generator_node, - # Start test after 1s - gives time for the static_centerline_generator to finish initialization + # Start test after 1s - gives time for the autoware_static_centerline_generator to finish initialization launch.actions.TimerAction( period=1.0, actions=[launch_testing.actions.ReadyToTest()] ), diff --git a/planning/static_centerline_generator/scripts/tmp/bag_ego_trajectory_based_centerline.sh b/planning/static_centerline_generator/scripts/tmp/bag_ego_trajectory_based_centerline.sh deleted file mode 100755 index 30ed667dd3732..0000000000000 --- a/planning/static_centerline_generator/scripts/tmp/bag_ego_trajectory_based_centerline.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -ros2 launch static_centerline_generator static_centerline_generator.launch.xml centerline_source:="bag_ego_trajectory_base" run_background:=false lanelet2_input_file_path:="$HOME/autoware_map/sample_map/lanelet2_map.osm" bag_filename:="$(ros2 pkg prefix static_centerline_generator --share)/test/data/bag_ego_trajectory.db3" vehicle_model:=lexus diff --git a/planning/static_centerline_generator/scripts/tmp/optimization_trajectory_based_centerline.sh b/planning/static_centerline_generator/scripts/tmp/optimization_trajectory_based_centerline.sh deleted file mode 100755 index 809bbb46a179e..0000000000000 --- a/planning/static_centerline_generator/scripts/tmp/optimization_trajectory_based_centerline.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -ros2 launch static_centerline_generator static_centerline_generator.launch.xml centerline_source:="optimization_trajectory_base" run_background:=false lanelet2_input_file_path:="$HOME/autoware_map/sample_map/lanelet2_map.osm" start_lanelet_id:=125 end_lanelet_id:=132 vehicle_model:=lexus diff --git a/planning/static_centerline_generator/srv/PlanPath.srv b/planning/static_centerline_generator/srv/PlanPath.srv deleted file mode 100644 index 7d823b4eccbf9..0000000000000 --- a/planning/static_centerline_generator/srv/PlanPath.srv +++ /dev/null @@ -1,6 +0,0 @@ -uint32 map_id -int64[] route ---- -static_centerline_generator/PointsWithLaneId[] points_with_lane_ids -string message -int64[] unconnected_lane_ids