Skip to content

Commit a443210

Browse files
authored
feat(ndt_scan_matcher): change from TP to NVTL for determination of initial position estimation results (#7141)
* feat(ndt_scan_matcher): change from TP to NVTL Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> * fix(ndt_scan_matcher): fixed typo Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp> --------- Signed-off-by: RyuYamamoto <ryu.yamamoto@tier4.jp>
1 parent da61a2f commit a443210

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

localization/ndt_scan_matcher/src/ndt_scan_matcher_core.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -1068,8 +1068,8 @@ geometry_msgs::msg::PoseWithCovarianceStamped NDTScanMatcher::align_pose(
10681068
const pclomp::NdtResult ndt_result = ndt_ptr_->getResult();
10691069

10701070
Particle particle(
1071-
initial_pose, matrix4f_to_pose(ndt_result.pose), ndt_result.transform_probability,
1072-
ndt_result.iteration_num);
1071+
initial_pose, matrix4f_to_pose(ndt_result.pose),
1072+
ndt_result.nearest_voxel_transformation_likelihood, ndt_result.iteration_num);
10731073
particle_array.push_back(particle);
10741074
push_debug_markers(marker_array, get_clock()->now(), param_.frame.map_frame, particle, i);
10751075
if (
@@ -1101,6 +1101,13 @@ geometry_msgs::msg::PoseWithCovarianceStamped NDTScanMatcher::align_pose(
11011101
std::begin(particle_array), std::end(particle_array),
11021102
[](const Particle & lhs, const Particle & rhs) { return lhs.score < rhs.score; });
11031103

1104+
if (
1105+
best_particle_ptr->score <
1106+
param_.score_estimation.converged_param_nearest_voxel_transformation_likelihood)
1107+
RCLCPP_WARN_STREAM(
1108+
this->get_logger(),
1109+
"Initial Pose Estimation is Unstable. Score is " << best_particle_ptr->score);
1110+
11041111
geometry_msgs::msg::PoseWithCovarianceStamped result_pose_with_cov_msg;
11051112
result_pose_with_cov_msg.header.stamp = initial_pose_with_cov.header.stamp;
11061113
result_pose_with_cov_msg.header.frame_id = param_.frame.map_frame;

0 commit comments

Comments
 (0)