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(route_handler): route handler add autoware prefix #7341

Merged
Show file tree
Hide file tree
Changes from 8 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 @@ -191,7 +191,7 @@ planning/path_smoother/** [email protected] [email protected]
planning/planning_test_utils/** [email protected] [email protected] [email protected] [email protected]
planning/autoware_planning_topic_converter/** [email protected] [email protected] [email protected]
planning/planning_validator/** [email protected] [email protected]
planning/route_handler/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_route_handler/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/rtc_interface/** [email protected] [email protected] [email protected] [email protected]
planning/rtc_replayer/** [email protected] [email protected]
planning/sampling_based_planner/bezier_sampler/** [email protected]
Expand Down
2 changes: 1 addition & 1 deletion planning/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ nav:
- 'Costmap Generator': planning/costmap_generator
- 'External Velocity Limit Selector': planning/autoware_external_velocity_limit_selector
- 'Objects of Interest Marker Interface': planning/objects_of_interest_marker_interface
- 'Route Handler': planning/route_handler
- 'Route Handler': planning/autoware_route_handler
- 'RTC Interface': planning/rtc_interface
- 'Additional Tools':
- 'Remaining Distance Time Calculator': planning/autoware_remaining_distance_time_calculator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef MANAGER_HPP_
#define MANAGER_HPP_

#include "autoware_route_handler/route_handler.hpp"
#include "behavior_path_lane_change_module/manager.hpp"
#include "route_handler/route_handler.hpp"

#include <rclcpp/rclcpp.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#include "autoware_behavior_path_planner_common/utils/drivable_area_expansion/parameters.hpp"
#include "motion_utils/trajectory/trajectory.hpp"

#include <autoware_route_handler/route_handler.hpp>
#include <lanelet2_extension/regulatory_elements/Forward.hpp>
#include <lanelet2_extension/utility/utilities.hpp>
#include <rclcpp/rclcpp/clock.hpp>
#include <rclcpp/rclcpp/time.hpp>
#include <route_handler/route_handler.hpp>

#include <autoware_adapi_v1_msgs/msg/operation_mode_state.hpp>
#include <autoware_perception_msgs/msg/predicted_objects.hpp>
Expand All @@ -50,6 +50,7 @@

namespace behavior_path_planner
{
using autoware::route_handler::RouteHandler;
using autoware_adapi_v1_msgs::msg::OperationModeState;
using autoware_perception_msgs::msg::PredictedObject;
using autoware_perception_msgs::msg::PredictedObjects;
Expand All @@ -61,7 +62,6 @@ using geometry_msgs::msg::AccelWithCovarianceStamped;
using geometry_msgs::msg::PoseStamped;
using nav_msgs::msg::OccupancyGrid;
using nav_msgs::msg::Odometry;
using route_handler::RouteHandler;
using tier4_planning_msgs::msg::LateralOffset;
using tier4_planning_msgs::msg::PathWithLaneId;
using PlanResult = PathWithLaneId::SharedPtr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

#include <autoware_behavior_path_planner_common/interface/steering_factor_interface.hpp>
#include <autoware_behavior_path_planner_common/turn_signal_decider.hpp>
#include <autoware_route_handler/route_handler.hpp>
#include <magic_enum.hpp>
#include <motion_utils/marker/marker_helper.hpp>
#include <motion_utils/trajectory/path_with_lane_id.hpp>
#include <motion_utils/trajectory/trajectory.hpp>
#include <objects_of_interest_marker_interface/objects_of_interest_marker_interface.hpp>
#include <rclcpp/rclcpp.hpp>
#include <route_handler/route_handler.hpp>
#include <rtc_interface/rtc_interface.hpp>
#include <tier4_autoware_utils/geometry/geometry.hpp>
#include <tier4_autoware_utils/ros/marker_helper.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

#include <autoware_behavior_path_planner_common/parameters.hpp>
#include <autoware_behavior_path_planner_common/utils/path_shifter/path_shifter.hpp>
#include <autoware_route_handler/route_handler.hpp>
#include <lanelet2_extension/utility/message_conversion.hpp>
#include <route_handler/route_handler.hpp>
#include <tier4_autoware_utils/geometry/boost_geometry.hpp>
#include <tier4_autoware_utils/geometry/geometry.hpp>

Expand All @@ -42,12 +42,12 @@

namespace behavior_path_planner
{
using autoware::route_handler::RouteHandler;
using autoware_vehicle_msgs::msg::HazardLightsCommand;
using autoware_vehicle_msgs::msg::TurnIndicatorsCommand;
using geometry_msgs::msg::Point;
using geometry_msgs::msg::Pose;
using nav_msgs::msg::Odometry;
using route_handler::RouteHandler;
using tier4_planning_msgs::msg::PathWithLaneId;

const std::map<std::string, uint8_t> g_signal_map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "autoware_behavior_path_planner_common/utils/drivable_area_expansion/parameters.hpp"
#include "autoware_behavior_path_planner_common/utils/drivable_area_expansion/types.hpp"

#include <route_handler/route_handler.hpp>
#include <autoware_route_handler/route_handler.hpp>

#include <lanelet2_core/Forward.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "autoware_behavior_path_planner_common/data_manager.hpp"
#include "motion_utils/trajectory/trajectory.hpp"

#include <route_handler/route_handler.hpp>
#include <autoware_route_handler/route_handler.hpp>
#include <tier4_autoware_utils/geometry/boost_geometry.hpp>

#include <autoware_perception_msgs/msg/object_classification.hpp>
Expand Down Expand Up @@ -46,10 +46,10 @@ using autoware_perception_msgs::msg::PredictedObject;
using autoware_perception_msgs::msg::PredictedObjects;
using autoware_perception_msgs::msg::PredictedPath;

using autoware::route_handler::RouteHandler;
using geometry_msgs::msg::Point;
using geometry_msgs::msg::Pose;
using geometry_msgs::msg::Vector3;
using route_handler::RouteHandler;
using tier4_autoware_utils::LinearRing2d;
using tier4_autoware_utils::Polygon2d;
using tier4_planning_msgs::msg::PathPointWithLaneId;
Expand Down Expand Up @@ -327,7 +327,7 @@ lanelet::ConstLanelets calcLaneAroundPose(
bool checkPathRelativeAngle(const PathWithLaneId & path, const double angle_threshold);

lanelet::ConstLanelets getLaneletsFromPath(
const PathWithLaneId & path, const std::shared_ptr<route_handler::RouteHandler> & route_handler);
const PathWithLaneId & path, const std::shared_ptr<RouteHandler> & route_handler);

std::string convertToSnakeCase(const std::string & input_str);

Expand Down
2 changes: 1 addition & 1 deletion planning/autoware_behavior_path_planner_common/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<depend>autoware_adapi_v1_msgs</depend>
<depend>autoware_perception_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>freespace_planning_algorithms</depend>
<depend>geometry_msgs</depend>
<depend>interpolation</depend>
Expand All @@ -55,7 +56,6 @@
<depend>object_recognition_utils</depend>
<depend>objects_of_interest_marker_interface</depend>
<depend>rclcpp</depend>
<depend>route_handler</depend>
<depend>rtc_interface</depend>
<depend>tf2</depend>
<depend>tier4_autoware_utils</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ bool checkPathRelativeAngle(const PathWithLaneId & path, const double angle_thre
}

lanelet::ConstLanelets getLaneletsFromPath(
const PathWithLaneId & path, const std::shared_ptr<route_handler::RouteHandler> & route_handler)
const PathWithLaneId & path, const std::shared_ptr<RouteHandler> & route_handler)
{
std::vector<int64_t> unique_lanelet_ids;
for (const auto & p : path.points) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,56 +179,57 @@
autoware_map_msgs::msg::LaneletMapBin map;
lanelet::LaneletMapPtr empty_lanelet_map_ptr = std::make_shared<lanelet::LaneletMap>();
lanelet::utils::conversion::toBinMsg(empty_lanelet_map_ptr, &map);
route_handler::RouteHandler route_handler(map);
autoware::route_handler::RouteHandler route_handler(map);
lanelet::ConstLanelets path_lanes = {};
drivable_area_expansion::PathWithLaneId path;
{ // Simple path with Y=0 and X = 0, 1, 2
drivable_area_expansion::PathWithLaneId::_points_type::value_type p;
p.point.pose.position.x = 0.0;
p.point.pose.position.y = 0.0;
path.points.push_back(p);
p.point.pose.position.x = 1.0;
path.points.push_back(p);
p.point.pose.position.x = 2.0;
path.points.push_back(p);
}
{ // Left bound at Y = 1, Right bound at Y = -1
drivable_area_expansion::Point pl;
drivable_area_expansion::Point pr;
pl.y = 1.0;
pr.y = -1.0;
pl.x = 0.0;
pr.x = 0.0;
path.left_bound.push_back(pl);
path.right_bound.push_back(pr);
pl.x = 1.0;
pr.x = 1.0;
path.left_bound.push_back(pl);
path.right_bound.push_back(pr);
pl.x = 2.0;
pr.x = 2.0;
path.left_bound.push_back(pl);
path.right_bound.push_back(pr);
}
{ // parameters
params.enabled = true;
params.avoid_dynamic_objects = false;
params.avoid_linestring_dist = 0.0;
params.avoid_linestring_types = {};
params.max_expansion_distance = 0.0; // means no limit
params.max_path_arc_length = 0.0; // means no limit
params.resample_interval = 1.0;
// 2m x 4m ego footprint
params.vehicle_info.front_overhang_m = 0.0;
params.vehicle_info.wheel_base_m = 2.0;
params.vehicle_info.vehicle_width_m = 2.0;
}
behavior_path_planner::PlannerData planner_data;
planner_data.drivable_area_expansion_parameters = params;
planner_data.dynamic_object =
std::make_shared<drivable_area_expansion::PredictedObjects>(dynamic_objects);
planner_data.self_odometry = std::make_shared<nav_msgs::msg::Odometry>();
planner_data.route_handler = std::make_shared<route_handler::RouteHandler>(route_handler);
planner_data.route_handler =
std::make_shared<autoware::route_handler::RouteHandler>(route_handler);

Check warning on line 232 in planning/autoware_behavior_path_planner_common/test/test_drivable_area_expansion.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Large Method

TEST:DrivableAreaExpansionProjection:expand_drivable_area increases from 89 to 90 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.
drivable_area_expansion::expand_drivable_area(
path, std::make_shared<behavior_path_planner::PlannerData>(planner_data));
// unchanged path points
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
namespace behavior_path_planner
{

using autoware::route_handler::Direction;
using behavior_path_planner::utils::path_safety_checker::CollisionCheckDebug;
using route_handler::Direction;

enum class ObjectInfo {
NONE = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

<depend>autoware_behavior_path_planner_common</depend>
<depend>autoware_perception_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>behavior_path_planner</depend>
<depend>geometry_msgs</depend>
<depend>lanelet2_extension</depend>
Expand All @@ -31,7 +32,6 @@
<depend>objects_of_interest_marker_interface</depend>
<depend>pluginlib</depend>
<depend>rclcpp</depend>
<depend>route_handler</depend>
<depend>rtc_interface</depend>
<depend>sensor_msgs</depend>
<depend>signal_processing</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>

using autoware::route_handler::Direction;
using behavior_path_planner::ObjectData;
using behavior_path_planner::utils::static_obstacle_avoidance::isOnRight;
using behavior_path_planner::utils::static_obstacle_avoidance::isSameDirectionShift;
Expand All @@ -26,31 +27,31 @@ using behavior_path_planner::utils::static_obstacle_avoidance::isShiftNecessary;
TEST(BehaviorPathPlanningAvoidanceUtilsTest, shiftLengthDirectionTest)
{
ObjectData right_obj;
right_obj.direction = route_handler::Direction::RIGHT;
right_obj.direction = Direction::RIGHT;
const double negative_shift_length = -1.0;
const double positive_shift_length = 1.0;

ASSERT_TRUE(isSameDirectionShift(isOnRight(right_obj), negative_shift_length));
ASSERT_FALSE(isSameDirectionShift(isOnRight(right_obj), positive_shift_length));

ObjectData left_obj;
left_obj.direction = route_handler::Direction::LEFT;
left_obj.direction = Direction::LEFT;
ASSERT_TRUE(isSameDirectionShift(isOnRight(left_obj), positive_shift_length));
ASSERT_FALSE(isSameDirectionShift(isOnRight(left_obj), negative_shift_length));
}

TEST(BehaviorPathPlanningAvoidanceUtilsTest, shiftNecessaryTest)
{
ObjectData right_obj;
right_obj.direction = route_handler::Direction::RIGHT;
right_obj.direction = Direction::RIGHT;
const double negative_shift_length = -1.0;
const double positive_shift_length = 1.0;

ASSERT_TRUE(isShiftNecessary(isOnRight(right_obj), positive_shift_length));
ASSERT_FALSE(isShiftNecessary(isOnRight(right_obj), negative_shift_length));

ObjectData left_obj;
left_obj.direction = route_handler::Direction::LEFT;
left_obj.direction = Direction::LEFT;
ASSERT_TRUE(isShiftNecessary(isOnRight(left_obj), negative_shift_length));
ASSERT_FALSE(isShiftNecessary(isOnRight(left_obj), positive_shift_length));
}
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 @@ -37,6 +37,7 @@
<depend>autoware_map_msgs</depend>
<depend>autoware_perception_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>autoware_velocity_smoother</depend>
<depend>behavior_velocity_planner_common</depend>
<depend>diagnostic_msgs</depend>
Expand All @@ -49,7 +50,6 @@
<depend>pluginlib</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>route_handler</depend>
<depend>sensor_msgs</depend>
<depend>tf2</depend>
<depend>tf2_eigen</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<depend>autoware_perception_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>behavior_velocity_crosswalk_module</depend>
<depend>behavior_velocity_planner_common</depend>
<depend>eigen</depend>
Expand All @@ -32,7 +33,6 @@
<depend>pcl_conversions</depend>
<depend>pluginlib</depend>
<depend>rclcpp</depend>
<depend>route_handler</depend>
<depend>sensor_msgs</depend>
<depend>tf2</depend>
<depend>tf2_eigen</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<buildtool_depend>eigen3_cmake_module</buildtool_depend>

<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>behavior_velocity_planner_common</depend>
<depend>eigen</depend>
<depend>geometry_msgs</depend>
Expand All @@ -22,7 +23,6 @@
<depend>motion_utils</depend>
<depend>pluginlib</depend>
<depend>rclcpp</depend>
<depend>route_handler</depend>
<depend>sensor_msgs</depend>
<depend>tf2</depend>
<depend>tier4_autoware_utils</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

<depend>autoware_adapi_v1_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>behavior_velocity_planner_common</depend>
<depend>geometry_msgs</depend>
<depend>lanelet2_extension</depend>
<depend>motion_utils</depend>
<depend>nlohmann-json-dev</depend>
<depend>pluginlib</depend>
<depend>rclcpp</depend>
<depend>route_handler</depend>
<depend>tier4_autoware_utils</depend>
<depend>tier4_planning_msgs</depend>
<depend>tier4_v2x_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>behavior_velocity_crosswalk_module</depend>
<depend>behavior_velocity_planner_common</depend>
<depend>geometry_msgs</depend>
Expand All @@ -26,7 +27,6 @@
<depend>motion_utils</depend>
<depend>pluginlib</depend>
<depend>rclcpp</depend>
<depend>route_handler</depend>
<depend>tier4_autoware_utils</depend>
<depend>vehicle_info_util</depend>
<depend>visualization_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

#ifndef AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_UTILS_HPP_
#define AUTOWARE_PLANNING_TEST_MANAGER__AUTOWARE_PLANNING_TEST_MANAGER_UTILS_HPP_
#include <autoware_route_handler/route_handler.hpp>
#include <planning_test_utils/planning_test_utils.hpp>
#include <route_handler/route_handler.hpp>

#include <autoware_planning_msgs/msg/lanelet_route.hpp>
#include <geometry_msgs/msg/pose.hpp>
Expand All @@ -26,10 +26,10 @@

namespace autoware_planning_test_manager::utils
{
using autoware::route_handler::RouteHandler;
using autoware_planning_msgs::msg::LaneletRoute;
using geometry_msgs::msg::Pose;
using nav_msgs::msg::Odometry;
using route_handler::RouteHandler;
using RouteSections = std::vector<autoware_planning_msgs::msg::LaneletSegment>;

Pose createPoseFromLaneID(const lanelet::Id & lane_id)
Expand Down
2 changes: 1 addition & 1 deletion planning/autoware_planning_test_manager/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<depend>autoware_map_msgs</depend>
<depend>autoware_perception_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>autoware_vehicle_msgs</depend>
<depend>component_interface_specs</depend>
<depend>component_interface_utils</depend>
Expand All @@ -26,7 +27,6 @@
<depend>nav_msgs</depend>
<depend>planning_test_utils</depend>
<depend>rclcpp</depend>
<depend>route_handler</depend>
<depend>tf2_msgs</depend>
<depend>tf2_ros</depend>
<depend>tier4_api_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

<depend>autoware_internal_msgs</depend>
<depend>autoware_planning_msgs</depend>
<depend>autoware_route_handler</depend>
<depend>geometry_msgs</depend>
<depend>lanelet2_extension</depend>
<depend>motion_utils</depend>
<depend>nav_msgs</depend>
<depend>planning_test_utils</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>route_handler</depend>
<depend>std_msgs</depend>
<depend>tier4_autoware_utils</depend>
<depend>tier4_planning_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef REMAINING_DISTANCE_TIME_CALCULATOR_NODE_HPP_
#define REMAINING_DISTANCE_TIME_CALCULATOR_NODE_HPP_

#include <autoware_route_handler/route_handler.hpp>
#include <rclcpp/rclcpp.hpp>
#include <route_handler/route_handler.hpp>

#include <autoware_internal_msgs/msg/mission_remaining_distance_time.hpp>
#include <autoware_map_msgs/msg/lanelet_map_bin.hpp>
Expand Down
Loading
Loading