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 <[email protected]>
  • Loading branch information
esteve committed May 28, 2024
1 parent 4a9bb74 commit 559de9d
Show file tree
Hide file tree
Showing 36 changed files with 64 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ planning/behavior_velocity_no_stopping_area_module/** [email protected] s
planning/behavior_velocity_occlusion_spot_module/** [email protected] [email protected] [email protected]
planning/behavior_velocity_out_of_lane_module/** [email protected] [email protected] [email protected] [email protected]
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/autoware_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_template_module/** [email protected]
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 @@ -72,7 +72,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 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="[email protected]">Tomohito Ando</maintainer>
<maintainer email="[email protected]">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,11 +24,12 @@
#include <memory>
#include <string>
#include <vector>
namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using sensor_msgs::msg::PointCloud2;
using tier4_debug_msgs::msg::Float32MultiArrayStamped;
using tier4_debug_msgs::msg::Int32Stamped;
using ::behavior_velocity_planner::Polygon2d;

class DebugValues
{
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::splineInterpolate;
using ::behavior_velocity_planner::Point2d;
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,7 +42,7 @@
#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;
Expand All @@ -54,7 +54,9 @@ using run_out_utils::DynamicObstacleData;
using run_out_utils::DynamicObstacleParam;
using run_out_utils::PlannerParam;
using run_out_utils::PredictedPath;
using ::behavior_velocity_planner::PlannerData;
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 tier4_autoware_utils::getOrDeclareParameter;

using ::behavior_velocity_planner::SceneModuleManagerInterface;
RunOutModuleManager::RunOutModuleManager(rclcpp::Node & node)
: SceneModuleManagerInterface(node, getModuleName())
{
Expand Down Expand Up @@ -200,8 +200,8 @@ 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::SceneModuleInterface;
using ::behavior_velocity_planner::SceneModuleManagerInterface;
using ::behavior_velocity_planner::PluginWrapper;
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 object_recognition_utils::convertLabelToString;
using ::behavior_velocity_planner::PlanningBehavior;
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::SceneModuleInterface;
using ::behavior_velocity_planner::PlannerData;
using ::behavior_velocity_planner::StopReason;
using ::behavior_velocity_planner::PathWithLaneId;
using ::behavior_velocity_planner::Polygon2d;

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_
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
#endif
#include <motion_utils/trajectory/trajectory.hpp>
#include <tier4_autoware_utils/geometry/geometry.hpp>
namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
using ::behavior_velocity_planner::PathPointWithLaneId;
using ::behavior_velocity_planner::DetectionRange;
namespace planning_utils = ::behavior_velocity_planner::planning_utils;
namespace run_out_utils
{
Polygon2d createBoostPolyFromMsg(const std::vector<geometry_msgs::msg::Point> & input_poly)
Expand Down Expand Up @@ -450,4 +453,4 @@ Polygons2d createMandatoryDetectionAreaPolygon(
}

} // 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 @@ -29,7 +29,7 @@

#include <string>
#include <vector>
namespace behavior_velocity_planner
namespace autoware::behavior_velocity_planner
{
namespace run_out_utils
{
Expand All @@ -45,6 +45,8 @@ using tier4_autoware_utils::Point2d;
using tier4_autoware_utils::Polygon2d;
using tier4_debug_msgs::msg::Float32Stamped;
using vehicle_info_util::VehicleInfo;
using ::behavior_velocity_planner::Polygons2d;
using ::behavior_velocity_planner::PlannerData;
using PathPointsWithLaneId = std::vector<autoware_auto_planning_msgs::msg::PathPointWithLaneId>;
struct CommonParam
{
Expand Down Expand Up @@ -271,5 +273,5 @@ Polygons2d createMandatoryDetectionAreaPolygon(
const PathWithLaneId & path, const PlannerData & planner_data,
const PlannerParam & planner_param);
} // namespace run_out_utils
} // namespace behavior_velocity_planner
} // namespace autoware::behavior_velocity_planner
#endif // UTILS_HPP_
3 changes: 0 additions & 3 deletions planning/behavior_velocity_run_out_module/plugins.xml

This file was deleted.

0 comments on commit 559de9d

Please sign in to comment.