Skip to content

Commit 440a7d0

Browse files
Merge pull request #1079 from tier4/beta-to-tier4-main-sync
chore: sync beta branch beta/v0.19.0 with tier4/main
2 parents 59a7653 + 15e7690 commit 440a7d0

File tree

416 files changed

+10549
-2641
lines changed

Some content is hidden

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

416 files changed

+10549
-2641
lines changed

.github/CODEOWNERS

+6-1
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,13 @@ perception/traffic_light_multi_camera_fusion/** shunsuke.miura@tier4.jp tao.zhon
154154
perception/traffic_light_occlusion_predictor/** shunsuke.miura@tier4.jp tao.zhong@tier4.jp
155155
perception/traffic_light_ssd_fine_detector/** daisuke.nishimatsu@tier4.jp
156156
perception/traffic_light_visualization/** yukihiro.saito@tier4.jp
157-
planning/behavior_path_planner/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp kyoichi.sugahara@tier4.jp mamoru.sobue@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp zulfaqar.azmi@tier4.jp
157+
planning/behavior_path_avoidance_by_lane_change_module/** fumiya.watanabe@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp zulfaqar.azmi@tier4.jp
158+
planning/behavior_path_avoidance_module/** fumiya.watanabe@tier4.jp kyoichi.sugahara@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp takamasa.horibe@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp
159+
planning/behavior_path_goal_planner_module/** kosuke.takeuchi@tier4.jp kyoichi.sugahara@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp
160+
planning/behavior_path_planner/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp kyoichi.sugahara@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp zulfaqar.azmi@tier4.jp
158161
planning/behavior_path_planner_common/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp mamoru.sobue@tier4.jp maxime.clement@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp zulfaqar.azmi@tier4.jp
162+
planning/behavior_path_side_shift_module/** fumiya.watanabe@tier4.jp kyoichi.sugahara@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp
163+
planning/behavior_path_start_planner_module/** kosuke.takeuchi@tier4.jp kyoichi.sugahara@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp
159164
planning/behavior_velocity_blind_spot_module/** mamoru.sobue@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
160165
planning/behavior_velocity_crosswalk_module/** kyoichi.sugahara@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp
161166
planning/behavior_velocity_detection_area_module/** kyoichi.sugahara@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp

.github/workflows/cancel-previous-workflows.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Cancel previous runs
11-
uses: styfle/cancel-workflow-action@0.11.0
11+
uses: styfle/cancel-workflow-action@0.12.0
1212
with:
1313
workflow_id: all
1414
all_but_latest: true

.github/workflows/github-release.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
echo "tag-name=${REF_NAME#beta/}" >> $GITHUB_OUTPUT
3131
3232
- name: Check out repository
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
with:
3535
fetch-depth: 0
3636
ref: ${{ steps.set-tag-name.outputs.ref-name }}

.github/workflows/pre-commit-optional.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Check out repository
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212
with:
1313
fetch-depth: 0
1414

.github/workflows/pre-commit.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
private_key: ${{ secrets.PRIVATE_KEY }}
1717

1818
- name: Check out repository
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
with:
2121
ref: ${{ github.event.pull_request.head.ref }}
2222

.github/workflows/spell-check-differential.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Check out repository
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212

1313
- name: Run spell-check
1414
uses: autowarefoundation/autoware-github-actions/spell-check@v1

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
#include <geometry_msgs/msg/pose.hpp>
2121
#include <visualization_msgs/msg/marker_array.hpp>
2222

23+
#include <functional>
2324
#include <string>
2425
#include <unordered_map>
2526
#include <vector>
27+
2628
namespace motion_utils
2729
{
2830

@@ -38,7 +40,7 @@ struct VirtualWall
3840
double longitudinal_offset{};
3941
bool is_driving_forward{true};
4042
};
41-
typedef std::vector<VirtualWall> VirtualWalls;
43+
using VirtualWalls = std::vector<VirtualWall>;
4244

4345
/// @brief class to manage the creation of virtual wall markers
4446
/// @details creates both ADD and DELETE markers
@@ -55,8 +57,8 @@ class VirtualWallMarkerCreator
5557
const rclcpp::Time & now, const int32_t id, const double longitudinal_offset,
5658
const std::string & ns_prefix, const bool is_driving_forward)>;
5759

58-
VirtualWalls virtual_walls;
59-
std::unordered_map<std::string, MarkerCount> marker_count_per_namespace;
60+
VirtualWalls virtual_walls_;
61+
std::unordered_map<std::string, MarkerCount> marker_count_per_namespace_;
6062

6163
/// @brief internal cleanup: clear the stored markers and remove unused namespace from the map
6264
void cleanup();

common/motion_utils/include/motion_utils/resample/resample.hpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,10 @@
1515
#ifndef MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_
1616
#define MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_
1717

18-
#include "autoware_auto_planning_msgs/msg/path.hpp"
19-
#include "autoware_auto_planning_msgs/msg/path_with_lane_id.hpp"
20-
#include "autoware_auto_planning_msgs/msg/trajectory.hpp"
18+
#include "autoware_auto_planning_msgs/msg/detail/path__struct.hpp"
19+
#include "autoware_auto_planning_msgs/msg/detail/path_with_lane_id__struct.hpp"
20+
#include "autoware_auto_planning_msgs/msg/detail/trajectory__struct.hpp"
2121

22-
#include <algorithm>
23-
#include <limits>
24-
#include <stdexcept>
2522
#include <vector>
2623

2724
namespace motion_utils
@@ -187,7 +184,8 @@ autoware_auto_planning_msgs::msg::Path resamplePath(
187184
autoware_auto_planning_msgs::msg::Path resamplePath(
188185
const autoware_auto_planning_msgs::msg::Path & input_path, const double resample_interval,
189186
const bool use_akima_spline_for_xy = false, const bool use_lerp_for_z = true,
190-
const bool use_zero_order_hold_for_v = true, const bool resample_input_path_stop_point = true);
187+
const bool use_zero_order_hold_for_twist = true,
188+
const bool resample_input_path_stop_point = true);
191189

192190
/**
193191
* @brief A resampling function for a trajectory. Note that in a default setting, position xy are

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

+6-12
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,19 @@
2323

2424
namespace resample_utils
2525
{
26-
constexpr double CLOSE_S_THRESHOLD = 1e-6;
26+
constexpr double close_s_threshold = 1e-6;
2727

2828
template <class T>
2929
bool validate_size(const T & points)
3030
{
31-
if (points.size() < 2) {
32-
return false;
33-
}
34-
return true;
31+
return points.size() >= 2;
3532
}
3633

3734
template <class T>
3835
bool validate_resampling_range(const T & points, const std::vector<double> & resampling_intervals)
3936
{
4037
const double points_length = motion_utils::calcArcLength(points);
41-
if (points_length < resampling_intervals.back()) {
42-
return false;
43-
}
44-
45-
return true;
38+
return points_length >= resampling_intervals.back();
4639
}
4740

4841
template <class T>
@@ -52,7 +45,7 @@ bool validate_points_duplication(const T & points)
5245
const auto & curr_pt = tier4_autoware_utils::getPoint(points.at(i));
5346
const auto & next_pt = tier4_autoware_utils::getPoint(points.at(i + 1));
5447
const double ds = tier4_autoware_utils::calcDistance2d(curr_pt, next_pt);
55-
if (ds < CLOSE_S_THRESHOLD) {
48+
if (ds < close_s_threshold) {
5649
return false;
5750
}
5851
}
@@ -67,7 +60,8 @@ bool validate_arguments(const T & input_points, const std::vector<double> & resa
6760
if (!validate_size(input_points)) {
6861
std::cerr << "The number of input points is less than 2" << std::endl;
6962
return false;
70-
} else if (!validate_size(resampling_intervals)) {
63+
}
64+
if (!validate_size(resampling_intervals)) {
7165
std::cerr << "The number of resampling intervals is less than 2" << std::endl;
7266
return false;
7367
}

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@
1616
#define MOTION_UTILS__TRAJECTORY__INTERPOLATION_HPP_
1717

1818
#include "tier4_autoware_utils/geometry/geometry.hpp"
19-
#include "tier4_autoware_utils/math/constants.hpp"
2019

21-
#include "autoware_auto_planning_msgs/msg/path_with_lane_id.hpp"
22-
#include "autoware_auto_planning_msgs/msg/trajectory.hpp"
20+
#include "autoware_auto_planning_msgs/msg/detail/path_with_lane_id__struct.hpp"
21+
#include "autoware_auto_planning_msgs/msg/detail/trajectory__struct.hpp"
2322

2423
#include <algorithm>
2524
#include <limits>
26-
#include <optional>
27-
#include <stdexcept>
28-
#include <vector>
2925

3026
namespace motion_utils
3127
{

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#ifndef MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_
1616
#define MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_
1717

18-
#include "autoware_auto_planning_msgs/msg/path_with_lane_id.hpp"
18+
#include "autoware_auto_planning_msgs/msg/detail/path_with_lane_id__struct.hpp"
1919
#include <geometry_msgs/msg/point.hpp>
2020

2121
#include <optional>

common/motion_utils/include/motion_utils/trajectory/tmp_conversion.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
#ifndef MOTION_UTILS__TRAJECTORY__TMP_CONVERSION_HPP_
1616
#define MOTION_UTILS__TRAJECTORY__TMP_CONVERSION_HPP_
1717

18-
#include "autoware_auto_planning_msgs/msg/trajectory.hpp"
19-
#include "autoware_auto_planning_msgs/msg/trajectory_point.hpp"
18+
#include "autoware_auto_planning_msgs/msg/detail/trajectory__struct.hpp"
19+
#include "autoware_auto_planning_msgs/msg/detail/trajectory_point__struct.hpp"
2020

2121
#include <vector>
2222

common/motion_utils/include/motion_utils/trajectory/trajectory.hpp

+29-31
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ std::optional<bool> isDrivingForwardWithTwist(const T & points_with_twist)
130130
if (points_with_twist.size() == 1) {
131131
if (0.0 < tier4_autoware_utils::getLongitudinalVelocity(points_with_twist.front())) {
132132
return true;
133-
} else if (0.0 > tier4_autoware_utils::getLongitudinalVelocity(points_with_twist.front())) {
133+
}
134+
if (0.0 > tier4_autoware_utils::getLongitudinalVelocity(points_with_twist.front())) {
134135
return false;
135-
} else {
136-
return std::nullopt;
137136
}
137+
return std::nullopt;
138138
}
139139

140140
return isDrivingForward(points_with_twist);
@@ -401,12 +401,12 @@ double calcLongitudinalOffsetToSegment(
401401
const bool throw_exception = false)
402402
{
403403
if (seg_idx >= points.size() - 1) {
404-
const std::out_of_range e("Segment index is invalid.");
404+
const auto error_message{"Segment index is invalid."};
405405
tier4_autoware_utils::print_backtrace();
406406
if (throw_exception) {
407-
throw e;
407+
throw std::out_of_range(error_message);
408408
}
409-
std::cerr << e.what() << std::endl;
409+
std::cerr << error_message << std::endl;
410410
return std::nan("");
411411
}
412412

@@ -424,12 +424,12 @@ double calcLongitudinalOffsetToSegment(
424424
}
425425

426426
if (seg_idx >= overlap_removed_points.size() - 1) {
427-
const std::runtime_error e("Same points are given.");
427+
const auto error_message{"Same points are given."};
428428
tier4_autoware_utils::print_backtrace();
429429
if (throw_exception) {
430-
throw e;
430+
throw std::runtime_error(error_message);
431431
}
432-
std::cerr << e.what() << std::endl;
432+
std::cerr << error_message << std::endl;
433433
return std::nan("");
434434
}
435435

@@ -581,12 +581,12 @@ double calcLateralOffset(
581581
}
582582

583583
if (overlap_removed_points.size() == 1) {
584-
const std::runtime_error e("Same points are given.");
584+
const auto error_message{"Same points are given."};
585585
tier4_autoware_utils::print_backtrace();
586586
if (throw_exception) {
587-
throw e;
587+
throw std::runtime_error(error_message);
588588
}
589-
std::cerr << e.what() << std::endl;
589+
std::cerr << error_message << std::endl;
590590
return std::nan("");
591591
}
592592

@@ -643,12 +643,12 @@ double calcLateralOffset(
643643
}
644644

645645
if (overlap_removed_points.size() == 1) {
646-
const std::runtime_error e("Same points are given.");
646+
const auto error_message{"Same points are given."};
647647
tier4_autoware_utils::print_backtrace();
648648
if (throw_exception) {
649-
throw e;
649+
throw std::runtime_error(error_message);
650650
}
651-
std::cerr << e.what() << std::endl;
651+
std::cerr << error_message << std::endl;
652652
return std::nan("");
653653
}
654654

@@ -968,17 +968,17 @@ std::vector<std::pair<double, double>> calcCurvatureAndArcLength(const T & point
968968
{
969969
// Note that arclength is for the segment, not the sum.
970970
std::vector<std::pair<double, double>> curvature_arc_length_vec;
971-
curvature_arc_length_vec.push_back(std::pair(0.0, 0.0));
971+
curvature_arc_length_vec.emplace_back(0.0, 0.0);
972972
for (size_t i = 1; i < points.size() - 1; ++i) {
973973
const auto p1 = tier4_autoware_utils::getPoint(points.at(i - 1));
974974
const auto p2 = tier4_autoware_utils::getPoint(points.at(i));
975975
const auto p3 = tier4_autoware_utils::getPoint(points.at(i + 1));
976976
const double curvature = tier4_autoware_utils::calcCurvature(p1, p2, p3);
977977
const double arc_length = tier4_autoware_utils::calcDistance2d(points.at(i - 1), points.at(i)) +
978978
tier4_autoware_utils::calcDistance2d(points.at(i), points.at(i + 1));
979-
curvature_arc_length_vec.push_back(std::pair(curvature, arc_length));
979+
curvature_arc_length_vec.emplace_back(curvature, arc_length);
980980
}
981-
curvature_arc_length_vec.push_back(std::pair(0.0, 0.0));
981+
curvature_arc_length_vec.emplace_back(0.0, 0.0);
982982

983983
return curvature_arc_length_vec;
984984
}
@@ -1046,12 +1046,12 @@ std::optional<geometry_msgs::msg::Point> calcLongitudinalOffsetPoint(
10461046
}
10471047

10481048
if (points.size() - 1 < src_idx) {
1049-
const auto e = std::out_of_range("Invalid source index");
1049+
const auto error_message{"Invalid source index"};
10501050
tier4_autoware_utils::print_backtrace();
10511051
if (throw_exception) {
1052-
throw e;
1052+
throw std::out_of_range(error_message);
10531053
}
1054-
std::cerr << e.what() << std::endl;
1054+
std::cerr << error_message << std::endl;
10551055
return {};
10561056
}
10571057

@@ -1171,12 +1171,12 @@ std::optional<geometry_msgs::msg::Pose> calcLongitudinalOffsetPose(
11711171
}
11721172

11731173
if (points.size() - 1 < src_idx) {
1174-
const auto e = std::out_of_range("Invalid source index");
1174+
const auto error_message{"Invalid source index"};
11751175
tier4_autoware_utils::print_backtrace();
11761176
if (throw_exception) {
1177-
throw e;
1177+
throw std::out_of_range(error_message);
11781178
}
1179-
std::cerr << e.what() << std::endl;
1179+
std::cerr << error_message << std::endl;
11801180
return {};
11811181
}
11821182

@@ -2041,9 +2041,8 @@ size_t findFirstNearestIndexWithSoftConstraints(
20412041
if (squared_dist_threshold < squared_dist || yaw_threshold < std::abs(yaw)) {
20422042
if (is_within_constraints) {
20432043
break;
2044-
} else {
2045-
continue;
20462044
}
2045+
continue;
20472046
}
20482047

20492048
if (min_squared_dist <= squared_dist) {
@@ -2073,9 +2072,8 @@ size_t findFirstNearestIndexWithSoftConstraints(
20732072
if (squared_dist_threshold < squared_dist) {
20742073
if (is_within_constraints) {
20752074
break;
2076-
} else {
2077-
continue;
20782075
}
2076+
continue;
20792077
}
20802078

20812079
if (min_squared_dist <= squared_dist) {
@@ -2386,12 +2384,12 @@ double calcYawDeviation(
23862384
}
23872385

23882386
if (overlap_removed_points.size() <= 1) {
2389-
const std::runtime_error e("points size is less than 2");
2387+
const auto error_message{"points size is less than 2"};
23902388
tier4_autoware_utils::print_backtrace();
23912389
if (throw_exception) {
2392-
throw e;
2390+
throw std::runtime_error(error_message);
23932391
}
2394-
std::cerr << e.what() << std::endl;
2392+
std::cerr << error_message << std::endl;
23952393
return 0.0;
23962394
}
23972395

common/motion_utils/include/motion_utils/vehicle/vehicle_state_checker.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <nav_msgs/msg/odometry.hpp>
2323

2424
#include <deque>
25-
#include <memory>
2625

2726
namespace motion_utils
2827
{

common/motion_utils/src/distance/distance.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ std::optional<double> calcDecelDistWithJerkAndAccConstraints(
262262
if (t_during_min_acc > epsilon) {
263263
return calcDecelDistPlanType1(
264264
current_vel, target_vel, current_acc, acc_min, jerk_acc, jerk_dec, t_during_min_acc);
265-
} else if (is_decel_needed || current_acc > epsilon) {
265+
}
266+
if (is_decel_needed || current_acc > epsilon) {
266267
return calcDecelDistPlanType2(current_vel, target_vel, current_acc, jerk_acc, jerk_dec);
267268
}
268269

0 commit comments

Comments
 (0)