Commit cd577d0 1 parent eae7bea commit cd577d0 Copy full SHA for cd577d0
File tree 3 files changed +37
-9
lines changed
common/autoware_trajectory
include/autoware/trajectory/interpolator
3 files changed +37
-9
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,8 @@ struct InterpolationFailure
30
30
const std::string what;
31
31
};
32
32
33
- inline InterpolationFailure operator +(
34
- const InterpolationFailure & primary, const InterpolationFailure & nested)
35
- {
36
- return InterpolationFailure{primary.what + " ==> " + nested.what };
37
- }
33
+ InterpolationFailure operator +(
34
+ const InterpolationFailure & primary, const InterpolationFailure & nested);
38
35
39
36
using InterpolationResult = tl::expected<InterpolationSuccess, InterpolationFailure>;
40
37
Original file line number Diff line number Diff line change
1
+ // Copyright 2025 TIER IV, Inc.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ #include " autoware/trajectory/interpolator/result.hpp"
16
+
17
+ #include < iostream>
18
+ #include < sstream>
19
+
20
+ namespace autoware ::trajectory::interpolator
21
+ {
22
+
23
+ InterpolationFailure operator +(
24
+ const InterpolationFailure & primary, const InterpolationFailure & nested)
25
+ {
26
+ std::stringstream ss;
27
+ ss << primary.what << " ." << std::endl << " \t Reason: " << nested.what << std::endl;
28
+ return InterpolationFailure{ss.str ()};
29
+ }
30
+
31
+ } // namespace autoware::trajectory::interpolator
Original file line number Diff line number Diff line change @@ -106,25 +106,25 @@ interpolator::InterpolationResult Trajectory<PointType>::build(
106
106
bases_, std::move (longitudinal_velocity_mps_values));
107
107
!result) {
108
108
return tl::unexpected (interpolator::InterpolationFailure{
109
- " failed to interpolate TrajectoryPoint::longitudinal_velocity_mps_values " });
109
+ " failed to interpolate TrajectoryPoint::longitudinal_velocity_mps " });
110
110
}
111
111
if (const auto result =
112
112
this ->lateral_velocity_mps ().build (bases_, std::move (lateral_velocity_mps_values));
113
113
!result) {
114
114
return tl::unexpected (interpolator::InterpolationFailure{
115
- " failed to interpolate TrajectoryPoint::lateral_velocity_mps_values " });
115
+ " failed to interpolate TrajectoryPoint::lateral_velocity_mps " });
116
116
}
117
117
if (const auto result =
118
118
this ->heading_rate_rps ().build (bases_, std::move (heading_rate_rps_values));
119
119
!result) {
120
120
return tl::unexpected (interpolator::InterpolationFailure{
121
- " failed to interpolate TrajectoryPoint::heading_rate_rps_values " });
121
+ " failed to interpolate TrajectoryPoint::heading_rate_rps " });
122
122
}
123
123
if (const auto result =
124
124
this ->acceleration_mps2 ().build (bases_, std::move (acceleration_mps2_values));
125
125
!result) {
126
126
return tl::unexpected (interpolator::InterpolationFailure{
127
- " failed to interpolate TrajectoryPoint::acceleration_mps2_values " });
127
+ " failed to interpolate TrajectoryPoint::acceleration_mps2 " });
128
128
}
129
129
if (const auto result =
130
130
this ->front_wheel_angle_rad ().build (bases_, std::move (front_wheel_angle_rad_values));
You can’t perform that action at this time.
0 commit comments