From eae36ab22d5c6c046857f9fe9c62b128ff756aff Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Sun, 21 Jul 2019 21:46:52 +0300 Subject: [PATCH] simple_offboard: fix transform timeout in /navigate_global --- clever/src/simple_offboard.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clever/src/simple_offboard.cpp b/clever/src/simple_offboard.cpp index 5fb07fbf..51cecbe0 100644 --- a/clever/src/simple_offboard.cpp +++ b/clever/src/simple_offboard.cpp @@ -351,6 +351,10 @@ PoseStamped globalToLocal(double lat, double lon) x_offset = distance * sin(azimuth_radians); y_offset = distance * cos(azimuth_radians); + if (!waitTransform(local_frame, fcu_frame, global_position.header.stamp, ros::Duration(1))) { + throw std::runtime_error("No local position"); + } + auto local = tf_buffer.lookupTransform(local_frame, fcu_frame, global_position.header.stamp); PoseStamped pose;