From fb4785801098f7f0ed9406dd407eb3079cc4c751 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Fri, 21 Jan 2022 23:22:33 +0300 Subject: [PATCH] selfcheck.py: add checking map->base_link tf transform --- clover/src/selfcheck.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clover/src/selfcheck.py b/clover/src/selfcheck.py index d9abda37..797faef9 100755 --- a/clover/src/selfcheck.py +++ b/clover/src/selfcheck.py @@ -485,6 +485,9 @@ def check_local_position(): failure('roll is %.2f deg; place copter horizontally or redo level horizon calib', math.degrees(roll)) + if not tf_buffer.can_transform('base_link', pose.header.frame_id, rospy.get_rostime(), rospy.Duration(0.5)): + failure('can\'t transform from %s to base_link (timeout 0.5 s): is TF enabled?', pose.header.frame_id) + except rospy.ROSException: failure('no local position')