Skip to content

Commit

Permalink
refactor(autoware_velocity_walkway_module): prefix package with autow…
Browse files Browse the repository at this point in the history
…are_ and move code to the autoware namespace (#7153)

* refactor(autoware_velocity_walkway_module): prefix package with autoware_ and move code to the autoware namespace

Signed-off-by: Esteve Fernandez <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Esteve Fernandez <[email protected]>

* fix: fix issue loading packages that have been prefixed

Signed-off-by: Esteve Fernandez <[email protected]>

---------

Signed-off-by: Esteve Fernandez <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and KhalilSelyan committed Jul 22, 2024
1 parent 88282fe commit 35e94dc
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 25 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 @@ planning/autoware_behavior_path_external_request_lane_change_module/** fumiya.wa
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_behavior_velocity_walkway_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/autoware_behavior_velocity_run_out_module/** [email protected] m
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_walkway_module/** [email protected] [email protected] [email protected] [email protected]
planning/costmap_generator/** [email protected] [email protected] [email protected]
planning/autoware_external_velocity_limit_selector/** [email protected] [email protected] [email protected] [email protected] [email protected]
planning/freespace_planner/** [email protected] [email protected] [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
/>
<let
name="behavior_velocity_planner_launch_modules"
value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + 'behavior_velocity_planner::WalkwayModulePlugin, '&quot;)"
value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + 'autoware::behavior_velocity_planner::WalkwayModulePlugin, '&quot;)"
if="$(var launch_walkway_module)"
/>
<let
Expand Down
2 changes: 1 addition & 1 deletion planning/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ nav:
- 'Stop Line': planning/behavior_velocity_stop_line_module
- 'Traffic Light': planning/behavior_velocity_traffic_light_module
- 'Virtual Traffic Light': planning/autoware_behavior_velocity_virtual_traffic_light_module
- 'Walkway': planning/behavior_velocity_walkway_module
- 'Walkway': planning/autoware_behavior_velocity_walkway_module
- 'Parking':
- 'Freespace Planner':
- 'About Freespace Planner': planning/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 @@ -9,7 +9,7 @@ It loads modules as plugins. Please refer to the links listed below for detail o

- [Blind Spot](../behavior_velocity_blind_spot_module/README.md)
- [Crosswalk](../behavior_velocity_crosswalk_module/README.md)
- [Walkway](../behavior_velocity_walkway_module/README.md)
- [Walkway](../autoware_behavior_velocity_walkway_module/README.md)
- [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)
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 @@ -67,6 +67,7 @@
<test_depend>ament_lint_auto</test_depend>
<test_depend>autoware_behavior_velocity_run_out_module</test_depend>
<test_depend>autoware_behavior_velocity_virtual_traffic_light_module</test_depend>
<test_depend>autoware_behavior_velocity_walkway_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 @@ -79,7 +80,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_walkway_module</test_depend>
<!--<test_depend>autoware_behavior_velocity_template_module</test_depend>-->

<member_of_group>rosidl_interface_packages</member_of_group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()

std::vector<std::string> module_names;
module_names.emplace_back("behavior_velocity_planner::CrosswalkModulePlugin");
module_names.emplace_back("behavior_velocity_planner::WalkwayModulePlugin");
module_names.emplace_back("autoware::behavior_velocity_planner::WalkwayModulePlugin");
module_names.emplace_back("behavior_velocity_planner::TrafficLightModulePlugin");
module_names.emplace_back("behavior_velocity_planner::IntersectionModulePlugin");
module_names.emplace_back("behavior_velocity_planner::MergeFromPrivateModulePlugin");
Expand Down Expand Up @@ -98,7 +98,7 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
behavior_velocity_planner_dir + "/config/behavior_velocity_planner.param.yaml",
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("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"),
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_walkway_module)
project(autoware_behavior_velocity_walkway_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_walkway_module</name>
<name>autoware_behavior_velocity_walkway_module</name>
<version>0.1.0</version>
<description>The behavior_velocity_walkway_module package</description>
<description>The autoware_behavior_velocity_walkway_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_walkway_module">
<class type="autoware::behavior_velocity_planner::WalkwayModulePlugin" base_class_type="behavior_velocity_planner::PluginInterface"/>
</library>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{

using motion_utils::createSlowDownVirtualWallMarker;
Expand All @@ -34,6 +34,7 @@ using tier4_autoware_utils::createMarkerColor;
using tier4_autoware_utils::createMarkerScale;
using tier4_autoware_utils::createPoint;
using visualization_msgs::msg::Marker;
namespace planning_utils = ::behavior_velocity_planner::planning_utils;

namespace
{
Expand Down Expand Up @@ -98,4 +99,4 @@ visualization_msgs::msg::MarkerArray WalkwayModule::createDebugMarkerArray()

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 @@ -23,11 +23,15 @@
#include <string>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{

using ::behavior_velocity_planner::SceneModuleManagerInterface;
using lanelet::autoware::Crosswalk;
using tier4_autoware_utils::getOrDeclareParameter;
namespace planning_utils = ::behavior_velocity_planner::planning_utils;
using ::behavior_velocity_planner::getCrosswalkIdSetOnPath;
using ::behavior_velocity_planner::getCrosswalksOnPath;

WalkwayModuleManager::WalkwayModuleManager(rclcpp::Node & node)
: SceneModuleManagerInterface(node, getModuleName())
Expand Down Expand Up @@ -100,8 +104,9 @@ WalkwayModuleManager::getModuleExpiredFunction(const PathWithLaneId & path)
return walkway_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::WalkwayModulePlugin, behavior_velocity_planner::PluginInterface)
autoware::behavior_velocity_planner::WalkwayModulePlugin,
::behavior_velocity_planner::PluginInterface)
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
#include <set>
#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 tier4_planning_msgs::msg::PathWithLaneId;

class WalkwayModuleManager : public SceneModuleManagerInterface
Expand All @@ -56,6 +58,6 @@ class WalkwayModulePlugin : public PluginWrapper<WalkwayModuleManager>
{
};

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

#endif // MANAGER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@

#include <cmath>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace bg = boost::geometry;
using ::behavior_velocity_planner::getLinestringIntersects;
using ::behavior_velocity_planner::getPolygonIntersects;
using ::behavior_velocity_planner::getStopLineFromMap;
using ::behavior_velocity_planner::PlanningBehavior;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::StopFactor;
using ::behavior_velocity_planner::VelocityFactor;
using motion_utils::calcLongitudinalOffsetPose;
using motion_utils::calcSignedArcLength;
using motion_utils::findNearestSegmentIndex;
using tier4_autoware_utils::createPoint;
using tier4_autoware_utils::getPose;
namespace planning_utils = ::behavior_velocity_planner::planning_utils;

WalkwayModule::WalkwayModule(
const int64_t module_id, const lanelet::LaneletMapPtr & lanelet_map_ptr,
Expand Down Expand Up @@ -165,4 +173,4 @@ bool WalkwayModule::modifyPathVelocity(PathWithLaneId * path, StopReason * stop_

return true;
}
} // 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 <utility>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::DebugData;
using ::behavior_velocity_planner::PathWithLaneId;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::StopReason;

class WalkwayModule : public SceneModuleInterface
{
Expand Down Expand Up @@ -77,6 +81,6 @@ class WalkwayModule : public SceneModuleInterface
// flag to use regulatory element
const bool use_regulatory_element_;
};
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

#endif // SCENE_WALKWAY_HPP_
3 changes: 0 additions & 3 deletions planning/behavior_velocity_walkway_module/plugins.xml

This file was deleted.

0 comments on commit 35e94dc

Please sign in to comment.