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

feat(autoware_trajectory): change default value of min_points #9315

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Trajectory<autoware_planning_msgs::msg::PathPoint>
* @param min_points Minimum number of points
* @return Vector of points
*/
[[nodiscard]] std::vector<PointType> restore(const size_t & min_points = 100) const;
[[nodiscard]] std::vector<PointType> restore(const size_t & min_points = 4) const;

class Builder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Trajectory<tier4_planning_msgs::msg::PathPointWithLaneId>
* @param min_points Minimum number of points
* @return Vector of points
*/
[[nodiscard]] std::vector<PointType> restore(const size_t & min_points = 100) const;
[[nodiscard]] std::vector<PointType> restore(const size_t & min_points = 4) const;

class Builder
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
using trajectory::detail::to_point;
Eigen::Vector2d point(to_point(p).x, to_point(p).y);
std::vector<double> distances_from_segments;
std::vector<double> lengthes_from_start_points;

Check warning on line 125 in common/autoware_trajectory/include/autoware/trajectory/point.hpp

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (lengthes)

auto axis = detail::crop_bases(bases_, start_, end_);

Expand All @@ -149,7 +149,7 @@
}
if (constraints(length_from_start_point)) {
distances_from_segments.push_back(distance_from_segment);
lengthes_from_start_points.push_back(length_from_start_point);

Check warning on line 152 in common/autoware_trajectory/include/autoware/trajectory/point.hpp

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (lengthes)
}
}
if (distances_from_segments.empty()) {
Expand All @@ -158,7 +158,7 @@

auto min_it = std::min_element(distances_from_segments.begin(), distances_from_segments.end());

return lengthes_from_start_points[std::distance(distances_from_segments.begin(), min_it)] -

Check warning on line 161 in common/autoware_trajectory/include/autoware/trajectory/point.hpp

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (lengthes)
start_;
}

Expand Down Expand Up @@ -244,7 +244,7 @@
* @param min_points Minimum number of points
* @return Vector of points
*/
[[nodiscard]] std::vector<PointType> restore(const size_t & min_points = 100) const;
[[nodiscard]] std::vector<PointType> restore(const size_t & min_points = 4) const;

void crop(const double & start, const double & length);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Trajectory<geometry_msgs::msg::Pose> : public Trajectory<geometry_msgs::ms
* @brief Restore the trajectory poses
* @return Vector of poses
*/
[[nodiscard]] std::vector<PointType> restore(const size_t & min_points = 100) const;
[[nodiscard]] std::vector<PointType> restore(const size_t & min_points = 4) const;

/**
* @brief Align the orientation with the direction
Expand Down
Loading