Skip to content

Commit

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

Signed-off-by: Esteve Fernandez <[email protected]>
  • Loading branch information
esteve committed May 29, 2024
1 parent b7fb01c commit a51fe5f
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,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_traffic_light_module/** [email protected] [email protected] [email protected] [email protected]
planning/autoware_planning_test_manager/** [email protected] [email protected]
planning/autoware_remaining_distance_time_calculator/** [email protected]
planning/autoware_static_centerline_generator/** [email protected] [email protected]
Expand Down Expand Up @@ -175,7 +176,6 @@ planning/behavior_velocity_run_out_module/** [email protected] makoto.kur
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_template_module/** [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]
planning/costmap_generator/** [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 @@ -33,7 +33,7 @@ nav:
- 'Run Out': planning/behavior_velocity_run_out_module
- 'Speed Bump': planning/behavior_velocity_speed_bump_module
- 'Stop Line': planning/behavior_velocity_stop_line_module
- 'Traffic Light': planning/behavior_velocity_traffic_light_module
- 'Traffic Light': planning/autoware_behavior_velocity_traffic_light_module
- 'Virtual Traffic Light': planning/behavior_velocity_virtual_traffic_light_module
- 'Walkway': planning/behavior_velocity_walkway_module
- 'Parking':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,19 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
const auto motion_velocity_smoother_dir =
ament_index_cpp::get_package_share_directory("motion_velocity_smoother");

const auto get_behavior_velocity_module_config = [](const std::string & module) {
// 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 = "autoware_behavior_velocity_" + module + "_module";
const auto package_path = ament_index_cpp::get_package_share_directory(package_name);
return package_path + "/config/" + module + ".param.yaml";
};

std::vector<std::string> module_names;
module_names.emplace_back("behavior_velocity_planner::CrosswalkModulePlugin");
module_names.emplace_back("behavior_velocity_planner::WalkwayModulePlugin");
Expand Down Expand Up @@ -90,20 +97,20 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
motion_velocity_smoother_dir + "/config/default_motion_velocity_smoother.param.yaml",
motion_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("stop_line"),
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_no_prefix("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("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_traffic_light_module)
project(autoware_behavior_velocity_traffic_light_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_traffic_light_module</name>
<name>autoware_behavior_velocity_traffic_light_module</name>
<version>0.1.0</version>
<description>The behavior_velocity_traffic_light_module package</description>
<description>The autoware_behavior_velocity_traffic_light_module package</description>

<maintainer email="[email protected]">Satoshi Ota</maintainer>
<maintainer email="[email protected]">Tomoya Kimura</maintainer>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<library path="autoware_behavior_velocity_traffic_light_module">
<class type="autoware::behavior_velocity_planner::TrafficLightModulePlugin" 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
{
visualization_msgs::msg::MarkerArray TrafficLightModule::createDebugMarkerArray()
{
Expand Down Expand Up @@ -54,4 +54,4 @@ motion_utils::VirtualWalls TrafficLightModule::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 @@ -24,10 +24,15 @@
#include <set>
#include <string>
#include <utility>
namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using lanelet::TrafficLight;
using tier4_autoware_utils::getOrDeclareParameter;
using ::behavior_velocity_planner::PlanningBehavior;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::SceneModuleManagerInterfaceWithRTC;
using ::behavior_velocity_planner::State;
namespace planning_utils = ::behavior_velocity_planner::planning_utils;

TrafficLightModuleManager::TrafficLightModuleManager(rclcpp::Node & node)
: SceneModuleManagerInterfaceWithRTC(
Expand Down Expand Up @@ -189,8 +194,8 @@ bool TrafficLightModuleManager::hasSameTrafficLight(
return false;
}

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

#include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(
behavior_velocity_planner::TrafficLightModulePlugin, behavior_velocity_planner::PluginInterface)
autoware::behavior_velocity_planner::TrafficLightModulePlugin, behavior_velocity_planner::PluginInterface)
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@
#include <memory>
#include <optional>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::PluginWrapper;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::SceneModuleManagerInterfaceWithRTC;
class TrafficLightModuleManager : public SceneModuleManagerInterfaceWithRTC
{
public:
Expand Down Expand Up @@ -65,6 +68,6 @@ class TrafficLightModulePlugin : public PluginWrapper<TrafficLightModuleManager>
{
};

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

#endif // MANAGER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@
#include <string>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace bg = boost::geometry;
using ::behavior_velocity_planner::LineString2d;
using ::behavior_velocity_planner::PlanningBehavior;
using ::behavior_velocity_planner::Point2d;
using ::behavior_velocity_planner::VelocityFactor;
namespace planning_utils = ::behavior_velocity_planner::planning_utils;

namespace
{
Expand Down Expand Up @@ -433,4 +438,4 @@ autoware_auto_planning_msgs::msg::PathWithLaneId TrafficLightModule::insertStopP
return modified_path;
}

} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@
#include <lanelet2_core/LaneletMap.h>
#include <lanelet2_routing/RoutingGraph.h>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::PathWithLaneId;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::StopReason;
using ::behavior_velocity_planner::TrafficSignalStamped;
class TrafficLightModule : public SceneModuleInterface
{
public:
Expand Down Expand Up @@ -129,6 +133,6 @@ class TrafficLightModule : public SceneModuleInterface
// Traffic Light State
TrafficSignal looking_tl_state_;
};
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

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

This file was deleted.

0 comments on commit a51fe5f

Please sign in to comment.