Skip to content

Commit ad1be18

Browse files
authored
refactor(motion_utils)!: add autoware prefix and include dir (autowarefoundation#7539)
refactor(motion_utils): add autoware prefix and include dir Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
1 parent 7a3e6ed commit ad1be18

File tree

333 files changed

+1856
-1727
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+1856
-1727
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ common/goal_distance_calculator/** taiki.tanaka@tier4.jp
1919
common/autoware_grid_map_utils/** maxime.clement@tier4.jp
2020
common/interpolation/** fumiya.watanabe@tier4.jp takayuki.murooka@tier4.jp
2121
common/kalman_filter/** koji.minoda@tier4.jp takeshi.ishita@tier4.jp yukihiro.saito@tier4.jp
22-
common/motion_utils/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp mamoru.sobue@tier4.jp satoshi.ota@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp
22+
common/autoware_motion_utils/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp mamoru.sobue@tier4.jp satoshi.ota@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp
2323
common/object_recognition_utils/** satoshi.tanaka@tier4.jp shunsuke.miura@tier4.jp takayuki.murooka@tier4.jp yoshi.ri@tier4.jp
2424
common/osqp_interface/** fumiya.watanabe@tier4.jp maxime.clement@tier4.jp satoshi.ota@tier4.jp takayuki.murooka@tier4.jp
2525
common/path_distance_calculator/** isamu.takagi@tier4.jp

common/.pages

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ nav:
1515
- 'Glog Component': common/glog_component
1616
- 'interpolation': common/interpolation
1717
- 'Kalman Filter': common/kalman_filter
18-
- 'Motion Utils': common/motion_utils
19-
- 'Vehicle Utils': common/motion_utils/docs/vehicle/vehicle
18+
- 'Motion Utils': common/autoware_motion_utils
19+
- 'Vehicle Utils': common/autoware_motion_utils/docs/vehicle/vehicle
2020
- 'Object Recognition Utils': common/object_recognition_utils
2121
- 'OSQP Interface': common/osqp_interface/design/osqp_interface-design
2222
- 'Perception Utils': common/perception_utils

common/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ The Autoware.Universe Common folder consists of common and testing libraries tha
1313
Some of the commonly used libraries are:
1414

1515
1. `autoware_universe_utils`
16-
2. `motion_utils`
16+
2. `autoware_motion_utils`

common/motion_utils/CMakeLists.txt common/autoware_motion_utils/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
cmake_minimum_required(VERSION 3.14)
2-
project(motion_utils)
2+
project(autoware_motion_utils)
33

44
find_package(autoware_cmake REQUIRED)
55
autoware_package()
66

77
find_package(Boost REQUIRED)
88

9-
ament_auto_add_library(motion_utils SHARED
9+
ament_auto_add_library(autoware_motion_utils SHARED
1010
DIRECTORY src
1111
)
1212

@@ -15,10 +15,10 @@ if(BUILD_TESTING)
1515

1616
file(GLOB_RECURSE test_files test/**/*.cpp)
1717

18-
ament_add_ros_isolated_gtest(test_motion_utils ${test_files})
18+
ament_add_ros_isolated_gtest(test_autoware_motion_utils ${test_files})
1919

20-
target_link_libraries(test_motion_utils
21-
motion_utils
20+
target_link_libraries(test_autoware_motion_utils
21+
autoware_motion_utils
2222
)
2323
endif()
2424

common/motion_utils/README.md common/autoware_motion_utils/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,4 @@ const double length_from_ego_to_obj = calcSignedArcLength(points, ego_pose, ego_
114114

115115
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.
116116

117-
`motion_utils.hpp` header file was removed because the source files that directly/indirectly include this file took a long time for preprocessing.
117+
`autoware_motion_utils.hpp` header file was removed because the source files that directly/indirectly include this file took a long time for preprocessing.

common/motion_utils/include/motion_utils/constants.hpp common/autoware_motion_utils/include/autoware/motion_utils/constants.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MOTION_UTILS__CONSTANTS_HPP_
16-
#define MOTION_UTILS__CONSTANTS_HPP_
15+
#ifndef AUTOWARE__MOTION_UTILS__CONSTANTS_HPP_
16+
#define AUTOWARE__MOTION_UTILS__CONSTANTS_HPP_
1717

18-
namespace motion_utils
18+
namespace autoware_motion_utils
1919
{
2020
constexpr double overlap_threshold = 0.1;
21-
} // namespace motion_utils
21+
} // namespace autoware_motion_utils
2222

23-
#endif // MOTION_UTILS__CONSTANTS_HPP_
23+
#endif // AUTOWARE__MOTION_UTILS__CONSTANTS_HPP_

common/motion_utils/include/motion_utils/distance/distance.hpp common/autoware_motion_utils/include/autoware/motion_utils/distance/distance.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MOTION_UTILS__DISTANCE__DISTANCE_HPP_
16-
#define MOTION_UTILS__DISTANCE__DISTANCE_HPP_
15+
#ifndef AUTOWARE__MOTION_UTILS__DISTANCE__DISTANCE_HPP_
16+
#define AUTOWARE__MOTION_UTILS__DISTANCE__DISTANCE_HPP_
1717

1818
#include <algorithm>
1919
#include <cmath>
@@ -22,12 +22,12 @@
2222
#include <tuple>
2323
#include <vector>
2424

25-
namespace motion_utils
25+
namespace autoware_motion_utils
2626
{
2727
std::optional<double> calcDecelDistWithJerkAndAccConstraints(
2828
const double current_vel, const double target_vel, const double current_acc, const double acc_min,
2929
const double jerk_acc, const double jerk_dec);
3030

31-
} // namespace motion_utils
31+
} // namespace autoware_motion_utils
3232

33-
#endif // MOTION_UTILS__DISTANCE__DISTANCE_HPP_
33+
#endif // AUTOWARE__MOTION_UTILS__DISTANCE__DISTANCE_HPP_

common/motion_utils/include/motion_utils/factor/velocity_factor_interface.hpp common/autoware_motion_utils/include/autoware/motion_utils/factor/velocity_factor_interface.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
#ifndef MOTION_UTILS__FACTOR__VELOCITY_FACTOR_INTERFACE_HPP_
17-
#define MOTION_UTILS__FACTOR__VELOCITY_FACTOR_INTERFACE_HPP_
16+
#ifndef AUTOWARE__MOTION_UTILS__FACTOR__VELOCITY_FACTOR_INTERFACE_HPP_
17+
#define AUTOWARE__MOTION_UTILS__FACTOR__VELOCITY_FACTOR_INTERFACE_HPP_
1818

1919
#include <autoware_adapi_v1_msgs/msg/planning_behavior.hpp>
2020
#include <autoware_adapi_v1_msgs/msg/velocity_factor.hpp>
@@ -24,7 +24,7 @@
2424
#include <string>
2525
#include <vector>
2626

27-
namespace motion_utils
27+
namespace autoware_motion_utils
2828
{
2929
using autoware_adapi_v1_msgs::msg::PlanningBehavior;
3030
using autoware_adapi_v1_msgs::msg::VelocityFactor;
@@ -49,6 +49,6 @@ class VelocityFactorInterface
4949
VelocityFactor velocity_factor_{};
5050
};
5151

52-
} // namespace motion_utils
52+
} // namespace autoware_motion_utils
5353

54-
#endif // MOTION_UTILS__FACTOR__VELOCITY_FACTOR_INTERFACE_HPP_
54+
#endif // AUTOWARE__MOTION_UTILS__FACTOR__VELOCITY_FACTOR_INTERFACE_HPP_

common/motion_utils/include/motion_utils/marker/marker_helper.hpp common/autoware_motion_utils/include/autoware/motion_utils/marker/marker_helper.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MOTION_UTILS__MARKER__MARKER_HELPER_HPP_
16-
#define MOTION_UTILS__MARKER__MARKER_HELPER_HPP_
15+
#ifndef AUTOWARE__MOTION_UTILS__MARKER__MARKER_HELPER_HPP_
16+
#define AUTOWARE__MOTION_UTILS__MARKER__MARKER_HELPER_HPP_
1717

1818
#include <rclcpp/time.hpp>
1919

2020
#include <visualization_msgs/msg/marker_array.hpp>
2121

2222
#include <string>
2323

24-
namespace motion_utils
24+
namespace autoware_motion_utils
2525
{
2626
using geometry_msgs::msg::Pose;
2727

@@ -48,6 +48,6 @@ visualization_msgs::msg::MarkerArray createDeletedSlowDownVirtualWallMarker(
4848

4949
visualization_msgs::msg::MarkerArray createDeletedDeadLineVirtualWallMarker(
5050
const rclcpp::Time & now, const int32_t id);
51-
} // namespace motion_utils
51+
} // namespace autoware_motion_utils
5252

53-
#endif // MOTION_UTILS__MARKER__MARKER_HELPER_HPP_
53+
#endif // AUTOWARE__MOTION_UTILS__MARKER__MARKER_HELPER_HPP_

common/motion_utils/include/motion_utils/marker/virtual_wall_marker_creator.hpp common/autoware_motion_utils/include/autoware/motion_utils/marker/virtual_wall_marker_creator.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MOTION_UTILS__MARKER__VIRTUAL_WALL_MARKER_CREATOR_HPP_
16-
#define MOTION_UTILS__MARKER__VIRTUAL_WALL_MARKER_CREATOR_HPP_
15+
#ifndef AUTOWARE__MOTION_UTILS__MARKER__VIRTUAL_WALL_MARKER_CREATOR_HPP_
16+
#define AUTOWARE__MOTION_UTILS__MARKER__VIRTUAL_WALL_MARKER_CREATOR_HPP_
1717

1818
#include <rclcpp/time.hpp>
1919

@@ -25,7 +25,7 @@
2525
#include <unordered_map>
2626
#include <vector>
2727

28-
namespace motion_utils
28+
namespace autoware_motion_utils
2929
{
3030

3131
/// @brief type of virtual wall associated with different marker styles and namespace
@@ -76,6 +76,6 @@ class VirtualWallMarkerCreator
7676
/// @param now current time to be used for displaying the markers
7777
visualization_msgs::msg::MarkerArray create_markers(const rclcpp::Time & now = rclcpp::Time());
7878
};
79-
} // namespace motion_utils
79+
} // namespace autoware_motion_utils
8080

81-
#endif // MOTION_UTILS__MARKER__VIRTUAL_WALL_MARKER_CREATOR_HPP_
81+
#endif // AUTOWARE__MOTION_UTILS__MARKER__VIRTUAL_WALL_MARKER_CREATOR_HPP_

common/motion_utils/include/motion_utils/resample/resample.hpp common/autoware_motion_utils/include/autoware/motion_utils/resample/resample.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_
16-
#define MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_
15+
#ifndef AUTOWARE__MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_
16+
#define AUTOWARE__MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_
1717

1818
#include "autoware_planning_msgs/msg/path.hpp"
1919
#include "autoware_planning_msgs/msg/trajectory.hpp"
2020
#include "tier4_planning_msgs/msg/path_with_lane_id.hpp"
2121

2222
#include <vector>
2323

24-
namespace motion_utils
24+
namespace autoware_motion_utils
2525
{
2626
/**
2727
* @brief A resampling function for a path(points). Note that in a default setting, position xy are
@@ -234,6 +234,6 @@ autoware_planning_msgs::msg::Trajectory resampleTrajectory(
234234
const bool use_akima_spline_for_xy = false, const bool use_lerp_for_z = true,
235235
const bool use_zero_order_hold_for_twist = true,
236236
const bool resample_input_trajectory_stop_point = true);
237-
} // namespace motion_utils
237+
} // namespace autoware_motion_utils
238238

239-
#endif // MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_
239+
#endif // AUTOWARE__MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_

common/motion_utils/include/motion_utils/resample/resample_utils.hpp common/autoware_motion_utils/include/autoware/motion_utils/resample/resample_utils.hpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MOTION_UTILS__RESAMPLE__RESAMPLE_UTILS_HPP_
16-
#define MOTION_UTILS__RESAMPLE__RESAMPLE_UTILS_HPP_
15+
#ifndef AUTOWARE__MOTION_UTILS__RESAMPLE__RESAMPLE_UTILS_HPP_
16+
#define AUTOWARE__MOTION_UTILS__RESAMPLE__RESAMPLE_UTILS_HPP_
1717

1818
#include "autoware/universe_utils/system/backtrace.hpp"
1919

20+
#include <autoware/motion_utils/constants.hpp>
21+
#include <autoware/motion_utils/trajectory/trajectory.hpp>
2022
#include <autoware/universe_utils/geometry/geometry.hpp>
21-
#include <motion_utils/constants.hpp>
22-
#include <motion_utils/trajectory/trajectory.hpp>
2323

2424
#include <vector>
2525

@@ -29,7 +29,7 @@ constexpr double close_s_threshold = 1e-6;
2929

3030
static inline rclcpp::Logger get_logger()
3131
{
32-
constexpr const char * logger{"motion_utils.resample_utils"};
32+
constexpr const char * logger{"autoware_motion_utils.resample_utils"};
3333
return rclcpp::get_logger(logger);
3434
}
3535

@@ -42,7 +42,7 @@ bool validate_size(const T & points)
4242
template <class T>
4343
bool validate_resampling_range(const T & points, const std::vector<double> & resampling_intervals)
4444
{
45-
const double points_length = motion_utils::calcArcLength(points);
45+
const double points_length = autoware_motion_utils::calcArcLength(points);
4646
return points_length >= resampling_intervals.back();
4747
}
4848

@@ -105,10 +105,10 @@ bool validate_arguments(const T & input_points, const double resampling_interval
105105
}
106106

107107
// check resampling interval
108-
if (resampling_interval < motion_utils::overlap_threshold) {
108+
if (resampling_interval < autoware_motion_utils::overlap_threshold) {
109109
RCLCPP_DEBUG(
110110
get_logger(), "invalid argument: resampling interval is less than %f",
111-
motion_utils::overlap_threshold);
111+
autoware_motion_utils::overlap_threshold);
112112
autoware_universe_utils::print_backtrace();
113113
return false;
114114
}
@@ -124,4 +124,4 @@ bool validate_arguments(const T & input_points, const double resampling_interval
124124
}
125125
} // namespace resample_utils
126126

127-
#endif // MOTION_UTILS__RESAMPLE__RESAMPLE_UTILS_HPP_
127+
#endif // AUTOWARE__MOTION_UTILS__RESAMPLE__RESAMPLE_UTILS_HPP_

common/motion_utils/include/motion_utils/trajectory/conversion.hpp common/autoware_motion_utils/include/autoware/motion_utils/trajectory/conversion.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MOTION_UTILS__TRAJECTORY__CONVERSION_HPP_
16-
#define MOTION_UTILS__TRAJECTORY__CONVERSION_HPP_
15+
#ifndef AUTOWARE__MOTION_UTILS__TRAJECTORY__CONVERSION_HPP_
16+
#define AUTOWARE__MOTION_UTILS__TRAJECTORY__CONVERSION_HPP_
1717

1818
#include "autoware_planning_msgs/msg/detail/path__struct.hpp"
1919
#include "autoware_planning_msgs/msg/detail/trajectory__struct.hpp"
@@ -23,7 +23,7 @@
2323

2424
#include <vector>
2525

26-
namespace motion_utils
26+
namespace autoware_motion_utils
2727
{
2828
using TrajectoryPoints = std::vector<autoware_planning_msgs::msg::TrajectoryPoint>;
2929

@@ -115,6 +115,6 @@ inline tier4_planning_msgs::msg::PathWithLaneId convertToPathWithLaneId(
115115
return output;
116116
}
117117

118-
} // namespace motion_utils
118+
} // namespace autoware_motion_utils
119119

120-
#endif // MOTION_UTILS__TRAJECTORY__CONVERSION_HPP_
120+
#endif // AUTOWARE__MOTION_UTILS__TRAJECTORY__CONVERSION_HPP_

common/motion_utils/include/motion_utils/trajectory/interpolation.hpp common/autoware_motion_utils/include/autoware/motion_utils/trajectory/interpolation.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MOTION_UTILS__TRAJECTORY__INTERPOLATION_HPP_
16-
#define MOTION_UTILS__TRAJECTORY__INTERPOLATION_HPP_
15+
#ifndef AUTOWARE__MOTION_UTILS__TRAJECTORY__INTERPOLATION_HPP_
16+
#define AUTOWARE__MOTION_UTILS__TRAJECTORY__INTERPOLATION_HPP_
1717

1818
#include "autoware/universe_utils/geometry/geometry.hpp"
1919

@@ -25,7 +25,7 @@
2525
#include <algorithm>
2626
#include <limits>
2727

28-
namespace motion_utils
28+
namespace autoware_motion_utils
2929
{
3030
/**
3131
* @brief An interpolation function that finds the closest interpolated point on the trajectory from
@@ -91,6 +91,6 @@ geometry_msgs::msg::Pose calcInterpolatedPose(const T & points, const double tar
9191
return autoware_universe_utils::getPose(points.back());
9292
}
9393

94-
} // namespace motion_utils
94+
} // namespace autoware_motion_utils
9595

96-
#endif // MOTION_UTILS__TRAJECTORY__INTERPOLATION_HPP_
96+
#endif // AUTOWARE__MOTION_UTILS__TRAJECTORY__INTERPOLATION_HPP_

common/motion_utils/include/motion_utils/trajectory/path_with_lane_id.hpp common/autoware_motion_utils/include/autoware/motion_utils/trajectory/path_with_lane_id.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_
16-
#define MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_
15+
#ifndef AUTOWARE__MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_
16+
#define AUTOWARE__MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_
1717

1818
#include "tier4_planning_msgs/msg/path_with_lane_id.hpp"
1919
#include <geometry_msgs/msg/point.hpp>
2020

2121
#include <optional>
2222
#include <utility>
23-
namespace motion_utils
23+
namespace autoware_motion_utils
2424
{
2525
std::optional<std::pair<size_t, size_t>> getPathIndexRangeWithLaneId(
2626
const tier4_planning_msgs::msg::PathWithLaneId & path, const int64_t target_lane_id);
@@ -41,6 +41,6 @@ size_t findNearestSegmentIndexFromLaneId(
4141
tier4_planning_msgs::msg::PathWithLaneId convertToRearWheelCenter(
4242
const tier4_planning_msgs::msg::PathWithLaneId & path, const double rear_to_cog,
4343
const bool enable_last_point_compensation = true);
44-
} // namespace motion_utils
44+
} // namespace autoware_motion_utils
4545

46-
#endif // MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_
46+
#endif // AUTOWARE__MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_

0 commit comments

Comments
 (0)