Skip to content

Commit

Permalink
fix(autoware_frenet_planner): fix unusedFunction (#8788)
Browse files Browse the repository at this point in the history
fix: unusedFunction

Signed-off-by: bathteayo <[email protected]>
  • Loading branch information
bathteayo authored Sep 6, 2024
1 parent e228eeb commit 49773d9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Trajectory> 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<Trajectory> 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<Path> generatePaths(
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,45 +33,6 @@

namespace autoware::frenet_planner
{
std::vector<Trajectory> generateTrajectories(
const autoware::sampler_common::transform::Spline2D & reference_spline,
const FrenetState & initial_state, const SamplingParameters & sampling_parameters)
{
std::vector<Trajectory> 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<Trajectory> generateLowVelocityTrajectories(
const autoware::sampler_common::transform::Spline2D & reference_spline,
const FrenetState & initial_state, const SamplingParameters & sampling_parameters)
{
std::vector<Trajectory> 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<Path> generatePaths(
const autoware::sampler_common::transform::Spline2D & reference_spline,
const FrenetState & initial_state, const SamplingParameters & sampling_parameters)
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 49773d9

Please sign in to comment.