Skip to content

Commit

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

Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
  • Loading branch information
esteve committed Jun 4, 2024
1 parent 19ea101 commit 81e1d40
Show file tree
Hide file tree
Showing 36 changed files with 86 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ planning/behavior_velocity_no_stopping_area_module/** kosuke.takeuchi@tier4.jp s
planning/behavior_velocity_occlusion_spot_module/** shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp tomoya.kimura@tier4.jp
planning/behavior_velocity_out_of_lane_module/** maxime.clement@tier4.jp shumpei.wakabayashi@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp
planning/behavior_velocity_planner_common/** fumiya.watanabe@tier4.jp isamu.takagi@tier4.jp mamoru.sobue@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
planning/behavior_velocity_run_out_module/** kosuke.takeuchi@tier4.jp makoto.kurihara@tier4.jp shumpei.wakabayashi@tier4.jp takayuki.murooka@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp
planning/autoware_behavior_velocity_run_out_module/** kosuke.takeuchi@tier4.jp makoto.kurihara@tier4.jp shumpei.wakabayashi@tier4.jp takayuki.murooka@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp
planning/behavior_velocity_speed_bump_module/** mdogru@leodrive.ai shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
planning/behavior_velocity_stop_line_module/** fumiya.watanabe@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp zhe.shen@tier4.jp
planning/behavior_velocity_traffic_light_module/** mamoru.sobue@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
/>
<let
name="behavior_velocity_planner_launch_modules"
value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + 'behavior_velocity_planner::RunOutModulePlugin, '&quot;)"
value="$(eval &quot;'$(var behavior_velocity_planner_launch_modules)' + 'autoware::behavior_velocity_planner::RunOutModulePlugin, '&quot;)"
if="$(var launch_run_out_module)"
/>
<let
Expand Down
2 changes: 1 addition & 1 deletion planning/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ nav:
- 'No Stopping Area': planning/behavior_velocity_no_stopping_area_module
- 'Occlusion Spot': planning/behavior_velocity_occlusion_spot_module
- 'Out of Lane': planning/behavior_velocity_out_of_lane_module
- 'Run Out': planning/behavior_velocity_run_out_module
- 'Run Out': planning/autoware_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
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 @@ -18,7 +18,7 @@ It loads modules as plugins. Please refer to the links listed below for detail o
- [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)
- [Run Out](../behavior_velocity_run_out_module/README.md)
- [Run Out](../autoware_behavior_velocity_run_out_module/README.md)
- [Speed Bump](../behavior_velocity_speed_bump_module/README.md)
- [Out of Lane](../behavior_velocity_out_of_lane_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_run_out_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 @@ -74,7 +75,6 @@
<test_depend>behavior_velocity_no_stopping_area_module</test_depend>
<test_depend>behavior_velocity_occlusion_spot_module</test_depend>
<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>
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 @@ -72,7 +79,7 @@ std::shared_ptr<BehaviorVelocityPlannerNode> generateNode()
module_names.emplace_back("behavior_velocity_planner::NoStoppingAreaModulePlugin");
module_names.emplace_back("behavior_velocity_planner::StopLineModulePlugin");
module_names.emplace_back("behavior_velocity_planner::OcclusionSpotModulePlugin");
module_names.emplace_back("behavior_velocity_planner::RunOutModulePlugin");
module_names.emplace_back("autoware::behavior_velocity_planner::RunOutModulePlugin");
module_names.emplace_back("behavior_velocity_planner::SpeedBumpModulePlugin");
module_names.emplace_back("behavior_velocity_planner::OutOfLaneModulePlugin");
module_names.emplace_back("behavior_velocity_planner::NoDrivableLaneModulePlugin");
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_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("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("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("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_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_run_out_module)
project(autoware_behavior_velocity_run_out_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_run_out_module</name>
<name>autoware_behavior_velocity_run_out_module</name>
<version>0.1.0</version>
<description>The behavior_velocity_run_out_module package</description>
<description>The autoware_behavior_velocity_run_out_module package</description>

<maintainer email="tomohito.ando@tier4.jp">Tomohito Ando</maintainer>
<maintainer email="makoto.kurihara@tier4.jp">Makoto Kurihara</maintainer>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<library path="autoware_behavior_velocity_run_out_module">
<class type="autoware::behavior_velocity_planner::RunOutModulePlugin" 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::createMarkerOrientation;
using tier4_autoware_utils::createMarkerScale;
using tier4_autoware_utils::createPoint;

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace
{
Expand Down Expand Up @@ -368,4 +368,4 @@ motion_utils::VirtualWalls RunOutModule::createVirtualWalls()
return debug_ptr_->createVirtualWalls();
}

} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
#include <memory>
#include <string>
#include <vector>
namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::Polygon2d;
using sensor_msgs::msg::PointCloud2;
using tier4_debug_msgs::msg::Float32MultiArrayStamped;
using tier4_debug_msgs::msg::Int32Stamped;
Expand Down Expand Up @@ -149,6 +150,6 @@ class RunOutDebug
double height_{0};
};

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

#endif // DEBUG_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
#include <limits>
#include <string>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::Point2d;
using ::behavior_velocity_planner::splineInterpolate;
namespace
{
// create quaternion facing to the nearest trajectory point
Expand Down Expand Up @@ -600,4 +602,4 @@ void DynamicObstacleCreatorForPoints::onSynchronizedPointCloud(
std::lock_guard<std::mutex> lock(mutex_);
obstacle_points_map_filtered_ = lateral_nearest_points;
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,21 @@
#include <memory>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using autoware_auto_perception_msgs::msg::ObjectClassification;
using autoware_auto_perception_msgs::msg::PredictedObjects;
using autoware_auto_perception_msgs::msg::Shape;
using autoware_auto_planning_msgs::msg::PathPointWithLaneId;
using autoware_auto_planning_msgs::msg::PathWithLaneId;
using ::behavior_velocity_planner::PlannerData;
using run_out_utils::DynamicObstacle;
using run_out_utils::DynamicObstacleData;
using run_out_utils::DynamicObstacleParam;
using run_out_utils::PlannerParam;
using run_out_utils::PredictedPath;
using PathPointsWithLaneId = std::vector<autoware_auto_planning_msgs::msg::PathPointWithLaneId>;
using ::behavior_velocity_planner::Polygons2d;

/**
* @brief base class for creating dynamic obstacles from multiple types of input
Expand Down Expand Up @@ -171,6 +173,6 @@ class DynamicObstacleCreatorForPoints : public DynamicObstacleCreator
pcl::PointCloud<pcl::PointXYZ> obstacle_points_map_filtered_;
};

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

#endif // DYNAMIC_OBSTACLE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#include <utility>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::SceneModuleManagerInterface;
using tier4_autoware_utils::getOrDeclareParameter;

RunOutModuleManager::RunOutModuleManager(rclcpp::Node & node)
: SceneModuleManagerInterface(node, getModuleName())
{
Expand Down Expand Up @@ -200,8 +200,9 @@ void RunOutModuleManager::setDynamicObstacleCreator(
break;
}
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

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

#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 RunOutModuleManager : public SceneModuleManagerInterface
{
public:
Expand All @@ -49,6 +52,6 @@ class RunOutModulePlugin : public PluginWrapper<RunOutModuleManager>
{
};

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

#endif // MANAGER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "path_utils.hpp"

#include <motion_utils/trajectory/trajectory.hpp>
namespace behavior_velocity_planner::run_out_utils
namespace autoware::behavior_velocity_planner::run_out_utils
{
geometry_msgs::msg::Point findLongitudinalNearestPoint(
const std::vector<autoware_auto_planning_msgs::msg::PathPointWithLaneId> & points,
Expand All @@ -36,4 +36,4 @@ geometry_msgs::msg::Point findLongitudinalNearestPoint(
return min_dist_point;
}

} // namespace behavior_velocity_planner::run_out_utils
} // namespace autoware::behavior_velocity_planner::run_out_utils
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <utility>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace run_out_utils
{
Expand All @@ -36,5 +36,5 @@ geometry_msgs::msg::Point findLongitudinalNearestPoint(
const std::vector<geometry_msgs::msg::Point> & target_points);

} // namespace run_out_utils
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
#endif // PATH_UTILS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@
#include <limits>
#include <utility>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace bg = boost::geometry;
using ::behavior_velocity_planner::PlanningBehavior;
using object_recognition_utils::convertLabelToString;
namespace planning_utils = ::behavior_velocity_planner::planning_utils;
using ::behavior_velocity_planner::getCrosswalksOnPath;
using ::behavior_velocity_planner::Polygon2d;

RunOutModule::RunOutModule(
const int64_t module_id, const std::shared_ptr<const PlannerData> & planner_data,
Expand Down Expand Up @@ -1031,4 +1035,4 @@ bool RunOutModule::isMomentaryDetection()

return elapsed_time_since_detection < planner_param_.ignore_momentary_detection.time_threshold;
}
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <utility>
#include <vector>

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using autoware_auto_perception_msgs::msg::PredictedObjects;
using autoware_auto_planning_msgs::msg::PathPointWithLaneId;
Expand All @@ -39,6 +39,11 @@ using run_out_utils::PlannerParam;
using run_out_utils::PoseWithRange;
using tier4_debug_msgs::msg::Float32Stamped;
using BasicPolygons2d = std::vector<lanelet::BasicPolygon2d>;
using ::behavior_velocity_planner::PathWithLaneId;
using ::behavior_velocity_planner::PlannerData;
using ::behavior_velocity_planner::Polygon2d;
using ::behavior_velocity_planner::SceneModuleInterface;
using ::behavior_velocity_planner::StopReason;

class RunOutModule : public SceneModuleInterface
{
Expand Down Expand Up @@ -177,6 +182,6 @@ class RunOutModule : public SceneModuleInterface

bool isMomentaryDetection();
};
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner

#endif // SCENE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "state_machine.hpp"

namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace run_out_utils
{
Expand Down Expand Up @@ -107,4 +107,4 @@ void StateMachine::updateState(const StateInput & state_input, rclcpp::Clock & c
}

} // namespace run_out_utils
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <string>

namespace behavior_velocity_planner::run_out_utils
namespace autoware::behavior_velocity_planner::run_out_utils
{

class StateMachine
Expand Down Expand Up @@ -53,6 +53,6 @@ class StateMachine
std::optional<DynamicObstacle> prev_obstacle_{};
std::optional<DynamicObstacle> target_obstacle_{};
};
} // namespace behavior_velocity_planner::run_out_utils
} // namespace autoware::behavior_velocity_planner::run_out_utils

#endif // STATE_MACHINE_HPP_
Loading

0 comments on commit 81e1d40

Please sign in to comment.