Skip to content

Commit 6e095de

Browse files
use tier4 autoware utils function to calc quaternion
Signed-off-by: Daniel Sanchez <danielsanchezaran@gmail.com>
1 parent 101fefa commit 6e095de

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

planning/sampling_based_planner/frenet_planner/include/frenet_planner/frenet_planner.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "frenet_planner/structures.hpp"
1919
#include "sampler_common/structures.hpp"
2020
#include "sampler_common/transform/spline_transform.hpp"
21+
#include "tier4_autoware_utils/geometry/geometry.hpp"
2122

2223
#include <optional>
2324
#include <vector>

planning/sampling_based_planner/frenet_planner/src/frenet_planner/frenet_planner.cpp

+1-11
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,6 @@ Path generateCandidate(
150150

151151
void calculateCartesian(const sampler_common::transform::Spline2D & reference, Path & path)
152152
{
153-
auto quaternion_from_rpy = [](double roll, double pitch, double yaw) -> tf2::Quaternion {
154-
tf2::Quaternion quaternion_tf2;
155-
quaternion_tf2.setRPY(roll, pitch, yaw);
156-
return quaternion_tf2;
157-
};
158153
if (!path.frenet_points.empty()) {
159154
path.points.reserve(path.frenet_points.size());
160155
path.yaws.reserve(path.frenet_points.size());
@@ -180,12 +175,7 @@ void calculateCartesian(const sampler_common::transform::Spline2D & reference, P
180175
pose.position.x = it->x();
181176
pose.position.y = it->y();
182177
pose.position.z = 0.0;
183-
184-
const auto pose_quaternion = quaternion_from_rpy(0.0, 0.0, yaw);
185-
pose.orientation.w = pose_quaternion.w();
186-
pose.orientation.x = pose_quaternion.x();
187-
pose.orientation.y = pose_quaternion.y();
188-
pose.orientation.z = pose_quaternion.z();
178+
pose.orientation = tier4_autoware_utils::createQuaternionFromRPY(0.0, 0.0, yaw);
189179
path.poses.push_back(pose);
190180
}
191181
path.yaws.push_back(path.yaws.back());

0 commit comments

Comments
 (0)