Skip to content

Commit 87323aa

Browse files
ckorhonenMatthijsBurgh
authored andcommitted
Fix #561: TFClient Documentation
1 parent c934e8e commit 87323aa

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/roslib/src/tf/TFClient.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,27 @@ import BaseTFClient from "./BaseTFClient.ts";
1414

1515
/**
1616
* A TF Client that listens to TFs from tf2_web_republisher.
17+
*
18+
* @example Canceling Goals
19+
* ```javascript
20+
* const tfClient = new TFClient({
21+
* ros: ros,
22+
* fixedFrame: 'world'
23+
* });
24+
*
25+
* // Subscribe to a frame
26+
* tfClient.subscribe('turtle1', function(tf) {
27+
* console.log('Transform received:', tf);
28+
* });
29+
*
30+
* // Cancel the current goal only
31+
* if (tfClient.currentGoal) {
32+
* tfClient.currentGoal.cancel();
33+
* }
34+
*
35+
* // Cancel all goals associated with this TF client
36+
* tfClient.actionClient.cancel();
37+
* ```
1738
*/
1839
export default class TFClient extends BaseTFClient {
1940
currentGoal:

0 commit comments

Comments
 (0)