Skip to content

Commit

Permalink
refactor(behavior_path_sampling_planner_module): add autoware prefix (#…
Browse files Browse the repository at this point in the history
…7392)

Signed-off-by: Maxime CLEMENT <[email protected]>
  • Loading branch information
maxime-clem authored Jun 11, 2024
1 parent afc129e commit adde8e1
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ planning/autoware_velocity_smoother/** [email protected] makoto.kurihara@
planning/autoware_behavior_path_goal_planner_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_behavior_path_lane_change_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_planner/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_sampling_planner_module/** [email protected] [email protected]
planning/autoware_behavior_path_sampling_planner_module/** [email protected] [email protected]
planning/autoware_behavior_path_side_shift_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_behavior_path_start_planner_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/autoware_behavior_path_side_shift_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
/>
<let
name="behavior_path_planner_launch_modules"
value="$(eval &quot;'$(var behavior_path_planner_launch_modules)' + 'behavior_path_planner::SamplingPlannerModuleManager, '&quot;)"
value="$(eval &quot;'$(var behavior_path_planner_launch_modules)' + 'autoware::behavior_path_planner::SamplingPlannerModuleManager, '&quot;)"
if="$(var launch_sampling_planner_module)"
/>
<let
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(behavior_path_sampling_planner_module)
project(autoware_behavior_path_sampling_planner_module)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_
#define BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_
#ifndef AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_
#define AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_

#include "autoware_behavior_path_planner_common/interface/scene_module_manager_interface.hpp"
#include "behavior_path_sampling_planner_module/sampling_planner_module.hpp"
#include "behavior_path_sampling_planner_module/sampling_planner_parameters.hpp"
#include "autoware_behavior_path_sampling_planner_module/sampling_planner_module.hpp"
#include "autoware_behavior_path_sampling_planner_module/sampling_planner_parameters.hpp"

#include <rclcpp/rclcpp.hpp>

Expand All @@ -26,9 +26,10 @@
#include <unordered_map>
#include <vector>

namespace behavior_path_planner
namespace autoware::behavior_path_planner
{

using namespace ::behavior_path_planner; // NOLINT TODO(Maxime): remove once moved to autoware
// namespace
class SamplingPlannerModuleManager : public SceneModuleManagerInterface
{
public:
Expand All @@ -49,6 +50,6 @@ class SamplingPlannerModuleManager : public SceneModuleManagerInterface
std::shared_ptr<SamplingPlannerParameters> parameters_;
};

} // namespace behavior_path_planner
} // namespace autoware::behavior_path_planner

#endif // BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_
#endif // AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_
#define BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_
#ifndef AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_
#define AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_

#include "autoware_behavior_path_planner_common/interface/scene_module_interface.hpp"
#include "autoware_behavior_path_planner_common/marker_utils/utils.hpp"
#include "autoware_behavior_path_planner_common/utils/drivable_area_expansion/drivable_area_expansion.hpp"
#include "autoware_behavior_path_planner_common/utils/drivable_area_expansion/static_drivable_area.hpp"
#include "autoware_behavior_path_planner_common/utils/path_utils.hpp"
#include "autoware_behavior_path_planner_common/utils/utils.hpp"
#include "autoware_behavior_path_sampling_planner_module/sampling_planner_parameters.hpp"
#include "autoware_behavior_path_sampling_planner_module/util.hpp"
#include "autoware_bezier_sampler/bezier_sampling.hpp"
#include "autoware_frenet_planner/frenet_planner.hpp"
#include "autoware_sampler_common/constraints/footprint.hpp"
Expand All @@ -29,8 +31,6 @@
#include "autoware_sampler_common/structures.hpp"
#include "autoware_sampler_common/transform/spline_transform.hpp"
#include "autoware_vehicle_info_utils/vehicle_info_utils.hpp"
#include "behavior_path_sampling_planner_module/sampling_planner_parameters.hpp"
#include "behavior_path_sampling_planner_module/util.hpp"
#include "lanelet2_extension/utility/query.hpp"
#include "lanelet2_extension/utility/utilities.hpp"
#include "motion_utils/trajectory/path_with_lane_id.hpp"
Expand All @@ -56,8 +56,11 @@
#include <unordered_map>
#include <utility>
#include <vector>
namespace behavior_path_planner
namespace autoware::behavior_path_planner
{
// NOLINT
using namespace ::behavior_path_planner; // NOLINT TODO(Maxime): remove once moved to autoware
// namespace
using autoware_planning_msgs::msg::TrajectoryPoint;
struct SamplingPlannerData
{
Expand Down Expand Up @@ -142,8 +145,8 @@ class SamplingPlannerModule : public SceneModuleInterface
}

SamplingPlannerDebugData debug_data_;
behavior_path_planner::HardConstraintsFunctionVector hard_constraints_;
behavior_path_planner::SoftConstraintsFunctionVector soft_constraints_;
HardConstraintsFunctionVector hard_constraints_;
SoftConstraintsFunctionVector soft_constraints_;

private:
SamplingPlannerData createPlannerData(
Expand Down Expand Up @@ -261,6 +264,6 @@ class SamplingPlannerModule : public SceneModuleInterface
const std::shared_ptr<const PlannerData> & planner_data) const;
};

} // namespace behavior_path_planner
} // namespace autoware::behavior_path_planner

#endif // BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_
#endif // AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_
#define BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_
#ifndef AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_
#define AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_

#include "autoware_bezier_sampler/bezier_sampling.hpp"
#include "autoware_sampler_common/structures.hpp"

#include <vector>
namespace behavior_path_planner
namespace autoware::behavior_path_planner
{
using tier4_autoware_utils::LinearRing2d;
using tier4_autoware_utils::MultiPoint2d;
Expand Down Expand Up @@ -87,5 +87,5 @@ struct SamplingPlannerInternalParameters
Sampling sampling;
Preprocessing preprocessing{};
};
} // namespace behavior_path_planner
#endif // BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_
} // namespace autoware::behavior_path_planner
#endif // AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_
#define BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_
#ifndef AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_
#define AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_
#include "autoware_sampler_common/structures.hpp"
#include "autoware_sampler_common/transform/spline_transform.hpp"

Expand All @@ -26,9 +26,10 @@
#include <numeric>
#include <optional>
#include <vector>
namespace behavior_path_planner
namespace autoware::behavior_path_planner
{

using namespace ::behavior_path_planner; // NOLINT TODO(Maxime): remove once moved to autoware
// namespace
using geometry_msgs::msg::Pose;

struct SoftConstraintsInputs
Expand All @@ -38,8 +39,8 @@ struct SoftConstraintsInputs
lanelet::ArcCoordinates ego_arc;
lanelet::ArcCoordinates goal_arc;
lanelet::ConstLanelets closest_lanelets_to_goal;
behavior_path_planner::PlanResult reference_path;
behavior_path_planner::PlanResult prev_module_path;
PlanResult reference_path;
PlanResult prev_module_path;
std::optional<autoware::sampler_common::Path> prev_path;
lanelet::ConstLanelets current_lanes;
};
Expand Down Expand Up @@ -101,6 +102,6 @@ inline autoware::sampler_common::State getInitialState(
return initial_state;
}

} // namespace behavior_path_planner
} // namespace autoware::behavior_path_planner

#endif // BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_
#endif // AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_
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_path_sampling_planner_module</name>
<name>autoware_behavior_path_sampling_planner_module</name>
<version>0.1.0</version>
<description>The behavior_path_sampling_planner_module package</description>
<description>The autoware_behavior_path_sampling_planner_module package</description>

<maintainer email="[email protected]">Daniel Sanchez</maintainer>
<maintainer email="[email protected]">Maxime Clement</maintainer>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<library path="autoware_behavior_path_sampling_planner_module">
<class type="autoware::behavior_path_planner::SamplingPlannerModuleManager" base_class_type="behavior_path_planner::SceneModuleManagerInterface"/>
</library>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "behavior_path_sampling_planner_module/manager.hpp"
#include "autoware_behavior_path_sampling_planner_module/manager.hpp"

#include "tier4_autoware_utils/ros/update_param.hpp"

Expand All @@ -22,7 +22,7 @@
#include <string>
#include <vector>

namespace behavior_path_planner
namespace autoware::behavior_path_planner
{

void SamplingPlannerModuleManager::init(rclcpp::Node * node)
Expand Down Expand Up @@ -134,9 +134,9 @@ void SamplingPlannerModuleManager::updateModuleParams(
});
}

} // namespace behavior_path_planner
} // namespace autoware::behavior_path_planner

#include <pluginlib/class_list_macros.hpp>
PLUGINLIB_EXPORT_CLASS(
behavior_path_planner::SamplingPlannerModuleManager,
behavior_path_planner::SceneModuleManagerInterface)
autoware::behavior_path_planner::SamplingPlannerModuleManager,
::behavior_path_planner::SceneModuleManagerInterface)
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "behavior_path_sampling_planner_module/sampling_planner_module.hpp"
#include "autoware_behavior_path_sampling_planner_module/sampling_planner_module.hpp"

namespace behavior_path_planner
namespace autoware::behavior_path_planner
{
using geometry_msgs::msg::Point;
using motion_utils::calcSignedArcLength;
Expand Down Expand Up @@ -267,7 +267,7 @@ bool SamplingPlannerModule::isReferencePathSafe() const
const auto footprint = autoware::sampler_common::constraints::buildFootprintPoints(
reference_path, internal_params_->constraints);

behavior_path_planner::HardConstraintsFunctionVector hard_constraints_reference_path;
HardConstraintsFunctionVector hard_constraints_reference_path;
hard_constraints_reference_path.emplace_back(
[](
autoware::sampler_common::Path & path,
Expand Down Expand Up @@ -415,8 +415,7 @@ BehaviorModuleOutput SamplingPlannerModule::plan()
autoware::frenet_planner::SamplingParameters sampling_parameters;

const auto & pose = planner_data_->self_odometry->pose.pose;
autoware::sampler_common::State initial_state =
behavior_path_planner::getInitialState(pose, reference_spline);
autoware::sampler_common::State initial_state = getInitialState(pose, reference_spline);
sampling_parameters =
prepareSamplingParameters(initial_state, reference_spline, *internal_params_);

Expand Down Expand Up @@ -546,8 +545,7 @@ BehaviorModuleOutput SamplingPlannerModule::plan()
const auto reused_path = get_subset(prev_path_frenet, reuse_idx);

geometry_msgs::msg::Pose future_pose = reused_path.poses.back();
autoware::sampler_common::State future_state =
behavior_path_planner::getInitialState(future_pose, reference_spline);
autoware::sampler_common::State future_state = getInitialState(future_pose, reference_spline);
autoware::frenet_planner::FrenetState frenet_reuse_state;

set_frenet_state(future_state, reference_spline, frenet_reuse_state);
Expand Down Expand Up @@ -984,4 +982,4 @@ autoware::frenet_planner::SamplingParameters SamplingPlannerModule::prepareSampl
return sampling_parameters;
}

} // namespace behavior_path_planner
} // namespace autoware::behavior_path_planner
3 changes: 0 additions & 3 deletions planning/behavior_path_sampling_planner_module/plugins.xml

This file was deleted.

0 comments on commit adde8e1

Please sign in to comment.