Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(autoware_velocity_virtual_traffic_light_module): prefix package with autoware_ and move code to the autoware namespace #7155

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ perception/traffic_light_visualization/** [email protected] yukihiro.saito@tier
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_template_module/** [email protected]
planning/autoware_behavior_velocity_virtual_traffic_light_module/** [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 @@ -174,7 +175,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_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]
planning/external_velocity_limit_selector/** [email protected] [email protected] [email protected] [email protected] [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
/>
<let
name="behavior_velocity_planner_launch_modules"
value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + 'behavior_velocity_planner::VirtualTrafficLightModulePlugin, '&quot;)"
value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + 'autoware::behavior_velocity_planner::VirtualTrafficLightModulePlugin, '&quot;)"
if="$(var launch_virtual_traffic_light_module)"
/>
<let
Expand Down
2 changes: 1 addition & 1 deletion planning/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ nav:
- 'Speed Bump': planning/behavior_velocity_speed_bump_module
- 'Stop Line': planning/behavior_velocity_stop_line_module
- 'Traffic Light': planning/behavior_velocity_traffic_light_module
- 'Virtual Traffic Light': planning/behavior_velocity_virtual_traffic_light_module
- 'Virtual Traffic Light': planning/autoware_behavior_velocity_virtual_traffic_light_module
- 'Walkway': planning/behavior_velocity_walkway_module
- 'Parking':
- 'Freespace Planner':
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 @@ -14,7 +14,7 @@ It loads modules as plugins. Please refer to the links listed below for detail o
- [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)
- [Virtual Traffic Light](../behavior_velocity_virtual_traffic_light_module/README.md)
- [Virtual Traffic Light](../autoware_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)
- [No Stopping Area](../behavior_velocity_no_stopping_area_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_virtual_traffic_light_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 @@ -78,7 +79,6 @@
<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>
<!--<test_depend>autoware_behavior_velocity_template_module</test_depend>-->

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 velocity_smoother_dir =
ament_index_cpp::get_package_share_directory("autoware_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 All @@ -68,7 +75,7 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
module_names.emplace_back("behavior_velocity_planner::MergeFromPrivateModulePlugin");
module_names.emplace_back("behavior_velocity_planner::BlindSpotModulePlugin");
module_names.emplace_back("behavior_velocity_planner::DetectionAreaModulePlugin");
module_names.emplace_back("behavior_velocity_planner::VirtualTrafficLightModulePlugin");
module_names.emplace_back("autoware::behavior_velocity_planner::VirtualTrafficLightModulePlugin");
module_names.emplace_back("behavior_velocity_planner::NoStoppingAreaModulePlugin");
module_names.emplace_back("behavior_velocity_planner::StopLineModulePlugin");
module_names.emplace_back("behavior_velocity_planner::OcclusionSpotModulePlugin");
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("stop_line"),
get_behavior_velocity_module_config("traffic_light"),
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_no_prefix("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("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_virtual_traffic_light_module)
project(autoware_behavior_velocity_virtual_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_virtual_traffic_light_module</name>
<name>autoware_behavior_velocity_virtual_traffic_light_module</name>
<version>0.1.0</version>
<description>The behavior_velocity_virtual_traffic_light_module package</description>
<description>The autoware_behavior_velocity_virtual_traffic_light_module package</description>

<maintainer email="[email protected]">Kosuke Takeuchi</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_virtual_traffic_light_module">
<class type="autoware::behavior_velocity_planner::VirtualTrafficLightModulePlugin" base_class_type="behavior_velocity_planner::PluginInterface"/>
</library>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ using tier4_autoware_utils::createMarkerScale;
using tier4_autoware_utils::toMsg;
using namespace std::literals::string_literals;

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace
{
Expand Down Expand Up @@ -147,4 +147,4 @@ visualization_msgs::msg::MarkerArray VirtualTrafficLightModule::createDebugMarke

return debug_marker_array;
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
#include <unordered_map>
#include <utility>

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

VirtualTrafficLightModuleManager::VirtualTrafficLightModuleManager(rclcpp::Node & node)
: SceneModuleManagerInterface(node, getModuleName())
Expand Down Expand Up @@ -76,9 +77,9 @@ VirtualTrafficLightModuleManager::getModuleExpiredFunction(
return id_set.count(scene_module->getModuleId()) == 0;
};
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

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

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::PluginWrapper;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::SceneModuleManagerInterface;
class VirtualTrafficLightModuleManager : public SceneModuleManagerInterface
{
public:
Expand All @@ -48,6 +51,6 @@ class VirtualTrafficLightModulePlugin : public PluginWrapper<VirtualTrafficLight
{
};

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

#endif // MANAGER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@
#include <string>
#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
{
using tier4_autoware_utils::calcDistance2d;
Expand Down Expand Up @@ -618,4 +623,4 @@ void VirtualTrafficLightModule::insertStopVelocityAtEndLine(
module_data_.stop_head_pose_at_end_line =
calcHeadPose(stop_pose, planner_data_->vehicle_info_.max_longitudinal_offset_m);
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@
#include <string>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::PathWithLaneId;
using ::behavior_velocity_planner::Pose;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::StopReason;
class VirtualTrafficLightModule : public SceneModuleInterface
{
public:
Expand Down Expand Up @@ -126,5 +130,5 @@ class VirtualTrafficLightModule : public SceneModuleInterface
tier4_planning_msgs::msg::PathWithLaneId * path,
tier4_planning_msgs::msg::StopReason * stop_reason, const size_t end_line_idx);
};
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
#endif // SCENE_HPP_

This file was deleted.

Loading