diff --git a/loam_interface/src/loam_interface.cpp b/loam_interface/src/loam_interface.cpp index 18f676d..864b1c3 100644 --- a/loam_interface/src/loam_interface.cpp +++ b/loam_interface/src/loam_interface.cpp @@ -59,8 +59,8 @@ void LoamInterfaceNode::odometryCallback(const nav_msgs::msg::Odometry::ConstSha tf_odom_to_lidar_odom_ = tf_base_frame_to_lidar; base_frame_to_lidar_initialized_ = true; } catch (tf2::TransformException & ex) { - RCLCPP_WARN(this->get_logger(), "TF lookup failed: %s", ex.what()); - throw; + RCLCPP_WARN(this->get_logger(), "TF lookup failed: %s Retrying...", ex.what()); + return; } } diff --git a/sensor_scan_generation/src/sensor_scan_generation.cpp b/sensor_scan_generation/src/sensor_scan_generation.cpp index 597578a..893e052 100644 --- a/sensor_scan_generation/src/sensor_scan_generation.cpp +++ b/sensor_scan_generation/src/sensor_scan_generation.cpp @@ -85,8 +85,8 @@ tf2::Transform SensorScanGenerationNode::getTransform( tf2::fromMsg(transform_stamped.transform, transform); return transform; } catch (tf2::TransformException & ex) { - RCLCPP_WARN(this->get_logger(), "TF lookup failed: %s", ex.what()); - throw; + RCLCPP_WARN(this->get_logger(), "TF lookup failed: %s. Returning identity.", ex.what()); + return tf2::Transform::getIdentity(); } }