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

chore: sync upstream #1078

Merged
merged 88 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
a1f354d
fix(ekf_localizer): correct the calculation of delay_step in updateMe…
TaikiYamada4 Dec 6, 2023
ea958a2
fix(start_planner): check safety only when waiting approval (#5792)
kyoichi-sugahara Dec 6, 2023
ab4a3eb
feat(start_planner): add surround moving obstacle check (#5782)
kyoichi-sugahara Dec 6, 2023
13d45ae
refactor(avoidance, avoidance_by_lane_change): separate package (#5790)
satoshi-ota Dec 7, 2023
c95b997
chore: update CODEOWNERS (#5800)
awf-autoware-bot[bot] Dec 7, 2023
dd0d6eb
refactor(motion_velocity_smoother): boost::optional to std::optional …
zulfaqar-azmi-t4 Dec 7, 2023
49c95d1
refactor(start_planner, goal_planner): separate package (#5802)
kyoichi-sugahara Dec 7, 2023
3ec6201
fix(avoidance): fix invalid optional access (#5804)
satoshi-ota Dec 7, 2023
566c57f
refactor(behavior_path_planner): delete unnecessary TODO (#5806)
kyoichi-sugahara Dec 7, 2023
089e8f2
chore(bpp): update maintainer (#5809)
satoshi-ota Dec 8, 2023
795d787
fix(crosswalk_traffic_light_estimator): add operation to remove traff…
ktro2828 Dec 8, 2023
aeb461a
refactor(multi_object_tracker): put node parameters to yaml file (#5769)
YoshiRi Dec 8, 2023
0e9d1f0
chore(crosswalk): update comments (#5813)
yuki-takagi-66 Dec 8, 2023
f582b5a
refactor(motion_utils): stop using CAPACITY from Trajectory message (…
maxime-clem Dec 8, 2023
1bac0bf
fix: add missing param on perception launch: (#5812)
technolojin Dec 8, 2023
1f7ad17
refactor(lane_change): move lane change param (#5807)
satoshi-ota Dec 8, 2023
055bc9d
fix(ekf_localizer): correct the initialization of accumulated_delay_t…
TaikiYamada4 Dec 8, 2023
9b4cd9c
feat(system_diagnostic_graph): support config override and add tests …
isamu-takagi Dec 8, 2023
64d12e6
fix(autoware_auto_msgs_adapter): fix predicted path test (#5744)
isamu-takagi Dec 8, 2023
41e5903
refactor(side_shift): separate side shift module (#5820)
satoshi-ota Dec 9, 2023
851de09
fix(avoidance): output invalid avoidance path with unsafe state (#5689)
satoshi-ota Dec 10, 2023
281f1ec
chore: update CODEOWNERS (#5811)
awf-autoware-bot[bot] Dec 10, 2023
89d4462
fix(localization_util): fixed rejection criteria of SmartPoseBuffer::…
SakodaShintaro Dec 11, 2023
32712ab
fix(lidar_centerpoint,image_projection_based_fusion): add guard to av…
wep21 Dec 11, 2023
f41d3fa
feat(obstacle_cruise_planner): add jerk and acc limits for slow-down …
danielsanchezaran Dec 11, 2023
5d6cfef
fix(traffic_light): stop if the traffic light signal timed out (#5819)
rej55 Dec 11, 2023
e58eac5
feat(multi_object_tracker): add debugger output processing_time/cycli…
YoshiRi Dec 11, 2023
4f7e895
refactor(surround_obstacle_checker): boost::optional to std:optional …
zulfaqar-azmi-t4 Dec 11, 2023
5af6f44
docs(intersection): add image (#5833)
soblin Dec 11, 2023
91290a3
fix(avoidance): reset output path when the module transits success st…
satoshi-ota Dec 11, 2023
14e84ee
refactor(motion_utils): apply clang-tidy result (#5829)
zulfaqar-azmi-t4 Dec 11, 2023
8cd0628
fix(avoidance): fix missing parent ids (#5838)
satoshi-ota Dec 11, 2023
84b658b
feat(radar_threshold_filter): add unit test (#5817)
N-Eiki Dec 11, 2023
012fb51
fix(goal_planner): fix checkOriginalGoalIsInShoulder (#5836)
kosuke55 Dec 12, 2023
4a0c837
refactor(occlusion_spot): boost::optional to std::optional (#5832)
zulfaqar-azmi-t4 Dec 12, 2023
6533c72
fix(planning): fix typo (#5841)
satoshi-ota Dec 12, 2023
2da91e9
fix(landmark_manager): changed to a shared library (#5848)
SakodaShintaro Dec 12, 2023
3e62ad4
refactor(localization_launch, ground_segmentation_launch): rename lid…
YamatoAndo Dec 12, 2023
6d62096
feat(multi_object_tracker): enable to output perception topic delay w…
YoshiRi Dec 12, 2023
68b4132
feat(system_error_monitor): aggregate control validator diagnostics (…
kosuke55 Dec 12, 2023
341d35e
feat(rtc_interface): add publisher to publish auto mode status (#5845)
kyoichi-sugahara Dec 12, 2023
dd3050a
build(detection_by_tracker): move utils.hpp file to the detection_by_…
esteve Dec 12, 2023
c3dcd81
refactor(blind_spot_module): boost::optional to std::optional (#5831)
zulfaqar-azmi-t4 Dec 13, 2023
705a70d
feat(tracking_object_merger): check motion direction and yaw directio…
YoshiRi Dec 13, 2023
a25114a
fix(behavior, launch): fix launch error (#5847)
satoshi-ota Dec 13, 2023
b4ba3e1
refactor(avoidance): use drivable bound to calculate road shoulder di…
satoshi-ota Dec 13, 2023
1de8fc5
fix(multi_object_tracker): fix typo in node yaml parameter (#5856)
YoshiRi Dec 13, 2023
5723f72
feat: add Planning Msg Adapter (#5814)
shulanbushangshu Dec 13, 2023
7477e9a
chore: add glog_component for pointcloud_container (#5716)
badai-nguyen Dec 13, 2023
dff91ba
refactor(ar_tag_based_localizer): refactor pub/sub and so on (#5854)
SakodaShintaro Dec 14, 2023
3d40702
feat(shape_estimation): add bicycle shape corrector (#5860)
kaancolak Dec 14, 2023
d4d632a
feat(simple_planning_simulator): add mesurent_steer_bias (#5868)
kosuke55 Dec 14, 2023
4fc8a4e
feat(diagnostic_graph_aggregator): rename system_diagnostic_graph pac…
isamu-takagi Dec 14, 2023
1b6cc51
refactor(lane_change): separate lane change and external request (#5850)
zulfaqar-azmi-t4 Dec 14, 2023
2252226
feat(diagnostic_graph_aggregator): change default publish rate (#5872)
isamu-takagi Dec 14, 2023
4cd4688
build(detected_object_validation): move header files to a separate di…
esteve Dec 14, 2023
0ae2685
fix(traffic_light_visualization): move header directory to match pack…
esteve Dec 14, 2023
34241d6
refactor(compare_map_segmentation): rework parameters (#5005)
yuntianyi-chen Dec 15, 2023
1f82854
feat(behavior_velocity_planner_common): add objects_of_interest_marke…
rej55 Dec 15, 2023
57278db
refactor(behavior_path_planner): move utils function to `behavior_pat…
satoshi-ota Dec 15, 2023
f2cc50c
chore: sync files (#5600)
awf-autoware-bot[bot] Dec 15, 2023
7ce87a4
feat(crosswalk): ignore predicted path going across the crosswalk (#5…
soblin Dec 15, 2023
cc0b108
refactor(image_projection_based_fusion): add JSON Schema and remove d…
ktro2828 Dec 15, 2023
88dae03
fix(avoidance): fix unexpected sudden deceleration for avoidance mane…
satoshi-ota Dec 15, 2023
a661585
fix(goal_planner): set rederence path for candidate path (#5886)
kosuke55 Dec 15, 2023
a5d5479
fix(avoidance): check far objects during shifting (#5857)
satoshi-ota Dec 15, 2023
ad9778e
perf(run_out): improve calculation cost of smoothPath (#5885)
takayuki5168 Dec 15, 2023
90d5b94
feat(planning_debug_utils): add update_logger_level.sh (#5888)
takayuki5168 Dec 16, 2023
2175b57
fix(static_drivable_area_expansion): fix bug in expansion logic for h…
satoshi-ota Dec 17, 2023
0b58725
chore(motion_velocity_smoother): remove unnecessary info of non auton…
takayuki5168 Dec 18, 2023
68e7434
refactor(behavior_path_planner): remove use_experimental_lane_change_…
takayuki5168 Dec 18, 2023
d06e42f
perf(planning_debug_tools): improve calculation time of perception_re…
takayuki5168 Dec 18, 2023
37573e5
fix(avoidance): unintentional path cut (#5887)
satoshi-ota Dec 18, 2023
5a2da99
chore: add maintainer in map packages (#5865)
KYabuuchi Dec 18, 2023
a38d1db
chore(crosswalk): remove debug print (#5896)
soblin Dec 18, 2023
81f5c4b
feat(pid_longitudinal_controller): change the condition from emergenc…
takayuki5168 Dec 18, 2023
e6b41a8
chore(behavior_velocity_planner): use DEBUG for launching modules (#5…
takayuki5168 Dec 18, 2023
b9fa290
fix(intersection): generate yield stuck detect area from multiple lan…
soblin Dec 18, 2023
f40425b
refactor(lane_change): standardizing lane change logger name (#5899)
zulfaqar-azmi-t4 Dec 18, 2023
320bc2f
chore(map_loader): visualize crosswalk id (#5880)
TakaHoribe Dec 18, 2023
1837f6b
feat(dynamic_avoidance): always launch the module when requested (#5900)
takayuki5168 Dec 19, 2023
7faeb91
docs(raw_vehicle_cmd_converter): update readme (#5822)
TakaHoribe Dec 19, 2023
e935b3e
feat(run_out)!: ignore the collision points on crosswalk (#5862)
yuki-takagi-66 Dec 19, 2023
1b17959
fix(dynamic_avoidance): fix drivable area generation during LC (#5902)
takayuki5168 Dec 19, 2023
a427d29
feat(dynamic_avoidance): deal with forked path of the same directiona…
takayuki5168 Dec 19, 2023
a4ef3a0
chore(crosswalk, obstacle_cruise): add maintainer (#5898)
yuki-takagi-66 Dec 19, 2023
c9b9fca
refactor(avoidance_by_lane_change): update execution condition (#5869)
zulfaqar-azmi-t4 Dec 19, 2023
4b3da5d
Merge remote-tracking branch 'origin/beta/v0.19.0' into sync-upstream
TakaHoribe Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,13 @@ perception/traffic_light_multi_camera_fusion/** [email protected] tao.zhon
perception/traffic_light_occlusion_predictor/** [email protected] [email protected]
perception/traffic_light_ssd_fine_detector/** [email protected]
perception/traffic_light_visualization/** [email protected]
planning/behavior_path_planner/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_avoidance_by_lane_change_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_avoidance_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_goal_planner_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_planner/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_planner_common/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_side_shift_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_path_start_planner_module/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_blind_spot_module/** [email protected] [email protected] [email protected]
planning/behavior_velocity_crosswalk_module/** [email protected] [email protected] [email protected] [email protected] [email protected]
planning/behavior_velocity_detection_area_module/** [email protected] [email protected] [email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cancel-previous-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.0
with:
workflow_id: all
all_but_latest: true
2 changes: 1 addition & 1 deletion .github/workflows/github-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
echo "tag-name=${REF_NAME#beta/}" >> $GITHUB_OUTPUT

- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ steps.set-tag-name.outputs.ref-name }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-optional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
private_key: ${{ secrets.PRIVATE_KEY }}

- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spell-check-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run spell-check
uses: autowarefoundation/autoware-github-actions/spell-check@v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
#include <geometry_msgs/msg/pose.hpp>
#include <visualization_msgs/msg/marker_array.hpp>

#include <functional>
#include <string>
#include <unordered_map>
#include <vector>

namespace motion_utils
{

Expand All @@ -38,7 +40,7 @@ struct VirtualWall
double longitudinal_offset{};
bool is_driving_forward{true};
};
typedef std::vector<VirtualWall> VirtualWalls;
using VirtualWalls = std::vector<VirtualWall>;

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

VirtualWalls virtual_walls;
std::unordered_map<std::string, MarkerCount> marker_count_per_namespace;
VirtualWalls virtual_walls_;
std::unordered_map<std::string, MarkerCount> marker_count_per_namespace_;

/// @brief internal cleanup: clear the stored markers and remove unused namespace from the map
void cleanup();
Expand Down
12 changes: 5 additions & 7 deletions common/motion_utils/include/motion_utils/resample/resample.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
#ifndef MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_
#define MOTION_UTILS__RESAMPLE__RESAMPLE_HPP_

#include "autoware_auto_planning_msgs/msg/path.hpp"
#include "autoware_auto_planning_msgs/msg/path_with_lane_id.hpp"
#include "autoware_auto_planning_msgs/msg/trajectory.hpp"
#include "autoware_auto_planning_msgs/msg/detail/path__struct.hpp"
#include "autoware_auto_planning_msgs/msg/detail/path_with_lane_id__struct.hpp"
#include "autoware_auto_planning_msgs/msg/detail/trajectory__struct.hpp"

#include <algorithm>
#include <limits>
#include <stdexcept>
#include <vector>

namespace motion_utils
Expand Down Expand Up @@ -187,7 +184,8 @@ autoware_auto_planning_msgs::msg::Path resamplePath(
autoware_auto_planning_msgs::msg::Path resamplePath(
const autoware_auto_planning_msgs::msg::Path & input_path, const double resample_interval,
const bool use_akima_spline_for_xy = false, const bool use_lerp_for_z = true,
const bool use_zero_order_hold_for_v = true, const bool resample_input_path_stop_point = true);
const bool use_zero_order_hold_for_twist = true,
const bool resample_input_path_stop_point = true);

/**
* @brief A resampling function for a trajectory. Note that in a default setting, position xy are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,19 @@

namespace resample_utils
{
constexpr double CLOSE_S_THRESHOLD = 1e-6;
constexpr double close_s_threshold = 1e-6;

template <class T>
bool validate_size(const T & points)
{
if (points.size() < 2) {
return false;
}
return true;
return points.size() >= 2;
}

template <class T>
bool validate_resampling_range(const T & points, const std::vector<double> & resampling_intervals)
{
const double points_length = motion_utils::calcArcLength(points);
if (points_length < resampling_intervals.back()) {
return false;
}

return true;
return points_length >= resampling_intervals.back();
}

template <class T>
Expand All @@ -52,7 +45,7 @@ bool validate_points_duplication(const T & points)
const auto & curr_pt = tier4_autoware_utils::getPoint(points.at(i));
const auto & next_pt = tier4_autoware_utils::getPoint(points.at(i + 1));
const double ds = tier4_autoware_utils::calcDistance2d(curr_pt, next_pt);
if (ds < CLOSE_S_THRESHOLD) {
if (ds < close_s_threshold) {
return false;
}
}
Expand All @@ -67,7 +60,8 @@ bool validate_arguments(const T & input_points, const std::vector<double> & resa
if (!validate_size(input_points)) {
std::cerr << "The number of input points is less than 2" << std::endl;
return false;
} else if (!validate_size(resampling_intervals)) {
}
if (!validate_size(resampling_intervals)) {
std::cerr << "The number of resampling intervals is less than 2" << std::endl;
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@
#define MOTION_UTILS__TRAJECTORY__INTERPOLATION_HPP_

#include "tier4_autoware_utils/geometry/geometry.hpp"
#include "tier4_autoware_utils/math/constants.hpp"

#include "autoware_auto_planning_msgs/msg/path_with_lane_id.hpp"
#include "autoware_auto_planning_msgs/msg/trajectory.hpp"
#include "autoware_auto_planning_msgs/msg/detail/path_with_lane_id__struct.hpp"
#include "autoware_auto_planning_msgs/msg/detail/trajectory__struct.hpp"

#include <algorithm>
#include <limits>
#include <optional>
#include <stdexcept>
#include <vector>

namespace motion_utils
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_
#define MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_

#include "autoware_auto_planning_msgs/msg/path_with_lane_id.hpp"
#include "autoware_auto_planning_msgs/msg/detail/path_with_lane_id__struct.hpp"
#include <geometry_msgs/msg/point.hpp>

#include <optional>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef MOTION_UTILS__TRAJECTORY__TMP_CONVERSION_HPP_
#define MOTION_UTILS__TRAJECTORY__TMP_CONVERSION_HPP_

#include "autoware_auto_planning_msgs/msg/trajectory.hpp"
#include "autoware_auto_planning_msgs/msg/trajectory_point.hpp"
#include "autoware_auto_planning_msgs/msg/detail/trajectory__struct.hpp"
#include "autoware_auto_planning_msgs/msg/detail/trajectory_point__struct.hpp"

#include <vector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ std::optional<bool> isDrivingForwardWithTwist(const T & points_with_twist)
if (points_with_twist.size() == 1) {
if (0.0 < tier4_autoware_utils::getLongitudinalVelocity(points_with_twist.front())) {
return true;
} else if (0.0 > tier4_autoware_utils::getLongitudinalVelocity(points_with_twist.front())) {
}
if (0.0 > tier4_autoware_utils::getLongitudinalVelocity(points_with_twist.front())) {
return false;
} else {
return std::nullopt;
}
return std::nullopt;
}

return isDrivingForward(points_with_twist);
Expand Down Expand Up @@ -401,12 +401,12 @@ double calcLongitudinalOffsetToSegment(
const bool throw_exception = false)
{
if (seg_idx >= points.size() - 1) {
const std::out_of_range e("Segment index is invalid.");
const auto error_message{"Segment index is invalid."};
tier4_autoware_utils::print_backtrace();
if (throw_exception) {
throw e;
throw std::out_of_range(error_message);
}
std::cerr << e.what() << std::endl;
std::cerr << error_message << std::endl;
return std::nan("");
}

Expand All @@ -424,12 +424,12 @@ double calcLongitudinalOffsetToSegment(
}

if (seg_idx >= overlap_removed_points.size() - 1) {
const std::runtime_error e("Same points are given.");
const auto error_message{"Same points are given."};
tier4_autoware_utils::print_backtrace();
if (throw_exception) {
throw e;
throw std::runtime_error(error_message);
}
std::cerr << e.what() << std::endl;
std::cerr << error_message << std::endl;
return std::nan("");
}

Expand Down Expand Up @@ -581,12 +581,12 @@ double calcLateralOffset(
}

if (overlap_removed_points.size() == 1) {
const std::runtime_error e("Same points are given.");
const auto error_message{"Same points are given."};
tier4_autoware_utils::print_backtrace();
if (throw_exception) {
throw e;
throw std::runtime_error(error_message);
}
std::cerr << e.what() << std::endl;
std::cerr << error_message << std::endl;
return std::nan("");
}

Expand Down Expand Up @@ -643,12 +643,12 @@ double calcLateralOffset(
}

if (overlap_removed_points.size() == 1) {
const std::runtime_error e("Same points are given.");
const auto error_message{"Same points are given."};
tier4_autoware_utils::print_backtrace();
if (throw_exception) {
throw e;
throw std::runtime_error(error_message);
}
std::cerr << e.what() << std::endl;
std::cerr << error_message << std::endl;
return std::nan("");
}

Expand Down Expand Up @@ -968,17 +968,17 @@ std::vector<std::pair<double, double>> calcCurvatureAndArcLength(const T & point
{
// Note that arclength is for the segment, not the sum.
std::vector<std::pair<double, double>> curvature_arc_length_vec;
curvature_arc_length_vec.push_back(std::pair(0.0, 0.0));
curvature_arc_length_vec.emplace_back(0.0, 0.0);
for (size_t i = 1; i < points.size() - 1; ++i) {
const auto p1 = tier4_autoware_utils::getPoint(points.at(i - 1));
const auto p2 = tier4_autoware_utils::getPoint(points.at(i));
const auto p3 = tier4_autoware_utils::getPoint(points.at(i + 1));
const double curvature = tier4_autoware_utils::calcCurvature(p1, p2, p3);
const double arc_length = tier4_autoware_utils::calcDistance2d(points.at(i - 1), points.at(i)) +
tier4_autoware_utils::calcDistance2d(points.at(i), points.at(i + 1));
curvature_arc_length_vec.push_back(std::pair(curvature, arc_length));
curvature_arc_length_vec.emplace_back(curvature, arc_length);
}
curvature_arc_length_vec.push_back(std::pair(0.0, 0.0));
curvature_arc_length_vec.emplace_back(0.0, 0.0);

return curvature_arc_length_vec;
}
Expand Down Expand Up @@ -1046,12 +1046,12 @@ std::optional<geometry_msgs::msg::Point> calcLongitudinalOffsetPoint(
}

if (points.size() - 1 < src_idx) {
const auto e = std::out_of_range("Invalid source index");
const auto error_message{"Invalid source index"};
tier4_autoware_utils::print_backtrace();
if (throw_exception) {
throw e;
throw std::out_of_range(error_message);
}
std::cerr << e.what() << std::endl;
std::cerr << error_message << std::endl;
return {};
}

Expand Down Expand Up @@ -1171,12 +1171,12 @@ std::optional<geometry_msgs::msg::Pose> calcLongitudinalOffsetPose(
}

if (points.size() - 1 < src_idx) {
const auto e = std::out_of_range("Invalid source index");
const auto error_message{"Invalid source index"};
tier4_autoware_utils::print_backtrace();
if (throw_exception) {
throw e;
throw std::out_of_range(error_message);
}
std::cerr << e.what() << std::endl;
std::cerr << error_message << std::endl;
return {};
}

Expand Down Expand Up @@ -2041,9 +2041,8 @@ size_t findFirstNearestIndexWithSoftConstraints(
if (squared_dist_threshold < squared_dist || yaw_threshold < std::abs(yaw)) {
if (is_within_constraints) {
break;
} else {
continue;
}
continue;
}

if (min_squared_dist <= squared_dist) {
Expand Down Expand Up @@ -2073,9 +2072,8 @@ size_t findFirstNearestIndexWithSoftConstraints(
if (squared_dist_threshold < squared_dist) {
if (is_within_constraints) {
break;
} else {
continue;
}
continue;
}

if (min_squared_dist <= squared_dist) {
Expand Down Expand Up @@ -2386,12 +2384,12 @@ double calcYawDeviation(
}

if (overlap_removed_points.size() <= 1) {
const std::runtime_error e("points size is less than 2");
const auto error_message{"points size is less than 2"};
tier4_autoware_utils::print_backtrace();
if (throw_exception) {
throw e;
throw std::runtime_error(error_message);
}
std::cerr << e.what() << std::endl;
std::cerr << error_message << std::endl;
return 0.0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <nav_msgs/msg/odometry.hpp>

#include <deque>
#include <memory>

namespace motion_utils
{
Expand Down
3 changes: 2 additions & 1 deletion common/motion_utils/src/distance/distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ std::optional<double> calcDecelDistWithJerkAndAccConstraints(
if (t_during_min_acc > epsilon) {
return calcDecelDistPlanType1(
current_vel, target_vel, current_acc, acc_min, jerk_acc, jerk_dec, t_during_min_acc);
} else if (is_decel_needed || current_acc > epsilon) {
}
if (is_decel_needed || current_acc > epsilon) {
return calcDecelDistPlanType2(current_vel, target_vel, current_acc, jerk_acc, jerk_dec);
}

Expand Down
Loading
Loading