Skip to content

Commit

Permalink
refactor(behavior_velocity_stop_line_module): prefix package and name…
Browse files Browse the repository at this point in the history
…space with autoware_

Signed-off-by: Esteve Fernandez <[email protected]>
  • Loading branch information
esteve committed Jun 5, 2024
1 parent 9ec94f0 commit 2c6941c
Show file tree
Hide file tree
Showing 24 changed files with 56 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ perception/traffic_light_occlusion_predictor/** [email protected] tao.zhon
perception/traffic_light_visualization/** [email protected] [email protected]
planning/autoware_behavior_path_external_request_lane_change_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_behavior_velocity_planner/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_behavior_velocity_stop_line_module/** [email protected] [email protected] [email protected] [email protected]
planning/autoware_behavior_velocity_template_module/** [email protected]
planning/autoware_planning_test_manager/** [email protected] [email protected]
planning/autoware_remaining_distance_time_calculator/** [email protected]
Expand All @@ -172,7 +173,6 @@ planning/behavior_velocity_out_of_lane_module/** [email protected] shumpei
planning/behavior_velocity_planner_common/** [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_run_out_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_speed_bump_module/** [email protected] [email protected] [email protected]
planning/behavior_velocity_stop_line_module/** [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_traffic_light_module/** [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_virtual_traffic_light_module/** [email protected] [email protected] [email protected]
planning/behavior_velocity_walkway_module/** [email protected] [email protected] [email protected] [email protected]
Expand Down
2 changes: 1 addition & 1 deletion planning/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ nav:
- 'Out of Lane': planning/behavior_velocity_out_of_lane_module
- 'Run Out': planning/behavior_velocity_run_out_module
- 'Speed Bump': planning/behavior_velocity_speed_bump_module
- 'Stop Line': planning/behavior_velocity_stop_line_module
- 'Stop Line': planning/autoware_behavior_velocity_stop_line_module
- 'Traffic Light': planning/behavior_velocity_traffic_light_module
- 'Virtual Traffic Light': planning/behavior_velocity_virtual_traffic_light_module
- 'Walkway': planning/behavior_velocity_walkway_module
Expand Down
2 changes: 1 addition & 1 deletion planning/autoware_behavior_velocity_planner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ It loads modules as plugins. Please refer to the links listed below for detail o
- [Detection Area](../behavior_velocity_detection_area_module/README.md)
- [Intersection](../behavior_velocity_intersection_module/README.md)
- [MergeFromPrivate](../behavior_velocity_intersection_module/README.md#merge-from-private)
- [Stop Line](../behavior_velocity_stop_line_module/README.md)
- [Stop Line](../autoware_behavior_velocity_stop_line_module/README.md)
- [Virtual Traffic Light](../behavior_velocity_virtual_traffic_light_module/README.md)
- [Traffic Light](../behavior_velocity_traffic_light_module/README.md)
- [Occlusion Spot](../behavior_velocity_occlusion_spot_module/README.md)
Expand Down
2 changes: 1 addition & 1 deletion planning/autoware_behavior_velocity_planner/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

<test_depend>ament_cmake_ros</test_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_behavior_velocity_stop_line_module</test_depend>
<test_depend>autoware_lint_common</test_depend>
<test_depend>behavior_velocity_blind_spot_module</test_depend>
<test_depend>behavior_velocity_crosswalk_module</test_depend>
Expand All @@ -76,7 +77,6 @@
<test_depend>behavior_velocity_out_of_lane_module</test_depend>
<test_depend>behavior_velocity_run_out_module</test_depend>
<test_depend>behavior_velocity_speed_bump_module</test_depend>
<test_depend>behavior_velocity_stop_line_module</test_depend>
<test_depend>behavior_velocity_traffic_light_module</test_depend>
<test_depend>behavior_velocity_virtual_traffic_light_module</test_depend>
<test_depend>behavior_velocity_walkway_module</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
const auto velocity_smoother_dir =
ament_index_cpp::get_package_share_directory("autoware_velocity_smoother");

// TODO(esteve): delete when all the modules are migrated to autoware_behavior_velocity_*
const auto get_behavior_velocity_module_config_no_prefix = [](const std::string & module) {
const auto package_name = "behavior_velocity_" + module + "_module";
const auto package_path = ament_index_cpp::get_package_share_directory(package_name);
return package_path + "/config/" + module + ".param.yaml";
};

const auto get_behavior_velocity_module_config = [](const std::string & module) {
const auto package_name = "behavior_velocity_" + module + "_module";
const auto package_path = ament_index_cpp::get_package_share_directory(package_name);
Expand All @@ -70,7 +77,7 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
module_names.emplace_back("behavior_velocity_planner::DetectionAreaModulePlugin");
module_names.emplace_back("behavior_velocity_planner::VirtualTrafficLightModulePlugin");
module_names.emplace_back("behavior_velocity_planner::NoStoppingAreaModulePlugin");
module_names.emplace_back("behavior_velocity_planner::StopLineModulePlugin");
module_names.emplace_back("autoware::behavior_velocity_planner::StopLineModulePlugin");
module_names.emplace_back("behavior_velocity_planner::OcclusionSpotModulePlugin");
module_names.emplace_back("behavior_velocity_planner::RunOutModulePlugin");
module_names.emplace_back("behavior_velocity_planner::SpeedBumpModulePlugin");
Expand All @@ -89,20 +96,20 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
velocity_smoother_dir + "/config/default_velocity_smoother.param.yaml",
velocity_smoother_dir + "/config/Analytical.param.yaml",
behavior_velocity_planner_dir + "/config/behavior_velocity_planner.param.yaml",
get_behavior_velocity_module_config("blind_spot"),
get_behavior_velocity_module_config("crosswalk"),
get_behavior_velocity_module_config("walkway"),
get_behavior_velocity_module_config("detection_area"),
get_behavior_velocity_module_config("intersection"),
get_behavior_velocity_module_config("no_stopping_area"),
get_behavior_velocity_module_config("occlusion_spot"),
get_behavior_velocity_module_config("run_out"),
get_behavior_velocity_module_config("speed_bump"),
get_behavior_velocity_module_config_no_prefix("blind_spot"),
get_behavior_velocity_module_config_no_prefix("crosswalk"),
get_behavior_velocity_module_config_no_prefix("walkway"),
get_behavior_velocity_module_config_no_prefix("detection_area"),
get_behavior_velocity_module_config_no_prefix("intersection"),
get_behavior_velocity_module_config_no_prefix("no_stopping_area"),
get_behavior_velocity_module_config_no_prefix("occlusion_spot"),
get_behavior_velocity_module_config_no_prefix("run_out"),
get_behavior_velocity_module_config_no_prefix("speed_bump"),
get_behavior_velocity_module_config("stop_line"),
get_behavior_velocity_module_config("traffic_light"),
get_behavior_velocity_module_config("virtual_traffic_light"),
get_behavior_velocity_module_config("out_of_lane"),
get_behavior_velocity_module_config("no_drivable_lane")});
get_behavior_velocity_module_config_no_prefix("traffic_light"),
get_behavior_velocity_module_config_no_prefix("virtual_traffic_light"),
get_behavior_velocity_module_config_no_prefix("out_of_lane"),
get_behavior_velocity_module_config_no_prefix("no_drivable_lane")});

// TODO(Takagi, Isamu): set launch_modules
// TODO(Kyoichi Sugahara) set to true launch_virtual_traffic_light
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(behavior_velocity_stop_line_module)
project(autoware_behavior_velocity_stop_line_module)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>behavior_velocity_stop_line_module</name>
<name>autoware_behavior_velocity_stop_line_module</name>
<version>0.1.0</version>
<description>The behavior_velocity_stop_line_module package</description>
<description>The autoware_behavior_velocity_stop_line_module package</description>

<maintainer email="[email protected]">Fumiya Watanabe</maintainer>
<maintainer email="[email protected]">Zhe Shen</maintainer>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<library path="autoware_behavior_velocity_stop_line_module">
<class type="autoware::behavior_velocity_planner::StopLineModulePlugin" base_class_type="behavior_velocity_planner::PluginInterface"/>
</library>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using tier4_autoware_utils::appendMarkerArray;
using tier4_autoware_utils::createMarkerColor;
Expand Down Expand Up @@ -111,4 +111,4 @@ motion_utils::VirtualWalls StopLineModule::createVirtualWalls()
}
return virtual_walls;
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
#include <string>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using lanelet::TrafficSign;
using tier4_autoware_utils::getOrDeclareParameter;
namespace planning_utils = ::behavior_velocity_planner::planning_utils;

StopLineModuleManager::StopLineModuleManager(rclcpp::Node & node)
: SceneModuleManagerInterface(node, getModuleName())
Expand Down Expand Up @@ -102,8 +103,8 @@ StopLineModuleManager::getModuleExpiredFunction(
};
}

} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

#include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(
behavior_velocity_planner::StopLineModulePlugin, behavior_velocity_planner::PluginInterface)
autoware::behavior_velocity_planner::StopLineModulePlugin, ::behavior_velocity_planner::PluginInterface)
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@
#include <utility>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::PluginWrapper;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::SceneModuleManagerInterface;
using StopLineWithLaneId = std::pair<lanelet::ConstLineString3d, int64_t>;

class StopLineModuleManager : public SceneModuleManagerInterface
Expand Down Expand Up @@ -62,6 +65,6 @@ class StopLineModulePlugin : public PluginWrapper<StopLineModuleManager>
{
};

} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

#endif // MANAGER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@
#include <algorithm>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::PlanningBehavior;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::VelocityFactor;
namespace arc_lane_utils = ::behavior_velocity_planner::arc_lane_utils;
namespace planning_utils = ::behavior_velocity_planner::planning_utils;
namespace bg = boost::geometry;

StopLineModule::StopLineModule(
Expand Down Expand Up @@ -177,4 +182,4 @@ geometry_msgs::msg::Point StopLineModule::getCenterOfStopLine(
center_point.z = (stop_line[0].z() + stop_line[1].z()) / 2.0;
return center_point;
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@
#include <lanelet2_core/LaneletMap.h>
#include <lanelet2_routing/RoutingGraph.h>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::LineString2d;
using ::behavior_velocity_planner::PathWithLaneId;
using ::behavior_velocity_planner::Point2d;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::StopReason;
class StopLineModule : public SceneModuleInterface
{
using StopLineWithLaneId = std::pair<lanelet::ConstLineString3d, int64_t>;
Expand Down Expand Up @@ -106,6 +111,6 @@ class StopLineModule : public SceneModuleInterface
// Debug
DebugData debug_data_;
};
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

#endif // SCENE_HPP_
3 changes: 0 additions & 3 deletions planning/behavior_velocity_stop_line_module/plugins.xml

This file was deleted.

0 comments on commit 2c6941c

Please sign in to comment.