Skip to content

Commit

Permalink
refactor(behavior velocity intersection)!: prefix package and namespa…
Browse files Browse the repository at this point in the history
…ce with autoware_ (#7315)

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
  • Loading branch information
soblin authored Jun 7, 2024
1 parent e24f48d commit e752cad
Show file tree
Hide file tree
Showing 54 changed files with 212 additions and 255 deletions.
2 changes: 1 addition & 1 deletion planning/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ nav:
- 'Crosswalk': planning/behavior_velocity_crosswalk_module
- 'Detection Area': planning/behavior_velocity_detection_area_module
- 'Dynamic Obstacle Stop': planning/behavior_velocity_dynamic_obstacle_stop_module
- 'Intersection': planning/behavior_velocity_intersection_module
- 'Intersection': planning/autoware_behavior_velocity_intersection_module
- 'No Drivable Lane': planning/behavior_velocity_no_drivable_lane_module
- 'No Stopping Area': planning/behavior_velocity_no_stopping_area_module
- 'Occlusion Spot': planning/behavior_velocity_occlusion_spot_module
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_intersection_module)
project(autoware_behavior_velocity_intersection_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_intersection_module</name>
<name>autoware_behavior_velocity_intersection_module</name>
<version>0.1.0</version>
<description>The behavior_velocity_intersection_module package</description>
<description>The autoware_behavior_velocity_intersection_module package</description>

<maintainer email="mamoru.sobue@tier4.jp">Mamoru Sobue</maintainer>
<maintainer email="takayuki.murooka@tier4.jp">Takayuki Murooka</maintainer>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<library path="autoware_behavior_velocity_intersection_module">
<class type="autoware::behavior_velocity_planner::IntersectionModulePlugin" base_class_type="autoware::behavior_velocity_planner::PluginInterface"/>
<class type="autoware::behavior_velocity_planner::MergeFromPrivateModulePlugin" base_class_type="autoware::behavior_velocity_planner::PluginInterface"/>
</library>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "decision_result.hpp"

namespace behavior_velocity_planner::intersection
namespace behavior_velocity_planner
{
std::string formatDecisionResult(const DecisionResult & decision_result)
{
Expand Down Expand Up @@ -65,4 +65,4 @@ std::string formatDecisionResult(const DecisionResult & decision_result)
return "";
}

} // namespace behavior_velocity_planner::intersection
} // namespace behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <string>
#include <variant>

namespace behavior_velocity_planner::intersection
namespace behavior_velocity_planner
{

/**
Expand Down Expand Up @@ -172,6 +172,6 @@ using DecisionResult = std::variant<

std::string formatDecisionResult(const DecisionResult & decision_result);

} // namespace behavior_velocity_planner::intersection
} // namespace behavior_velocity_planner

#endif // DECISION_RESULT_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <set>
#include <utility>

namespace behavior_velocity_planner::intersection
namespace behavior_velocity_planner
{

/**
Expand All @@ -43,6 +43,6 @@ struct InterpolatedPathInfo
std::optional<std::pair<size_t, size_t>> lane_id_interval{std::nullopt};
};

} // namespace behavior_velocity_planner::intersection
} // namespace behavior_velocity_planner

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

#include <string>

namespace behavior_velocity_planner::intersection
namespace behavior_velocity_planner
{

void IntersectionLanelets::update(
Expand Down Expand Up @@ -79,4 +79,4 @@ void IntersectionLanelets::update(
}
}
}
} // namespace behavior_velocity_planner::intersection
} // namespace behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <optional>
#include <vector>

namespace behavior_velocity_planner::intersection
namespace behavior_velocity_planner
{

/**
Expand Down Expand Up @@ -190,6 +190,6 @@ struct PathLanelets
// conflicting lanelets plus the next lane part of the
// path
};
} // namespace behavior_velocity_planner::intersection
} // namespace behavior_velocity_planner

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

#include <optional>

namespace behavior_velocity_planner::intersection
namespace behavior_velocity_planner
{

/**
Expand Down Expand Up @@ -72,6 +72,6 @@ struct IntersectionStopLines
*/
size_t occlusion_wo_tl_pass_judge_line{0};
};
} // namespace behavior_velocity_planner::intersection
} // namespace behavior_velocity_planner

#endif // INTERSECTION_STOPLINES_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ tier4_autoware_utils::Polygon2d createOneStepPolygon(

} // namespace

namespace behavior_velocity_planner::intersection
namespace behavior_velocity_planner
{
namespace bg = boost::geometry;

Expand Down Expand Up @@ -201,7 +201,7 @@ std::shared_ptr<ObjectInfo> ObjectInfoManager::registerObject(
const bool belong_intersection_area, const bool is_parked_vehicle)
{
if (objects_info_.count(uuid) == 0) {
auto object = std::make_shared<intersection::ObjectInfo>(uuid);
auto object = std::make_shared<ObjectInfo>(uuid);
objects_info_[uuid] = object;
}
auto object = objects_info_[uuid];
Expand All @@ -219,7 +219,7 @@ std::shared_ptr<ObjectInfo> ObjectInfoManager::registerObject(
void ObjectInfoManager::registerExistingObject(
const unique_identifier_msgs::msg::UUID & uuid, const bool belong_attention_area,
const bool belong_intersection_area, const bool is_parked_vehicle,
std::shared_ptr<intersection::ObjectInfo> object)
std::shared_ptr<ObjectInfo> object)
{
objects_info_[uuid] = object;
if (belong_attention_area) {
Expand Down Expand Up @@ -249,7 +249,7 @@ std::vector<std::shared_ptr<ObjectInfo>> ObjectInfoManager::allObjects() const
return all_objects;
}

std::optional<intersection::CollisionInterval> findPassageInterval(
std::optional<CollisionInterval> findPassageInterval(
const autoware_perception_msgs::msg::PredictedPath & predicted_path,
const autoware_perception_msgs::msg::Shape & shape, const lanelet::BasicPolygon2d & ego_lane_poly,
const std::optional<lanelet::ConstLanelet> & first_attention_lane_opt,
Expand Down Expand Up @@ -284,25 +284,25 @@ std::optional<intersection::CollisionInterval> findPassageInterval(
if (lanelet::geometry::inside(
first_attention_lane_opt.value(),
lanelet::BasicPoint2d(first_itr->position.x, first_itr->position.y))) {
return intersection::CollisionInterval::LanePosition::FIRST;
return CollisionInterval::LanePosition::FIRST;
}
}
if (second_attention_lane_opt) {
if (lanelet::geometry::inside(
second_attention_lane_opt.value(),
lanelet::BasicPoint2d(first_itr->position.x, first_itr->position.y))) {
return intersection::CollisionInterval::LanePosition::SECOND;
return CollisionInterval::LanePosition::SECOND;
}
}
return intersection::CollisionInterval::LanePosition::ELSE;
return CollisionInterval::LanePosition::ELSE;
}();

std::vector<geometry_msgs::msg::Pose> path;
for (const auto & pose : predicted_path.path) {
path.push_back(pose);
}
return intersection::CollisionInterval{
return CollisionInterval{
lane_position, path, {enter_idx, exit_idx}, {object_enter_time, object_exit_time}};
}

} // namespace behavior_velocity_planner::intersection
} // namespace behavior_velocity_planner
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct hash<unique_identifier_msgs::msg::UUID>
};
} // namespace std

namespace behavior_velocity_planner::intersection
namespace behavior_velocity_planner
{

/**
Expand Down Expand Up @@ -234,8 +234,7 @@ class ObjectInfoManager

void registerExistingObject(
const unique_identifier_msgs::msg::UUID & uuid, const bool belong_attention_area,
const bool belong_intersection_area, const bool is_parked,
std::shared_ptr<intersection::ObjectInfo> object);
const bool belong_intersection_area, const bool is_parked, std::shared_ptr<ObjectInfo> object);

void clearObjects();

Expand Down Expand Up @@ -282,12 +281,12 @@ class ObjectInfoManager
/**
* @brief return the CollisionInterval struct if the predicted path collides ego path geometrically
*/
std::optional<intersection::CollisionInterval> findPassageInterval(
std::optional<CollisionInterval> findPassageInterval(
const autoware_perception_msgs::msg::PredictedPath & predicted_path,
const autoware_perception_msgs::msg::Shape & shape, const lanelet::BasicPolygon2d & ego_lane_poly,
const std::optional<lanelet::ConstLanelet> & first_attention_lane_opt,
const std::optional<lanelet::ConstLanelet> & second_attention_lane_opt);

} // namespace behavior_velocity_planner::intersection
} // namespace behavior_velocity_planner

#endif // OBJECT_MANAGER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <utility>
#include <variant>

namespace behavior_velocity_planner::intersection
namespace behavior_velocity_planner
{

template <typename Ok, typename Error>
Expand Down Expand Up @@ -48,6 +48,6 @@ Result<Ok, Error> make_err(Args &&... args)
return Result<Ok, Error>(Error{std::forward<Args>(args)...});
}

} // namespace behavior_velocity_planner::intersection
} // namespace behavior_velocity_planner

#endif // RESULT_HPP_
Loading

0 comments on commit e752cad

Please sign in to comment.