Skip to content

Commit

Permalink
use_yaw_of_initialpose (autowarefoundation#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Kento Yabuuchi <kento.yabuuchi.2@tier4.jp>
  • Loading branch information
KYabuuchi committed Jun 6, 2023
1 parent 1a0e945 commit 3e322b8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ void CameraPoseInitializer::on_service(

const auto query_pos_with_cov = request->pose_with_covariance;
const auto query_pos = request->pose_with_covariance.pose.pose.position;
const auto orientation = request->pose_with_covariance.pose.pose.orientation;
const double yaw_std_rad = std::sqrt(query_pos_with_cov.pose.covariance.at(35));

auto ground_request = std::make_shared<Ground::Request>();
Expand All @@ -214,7 +215,7 @@ void CameraPoseInitializer::on_service(

// Estimate orientation
const auto header = request->pose_with_covariance.header;
double yaw_angle_rad;
double yaw_angle_rad = 2 * std::atan2(orientation.z, orientation.w);
if (estimate_pose(pos_vec3f, yaw_angle_rad, yaw_std_rad)) {
response->success = true;
response->pose_with_covariance =
Expand Down

0 comments on commit 3e322b8

Please sign in to comment.