From d487234c072644e5e94c9c3ad07c2b98ccf92bc6 Mon Sep 17 00:00:00 2001 From: Abrar Rahman Protyasha Date: Tue, 28 Dec 2021 01:50:27 +0600 Subject: [PATCH] [tf2] Output canTransform msg only on state change Signed-off-by: Abrar Rahman Protyasha --- tf2/src/buffer_core.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tf2/src/buffer_core.cpp b/tf2/src/buffer_core.cpp index c8c994e32..d28c607fd 100644 --- a/tf2/src/buffer_core.cpp +++ b/tf2/src/buffer_core.cpp @@ -113,8 +113,13 @@ CompactFrameID BufferCore::validateFrameId( return 0; } + // Only check that a frame is non-existent once a frame was found + static bool init_state = true; CompactFrameID id = lookupFrameNumber(frame_id); - if (id == 0) { + if (id != 0) { + init_state = false; + } + if (!init_state && id == 0) { fillOrWarnMessageForInvalidFrame( function_name_arg, frame_id, error_msg, "frame does not exist"); }