From 87323aa5162d01479d958eed5f6d98dc0529c236 Mon Sep 17 00:00:00 2001 From: Chris Korhonen Date: Wed, 7 Jan 2026 19:55:12 -0500 Subject: [PATCH] Fix #561: TFClient Documentation --- packages/roslib/src/tf/TFClient.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/roslib/src/tf/TFClient.ts b/packages/roslib/src/tf/TFClient.ts index 0e3838a77..464cad3b0 100644 --- a/packages/roslib/src/tf/TFClient.ts +++ b/packages/roslib/src/tf/TFClient.ts @@ -14,6 +14,27 @@ import BaseTFClient from "./BaseTFClient.ts"; /** * A TF Client that listens to TFs from tf2_web_republisher. + * + * @example Canceling Goals + * ```javascript + * const tfClient = new TFClient({ + * ros: ros, + * fixedFrame: 'world' + * }); + * + * // Subscribe to a frame + * tfClient.subscribe('turtle1', function(tf) { + * console.log('Transform received:', tf); + * }); + * + * // Cancel the current goal only + * if (tfClient.currentGoal) { + * tfClient.currentGoal.cancel(); + * } + * + * // Cancel all goals associated with this TF client + * tfClient.actionClient.cancel(); + * ``` */ export default class TFClient extends BaseTFClient { currentGoal: