From 49773d92d48a9dc8d35362b32e34502ecdc31256 Mon Sep 17 00:00:00 2001 From: Hayate TOBA <105347690+bathteayo@users.noreply.github.com> Date: Fri, 6 Sep 2024 19:13:14 +0900 Subject: [PATCH] fix(autoware_frenet_planner): fix unusedFunction (#8788) fix: unusedFunction Signed-off-by: bathteayo <105347690+bathteayo@users.noreply.github.com> --- .../frenet_planner.hpp | 16 ----- .../src/frenet_planner/frenet_planner.cpp | 63 ------------------- 2 files changed, 79 deletions(-) diff --git a/planning/sampling_based_planner/autoware_frenet_planner/include/autoware_frenet_planner/frenet_planner.hpp b/planning/sampling_based_planner/autoware_frenet_planner/include/autoware_frenet_planner/frenet_planner.hpp index 0dd4c74ddbb06..e2b63f6591463 100644 --- a/planning/sampling_based_planner/autoware_frenet_planner/include/autoware_frenet_planner/frenet_planner.hpp +++ b/planning/sampling_based_planner/autoware_frenet_planner/include/autoware_frenet_planner/frenet_planner.hpp @@ -25,16 +25,6 @@ namespace autoware::frenet_planner { -/// @brief generate trajectories relative to the reference for the given initial state and sampling -/// parameters -std::vector generateTrajectories( - const autoware::sampler_common::transform::Spline2D & reference_spline, - const FrenetState & initial_state, const SamplingParameters & sampling_parameters); -/// @brief generate trajectories relative to the reference for the given initial state and sampling -/// parameters -std::vector generateLowVelocityTrajectories( - const autoware::sampler_common::transform::Spline2D & reference_spline, - const FrenetState & initial_state, const SamplingParameters & sampling_parameters); /// @brief generate paths relative to the reference for the given initial state and sampling /// parameters std::vector generatePaths( @@ -51,12 +41,6 @@ Path generateCandidate( Trajectory generateCandidate( const FrenetState & initial_state, const FrenetState & target_state, const double duration, const double time_resolution); -/// @brief generate a low velocity candidate trajectory -/// @details the polynomial for lateral motion (d) is calculated over the longitudinal displacement -/// (s) rather than over time: d(s) and s(t). -Trajectory generateLowVelocityCandidate( - const FrenetState & initial_state, const FrenetState & target_state, const double duration, - const double time_resolution); /// @brief calculate the cartesian frame of the given path void calculateCartesian( const autoware::sampler_common::transform::Spline2D & reference, Path & path); diff --git a/planning/sampling_based_planner/autoware_frenet_planner/src/frenet_planner/frenet_planner.cpp b/planning/sampling_based_planner/autoware_frenet_planner/src/frenet_planner/frenet_planner.cpp index 1e04db2a17eee..d53fc1cb1726f 100644 --- a/planning/sampling_based_planner/autoware_frenet_planner/src/frenet_planner/frenet_planner.cpp +++ b/planning/sampling_based_planner/autoware_frenet_planner/src/frenet_planner/frenet_planner.cpp @@ -33,45 +33,6 @@ namespace autoware::frenet_planner { -std::vector generateTrajectories( - const autoware::sampler_common::transform::Spline2D & reference_spline, - const FrenetState & initial_state, const SamplingParameters & sampling_parameters) -{ - std::vector trajectories; - trajectories.reserve(sampling_parameters.parameters.size()); - for (const auto & parameter : sampling_parameters.parameters) { - auto trajectory = generateCandidate( - initial_state, parameter.target_state, parameter.target_duration, - sampling_parameters.resolution); - trajectory.sampling_parameter = parameter; - calculateCartesian(reference_spline, trajectory); - std::stringstream ss; - ss << parameter; - trajectory.tag = ss.str(); - trajectories.push_back(trajectory); - } - return trajectories; -} - -std::vector generateLowVelocityTrajectories( - const autoware::sampler_common::transform::Spline2D & reference_spline, - const FrenetState & initial_state, const SamplingParameters & sampling_parameters) -{ - std::vector trajectories; - trajectories.reserve(sampling_parameters.parameters.size()); - for (const auto & parameter : sampling_parameters.parameters) { - auto trajectory = generateLowVelocityCandidate( - initial_state, parameter.target_state, parameter.target_duration, - sampling_parameters.resolution); - calculateCartesian(reference_spline, trajectory); - std::stringstream ss; - ss << parameter; - trajectory.tag = ss.str(); - trajectories.push_back(trajectory); - } - return trajectories; -} - std::vector generatePaths( const autoware::sampler_common::transform::Spline2D & reference_spline, const FrenetState & initial_state, const SamplingParameters & sampling_parameters) @@ -108,30 +69,6 @@ Trajectory generateCandidate( return trajectory; } -Trajectory generateLowVelocityCandidate( - const FrenetState & initial_state, const FrenetState & target_state, const double duration, - const double time_resolution) -{ - Trajectory trajectory; - trajectory.longitudinal_polynomial = Polynomial( - initial_state.position.s, initial_state.longitudinal_velocity, - initial_state.longitudinal_acceleration, target_state.position.s, - target_state.longitudinal_velocity, target_state.longitudinal_acceleration, duration); - const auto delta_s = target_state.position.s - initial_state.position.s; - trajectory.lateral_polynomial = Polynomial( - initial_state.position.d, initial_state.lateral_velocity, initial_state.lateral_acceleration, - target_state.position.d, target_state.lateral_velocity, target_state.lateral_acceleration, - delta_s); - for (double t = 0.0; t <= duration; t += time_resolution) { - trajectory.times.push_back(t); - const auto s = trajectory.longitudinal_polynomial->position(t); - const auto ds = s - initial_state.position.s; - const auto d = trajectory.lateral_polynomial->position(ds); - trajectory.frenet_points.emplace_back(s, d); - } - return trajectory; -} - Path generateCandidate( const FrenetState & initial_state, const FrenetState & target_state, const double s_resolution) {