Skip to content

Commit

Permalink
Merge branch 'main' into refactor/rework_pointcloud_accumulator_param…
Browse files Browse the repository at this point in the history
…eter
  • Loading branch information
vividf authored Sep 12, 2024
2 parents a50b3ff + 6860be8 commit 3b2d5cd
Show file tree
Hide file tree
Showing 706 changed files with 14,974 additions and 10,510 deletions.
2 changes: 0 additions & 2 deletions .cppcheck_suppressions
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
checkersReport
missingInclude
missingIncludeSystem
noConstructor
unknownMacro
unmatchedSuppression
unreadVariable
unusedFunction
useInitializationList
useStlAlgorithm
43 changes: 22 additions & 21 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/cppcheck-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
- name: Upload Cppcheck report
if: ${{ steps.filter-paths-no-cpp-files.outputs.filtered-full-paths != '' }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: cppcheck-report
path: cppcheck-report.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: cppcheck-daily
name: cppcheck-weekly

on:
schedule:
- cron: 0 0 * * *
- cron: 0 0 * * 1
workflow_dispatch:

jobs:
cppcheck-daily:
cppcheck-weekly:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
shell: bash

- name: Upload Cppcheck report
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: cppcheck-report
path: cppcheck-report.xml
Expand Down
2 changes: 1 addition & 1 deletion build_depends.repos
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repositories:
core/autoware_lanelet2_extension:
type: git
url: https://github.com/autowarefoundation/autoware_lanelet2_extension.git
version: 0.5.0
version: 0.6.1
core/autoware.core:
type: git
url: https://github.com/autowarefoundation/autoware.core.git
Expand Down
1 change: 0 additions & 1 deletion common/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ nav:
- 'tier4_camera_view_rviz_plugin': common/tier4_camera_view_rviz_plugin
- 'tier4_datetime_rviz_plugin': common/tier4_datetime_rviz_plugin
- 'tier4_localization_rviz_plugin': common/tier4_localization_rviz_plugin
- 'tier4_perception_rviz_plugin': common/tier4_perception_rviz_plugin
- 'tier4_planning_rviz_plugin': common/tier4_planning_rviz_plugin
- 'tier4_state_rviz_plugin': common/tier4_state_rviz_plugin
- 'tier4_system_rviz_plugin': common/tier4_system_rviz_plugin
Expand Down
13 changes: 0 additions & 13 deletions common/autoware_motion_utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,6 @@ const size_t traffic_obj_nearest_idx = findNearestIndexFromLaneId(path_with_lane
const size_t traffic_obj_nearest_seg_idx = findNearestSegmentIndexFromLaneId(path_with_lane_id, traffic_obj_pos, lane_id);
```

## Path/Trajectory length calculation between designated points

Based on the discussion so far, the nearest index search algorithm is different depending on the object type.
Therefore, we recommended using the wrapper utility functions which require the nearest index search (e.g., calculating the path length) with each nearest index search.

For example, when we want to calculate the path length between the ego and the dynamic object, the implementation is as follows.

```cpp
const size_t ego_nearest_seg_idx = findFirstNearestSegmentIndex(points, ego_pose, ego_nearest_dist_threshold, ego_nearest_yaw_threshold);
const size_t dyn_obj_nearest_seg_idx = findFirstNearestSegmentIndex(points, dyn_obj_pose, dyn_obj_nearest_dist_threshold);
const double length_from_ego_to_obj = calcSignedArcLength(points, ego_pose, ego_nearest_seg_idx, dyn_obj_pose, dyn_obj_nearest_seg_idx);
```

## For developers

Some of the template functions in `trajectory.hpp` are mostly used for specific types (`autoware_planning_msgs::msg::PathPoint`, `autoware_planning_msgs::msg::PathPoint`, `autoware_planning_msgs::msg::TrajectoryPoint`), so they are exported as `extern template` functions to speed-up compilation time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <Eigen/Dense>

#include <memory>
#include <vector>

namespace autoware::motion_utils::trajectory_container::interpolator
Expand All @@ -31,14 +32,9 @@ namespace autoware::motion_utils::trajectory_container::interpolator
*/
class AkimaSpline : public Interpolator<double>
{
template <typename InterpolatorType>
friend class InterpolatorCreator;

private:
Eigen::VectorXd a_, b_, c_, d_; ///< Coefficients for the Akima spline.

AkimaSpline() = default;

/**
* @brief Compute the spline parameters.
*
Expand Down Expand Up @@ -85,12 +81,21 @@ class AkimaSpline : public Interpolator<double>
[[nodiscard]] double compute_second_derivative_impl(const double & s) const override;

public:
AkimaSpline() = default;

/**
* @brief Get the minimum number of required points for the interpolator.
*
* @return The minimum number of required points.
*/
[[nodiscard]] size_t minimum_required_points() const override { return 5; }

/**
* @brief Clone the interpolator.
*
* @return A shared pointer to a new instance of the interpolator.
*/
[[nodiscard]] std::shared_ptr<Interpolator<double>> clone() const override;
};

} // namespace autoware::motion_utils::trajectory_container::interpolator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@ namespace autoware::motion_utils::trajectory_container::interpolator
*/
class CubicSpline : public Interpolator<double>
{
template <typename InterpolatorType>
friend class InterpolatorCreator;

private:
Eigen::VectorXd a_, b_, c_, d_; ///< Coefficients for the cubic spline.
Eigen::VectorXd h_; ///< Interval sizes between axis points.

CubicSpline() = default;

/**
* @brief Compute the spline parameters.
*
Expand Down Expand Up @@ -87,12 +82,21 @@ class CubicSpline : public Interpolator<double>
[[nodiscard]] double compute_second_derivative_impl(const double & s) const override;

public:
CubicSpline() = default;

/**
* @brief Get the minimum number of required points for the interpolator.
*
* @return The minimum number of required points.
*/
[[nodiscard]] size_t minimum_required_points() const override { return 4; }

/**
* @brief Clone the interpolator.
*
* @return A shared pointer to a new instance of the interpolator.
*/
[[nodiscard]] std::shared_ptr<Interpolator<double>> clone() const override;
};

} // namespace autoware::motion_utils::trajectory_container::interpolator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "autoware/motion_utils/trajectory_container/interpolator/detail/interpolator_common_impl.hpp"

#include <memory>

namespace autoware::motion_utils::trajectory_container::interpolator
{
/**
Expand All @@ -29,6 +31,8 @@ namespace autoware::motion_utils::trajectory_container::interpolator
template <typename T>
class Interpolator : public detail::InterpolatorCommonImpl<T>
{
public:
[[nodiscard]] virtual std::shared_ptr<Interpolator<T>> clone() const = 0;
};

/**
Expand Down Expand Up @@ -84,6 +88,8 @@ class Interpolator<double> : public detail::InterpolatorCommonImpl<double>
this->validate_compute_input(s);
return compute_second_derivative_impl(s);
}

[[nodiscard]] virtual std::shared_ptr<Interpolator<double>> clone() const = 0;
};

} // namespace autoware::motion_utils::trajectory_container::interpolator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <Eigen/Dense>

#include <memory>
#include <vector>

namespace autoware::motion_utils::trajectory_container::interpolator
Expand All @@ -31,17 +32,9 @@ namespace autoware::motion_utils::trajectory_container::interpolator
*/
class Linear : public Interpolator<double>
{
template <typename InterpolatorType>
friend class InterpolatorCreator;

private:
Eigen::VectorXd values_; ///< Interpolation values.

/**
* @brief Default constructor.
*/
Linear() = default;

/**
* @brief Build the interpolator with the given values.
*
Expand Down Expand Up @@ -77,12 +70,24 @@ class Linear : public Interpolator<double>
[[nodiscard]] double compute_second_derivative_impl(const double &) const override;

public:
/**
* @brief Default constructor.
*/
Linear() = default;

/**
* @brief Get the minimum number of required points for the interpolator.
*
* @return The minimum number of required points.
*/
[[nodiscard]] size_t minimum_required_points() const override;

/**
* @brief Clone the interpolator.
*
* @return A shared pointer to the cloned interpolator.
*/
[[nodiscard]] std::shared_ptr<Interpolator<double>> clone() const override;
};

} // namespace autoware::motion_utils::trajectory_container::interpolator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "autoware/motion_utils/trajectory_container/interpolator/detail/nearest_neighbor_common_impl.hpp"

#include <memory>

namespace autoware::motion_utils::trajectory_container::interpolator
{

Expand All @@ -40,11 +42,18 @@ class NearestNeighbor;
template <typename T>
class NearestNeighbor : public detail::NearestNeighborCommonImpl<T>
{
template <typename InterpolatorType>
friend class InterpolatorCreator;

private:
public:
NearestNeighbor() = default;

/**
* @brief Clone the interpolator.
*
* @return A shared pointer to a new instance of the interpolator.
*/
[[nodiscard]] std::shared_ptr<Interpolator<double>> clone() const override
{
return std::make_shared<NearestNeighbor<T>>(*this);
}
};

/**
Expand All @@ -55,12 +64,7 @@ class NearestNeighbor : public detail::NearestNeighborCommonImpl<T>
template <>
class NearestNeighbor<double> : public detail::NearestNeighborCommonImpl<double>
{
template <typename InterpolatorType>
friend class InterpolatorCreator;

private:
NearestNeighbor() = default;

/**
* @brief Compute the first derivative at the given point.
*
Expand All @@ -76,6 +80,19 @@ class NearestNeighbor<double> : public detail::NearestNeighborCommonImpl<double>
* @return The second derivative.
*/
[[nodiscard]] double compute_second_derivative_impl(const double &) const override { return 0.0; }

public:
NearestNeighbor() = default;

/**
* @brief Clone the interpolator.
*
* @return A shared pointer to a new instance of the interpolator.
*/
[[nodiscard]] std::shared_ptr<Interpolator<double>> clone() const override
{
return std::make_shared<NearestNeighbor<double>>(*this);
}
};

} // namespace autoware::motion_utils::trajectory_container::interpolator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

#include "autoware/motion_utils/trajectory_container/interpolator/detail/stairstep_common_impl.hpp"

#include <memory>

namespace autoware::motion_utils::trajectory_container::interpolator
{

Expand All @@ -40,11 +42,18 @@ class Stairstep;
template <typename T>
class Stairstep : public detail::StairstepCommonImpl<T>
{
template <typename InterpolatorType>
friend class InterpolatorCreator;

private:
public:
Stairstep() = default;

/**
* @brief Clone the interpolator.
*
* @return A shared pointer to a new instance of the interpolator.
*/
[[nodiscard]] std::shared_ptr<Interpolator<T>> clone() const override
{
return std::make_shared<Stairstep<T>>(*this);
}
};

/**
Expand All @@ -55,11 +64,7 @@ class Stairstep : public detail::StairstepCommonImpl<T>
template <>
class Stairstep<double> : public detail::StairstepCommonImpl<double>
{
template <typename InterpolatorType>
friend class InterpolatorCreator;

private:
Stairstep() = default;
/**
* @brief Compute the first derivative at the given point.
*
Expand All @@ -75,6 +80,19 @@ class Stairstep<double> : public detail::StairstepCommonImpl<double>
* @return The second derivative.
*/
[[nodiscard]] double compute_second_derivative_impl(const double &) const override { return 0.0; }

public:
Stairstep() = default;

/**
* @brief Clone the interpolator.
*
* @return A shared pointer to a new instance of the interpolator.
*/
[[nodiscard]] std::shared_ptr<Interpolator<double>> clone() const override
{
return std::make_shared<Stairstep<double>>(*this);
}
};

} // namespace autoware::motion_utils::trajectory_container::interpolator
Expand Down
Loading

0 comments on commit 3b2d5cd

Please sign in to comment.