DRAFT nav2-amcl-0.1.7.inc: Fix compile error

This commit is contained in:
JeongBong Seo 2019-04-22 11:38:23 +09:00 committed by Herb Kuta
parent d996762c63
commit f74f6e43fb
2 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,7 @@
# Copyright (c) 2019 LG Electronics, Inc.
FILESEXTRAPATHS_prepend := "${THISDIR}/nav2-amcl:"
SRC_URI += " \
file://0001-Fix-build-with-catching-polymorphic-type-error.patch \
"

View File

@ -0,0 +1,43 @@
From 97cdb0287499ad02c2c7f9ada698f081db291758 Mon Sep 17 00:00:00 2001
From: JeongBong Seo <jb.seo@lge.com>
Date: Mon, 22 Apr 2019 11:36:50 +0900
Subject: Fix build with catching polymorphic type error
---
src/amcl_node.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/amcl_node.cpp b/src/amcl_node.cpp
index 526a616..a5b4609 100644
--- a/src/amcl_node.cpp
+++ b/src/amcl_node.cpp
@@ -469,7 +469,7 @@ AmclNode::getOdomPose(
try {
this->tf_->transform(ident, odom_pose, odom_frame_id_);
- } catch (tf2::TransformException e) {
+ } catch (tf2::TransformException & e) {
++scan_error_count_;
if (scan_error_count_ % 20 == 0) {
RCLCPP_ERROR(
@@ -879,7 +879,7 @@ AmclNode::laserReceived(sensor_msgs::msg::LaserScan::ConstSharedPtr laser_scan)
tf2::toMsg(tmp_tf.inverse(), tmp_tf_stamped.pose);
this->tf_->transform(tmp_tf_stamped, odom_to_map, odom_frame_id_);
- } catch (tf2::TransformException) {
+ } catch (tf2::TransformException &) {
RCLCPP_DEBUG(get_logger(), "Failed to subtract base to odom transform");
return;
}
@@ -960,7 +960,7 @@ AmclNode::handleInitialPoseMessage(const geometry_msgs::msg::PoseWithCovarianceS
tx_odom = tf_->lookupTransform(base_frame_id_, tf2_ros::fromMsg(msg.header.stamp),
base_frame_id_, tf2::TimePoint(),
odom_frame_id_);
- } catch (tf2::TransformException e) {
+ } catch (tf2::TransformException & e) {
// If we've never sent a transform, then this is normal, because the
// global_frame_id_ frame doesn't exist. We only care about in-time
// transformation for on-the-move pose-setting, so ignoring this
--
2.17.1