yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Jetson Orin NX SUPER📖
01.Get started
  • 01. Learning route
  • 02. Get started quickly
  • 03. System Update Notes
  • 04.Disabling automatic updates and troubleshooting issues
02.Jetson basic course
  • 01.Jetson board introduction
  • 02.Write Jetson original system
  • 03.Installing Jetson environment
  • 04.Backup SSD system
  • 05.Restore initial image system
  • 06.Upgrade to SUPER version
  • 07.Write SUPER boot
  • 08.SSD expansion
  • 09.Jetpack old system upgraded to Yahboom SUPER factory system
  • 10.Write the system onto your own solid-state drive
03.Basic setting course
  • 01.Basic knowledge
  • 02.Network configuration
  • 03.SSH remote login
  • 04.VNC remote control
  • 05.Remote file transfer
  • 06.Jtop tool
  • 07.Exchange space expansion
  • 08.Use VSCode
  • 09.Use VMware
04.GPIO control course
  • 01.GPIO description
  • 02.GPIO library installation
  • 03.GPIO reading
  • 04.GPIO output
  • 05.Serial communication
  • 06.I2C communication
05.Vision basic course
  • 01.CSI camera preview
  • 02.USB camera preview
  • 03.Use Jupyter Lab
  • 04.Use JetCam
06.OpenCV basic course
  • 01.Image reading
  • 02.Image saving
  • 03.Image modification
  • 04.Image scaling
  • 05.Image cropping
  • 06.Image translation
  • 07.Image mirroring
  • 08.Image grayscale conversion
  • 09.Image binarization
  • 10.Image edge detection
  • 11.Add line segments
  • 12.Add rectangles
  • 13.Add circular shape
  • 14.Add ellipses
  • 15.Add polygons
  • 16.Add Text
  • 17.Preview USB camera image
  • 18.Preview CSI camera image
07.Vision advanced course
01.Environment construction
  • 01.TensorFlow
  • 02.PyTorch
  • 03.Torchvision
02.DeepStream development
  • 01.DeepStream environment
  • 02.Four types of detection(traffic)
03.YOLO11 development
  • 01.YOLO environment construction
  • 02.CLI use
  • 03.Object detection
  • 04.Instance segmentation
  • 05.Pose estimation
  • 06.Image classification
  • 07.Oriented object detection
  • 08.Model conversion
  • 09.Dataset annotation
  • 10.Model training conversion
  • 11.Model prediction
04.Mediapipe development
  • 01.Mediapipe environment
  • 02.Hand detection
  • 03.Face detection
  • 04.Face effects
  • 05.3D object recognition
  • 06.Virtual brush
  • 07.Gesture recognition
  • 08.Finger control
  • 09.Posture estimation
  • 10.Face mask
  • 11.Overall detection
  • 12.Green scene removal(Human)
05.QR code recognition
  • 01.QR code recognition
06.YOLO26 development
  • 01.YOLO environment constructionnew
  • 02.CLI usenew
  • 03.Object detectionnew
  • 04.Instance segmentationnew
  • 05.Pose estimationnew
  • 06.Image classificationnew
  • 07.Oriented object detectionnew
  • 08.Model conversionnew
  • 09.Dataset annotationnew
  • 10.Model training conversionnew
  • 11.Model predictionnew
08.Docker basic course
  • 01.Docker introduction
  • 02.Docker installation
  • 03.Docker command
  • 04.Docker usage
  • 05.Docker interaction
09.ROS1-Melodic
01.ROS1 basic course
  • 01. Introduction to ROS
  • 02. Project file structure
  • 03. Common commands and tools
  • 04. Publisher
  • 05. Subscribers
  • 06. Customize topic messages and use
  • 07. Client
  • 08. Server
  • 09. Customize service messages and usage
  • 10. TF release and monitoring
02.ROS1 vision course
  • 00.Must read before running
  • 01.Camera preview
  • 02.QR code
  • 03.Human posture estimation
  • 04.Target detection
  • 05.AR vision
  • 06.Opencv application
  • 07.ROS+Opencv basics
  • 08.Mediapipe development
10.ROS2-Humble
01.ROS2 basic course
  • 01.Introduction to ROS2
  • 02.ROS2 install Humble
  • 03.ROS2 development environment
  • 04.ROS2 workspace
  • 05.ROS2 function package
  • 06.ROS2 node
  • 07.ROS2 topic communication
  • 08.ROS2 service communication
  • 09.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 rqt toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
02.ROS2 vision course
  • 01.Camera preview (USB)
  • 02.Camera preview (CSI)
  • 03.Camera calibration (USB)
  • 04.Camera calibration (CSI)
  • 05.AR vision (USB)
  • 06.AR vision (CSI)
11.Offline AI model coursenew
Offline large model (Text Interaction)
  • 1.AI large model environment deployment
  • 2.Install large model dialogue platform
  • 3.Meta Al Llama3.2 model
  • 4.Alibaba Cloud Qwen3 model
  • 5.Microsoft Phi-4-mini model
  • 6.DeepSeek DeepSeek-R1 model
  • 7.Alibaba Cloud Qwen2.5v visual multimodal large model
  • 8.Google Gemma3 visual multimodal large model
  • 9.Lava visual multimodal large model
  • 10.MiniCPM-V visual multimodal large model
  • 11.Multimodal visual understand application
  • 12.Multimodal text image application
  • 13.Multimodal video analysis application
  • 14.Multi module visual position application
  • 15.Multimodal table scanning application
  • 16.Multimodal autonomous agent application
Offline large model (Voice Interaction)
  • 0.Voice interaction hardware connection (ReadMe)
  • 1.Offline speech to text (ASR)
  • 2.Offline text to speech (TTS)
  • 3.AI large model voice interaction
  • 4.Multimodal visual understand speech interaction
  • 5.Multimodal text and graphics application
  • 6.Multimodal video analysis application
  • 7.Multi module visual position application
  • 8.Multimodal table scanning application
  • 9.Multimodal autonomous proxy application
  • 10.AI large model offline voice assistant
12.Online AI model coursenew
Online large model (Text Interaction)
  • 1.OpenRouter large model API aggregation platform
  • 2.Multimodal visual understand application
  • 3.Multimodal visual localization application
  • 4.Multimodal table scanning application
  • 5.Multimodal autonomous proxy application
Online large model (Voice Interaction)
  • 0.Voice interaction hardware connection (ReadMe)
  • 1.Online speech to text (ASR)
  • 2.Online text to speech (TTS)
  • 3.AI large model voice interaction
  • 4.Multimodal visual understand speech interaction
  • 5.Multi module visual position application
  • 6.Multimodal table scanning application
  • 7.Multimodal autonomous proxy application
  • 8.AI large model online voice assistant
13.NVIDIA lsaac ROS coursenew
  • 1.Build lsaac ROS environment
  • 2.Deep segmentation
  • 3.DNN stereoscopic depth
  • 4.Free space segmentation
  • 5.Image distortion processing
  • 6.Image segmentation
  • 7.3D scene reconstruction and mapping
  • 8.Object detection
  • 9.3D attitude estimation
  • 10.Visual SLAM
14.OpenClaw Deployment and Basic Usagenew
  • 01.OpenClaw Quick Start on Jetson Platform
  • 02.OpenClaw Deployment
  • 03.OpenClaw WhatsApp Plugin Application
  • 04.OpenClaw WebChat Interaction
  • 05.OpenClaw TUI Interaction
  • 06.OpenClaw Tools Introduction
  • 07.OpenClawGate Gateway User Manual
  • 08.OpenClaw Features Overview
  • 09.OpenClawHub Introduction (Skill Installation)
  • 10.OpenClaw Application - File Management
  • 11.OpenClaw Application - Camera
  • 12.OpenClaw Application - Browser Control
  • 13.OpenClaw Application - Script Execution
  • 14.OpenClaw Application - AI Programming (Peripheral & GPIO Control)
  • 15.OpenClaw Application - Dedicated AI Assistant
  • 16.OpenClaw Web Search Capability Configuration
15.OpenClaw Advanced Developmentnew
1.Preparation Before Use
  • 1. Peripheral Hardware Configuration
  • 2. OpenClaw API Key Configuration
  • 3. OpenClaw Model Switching
  • 4. OpenClaw Prompts
  • 5. AI Voice Interaction Configuration
  • 6. Three Dialogue Configuration Tests
2.OpenClaw AI Programming Peripheral Control
  • 1. Servo Control
  • 2. RGB Strip
  • 3. OLED Display
  • 4. Temperature and Humidity Sensor
  • 5. Camera Application
  • 6. AI Script Peripheral Control
3.OpenClaw Peripheral Integration Applications
  • 1. Plant Care Assistant
  • 2. AI Calorie Estimation
  • 3. AI Rock Paper Scissors Game
  • 4. AI Pet
  • 5. AI Weather Station
  • 6. Temperature and Humidity Dashboard
  • 7. Scheduled Tasks
Download
  • System_File
  • VM_File
  • 3D_Model_File
  • Data_Sheet_File
  • Software_Tools
  • Code
  • Instruction_Manual
  • ROS2_Basic_VM
Download ZIP

Welcome to Jetson Orin NX SUPER repository

当製品の日本語版マニュアル資料は、こちらからご取得ください。

10. TF release and monitoring

10.Tf publishing and monitoring

10.1. Tf Function Package

10.1.1. Tf is a functional package that allows users to track multiple coordinate systems over time. It uses a tree shaped data structure to buffer and maintain coordinate transformation relationships between multiple coordinate systems based on time. It can help developers complete coordinate transformations such as points and vectors between coordinate systems at any time.

10.1.2 Usage Steps

  1. Monitoring tf transformationReceive and cache all coordinate system transformation data published in the system, and query the required coordinate transformation relationships from it.
  2. Broadcasting tf transformationBroadcast the coordinate transformation relationship between coordinate systems in the system. There may be multiple different parts of tf transformation broadcasting in the system. Each broadcast can directly insert coordinate transformation relationships into the tf tree without the need for synchronization.

10.2. Programming Implementation of Broadcasting and Monitoring in the tf Coordinate System

10.2.1 Creating and Compiling Function Packs

cd ~/catkin_ws/src
catkin_create_pkg learning_tf rospy roscpp turtlesim tf
cd ..
catkin_make

10.2.2 How to implement a tf broadcaster

  1. Define the tf broadcaster (TransformBroadcast);
  2. Initialize tf data and create coordinate transformation values
  3. Publish coordinate transformation (sendTransform);

10.2.3 How to implement a tf listener

  1. Define a TF listener (TransformListener);
  2. Find coordinate transformations (waitForTransform, lookupTransform)

10.2.4. C++language implementation of tf broadcaster

  1. In the feature pack learning_ Create a C++file (with the suffix. cpp) in the src folder of tf and name it turtle_ tf_ broadcaster.cpp
  2. Copy and paste the program code below into the title_ tf_ In the broadcaster.cpp file
x
#include <ros/ros.h>
#include <tf/transform_broadcaster.h>
#include <turtlesim/Pose.h>

std::string turtle_name;

void poseCallback(const turtlesim::PoseConstPtr& msg)
{
    
    static tf::TransformBroadcaster br;// Create a broadcaster for tf

    // Initialize tf data
    tf::Transform transform;
    transform.setOrigin( tf::Vector3(msg->x, msg->y, 0.0) );//Set xyz coordinates
    tf::Quaternion q;
    q.setRPY(0, 0, msg->theta);//Set Euler angles: Rotate along the x-axis, y-axis, and z-axis
    transform.setRotation(q);

    br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "world", turtle_name));//Tf data between broadcast world and turtle coordinate system
}

int main(int argc, char** argv)
{
    ros::init(argc, argv, "turtle_world_tf_broadcaster");// Initialize ROS nodes

    if (argc != 2)
    {
        ROS_ERROR("Missing a parameter as the name of the turtle!"); 
        return -1;
    }
    
    turtle_name = argv[1];// Enter parameters as the name of the turtle

    //Subscribe to turtle pose topic/pose
    ros::NodeHandle node;
    ros::Subscriber sub = node.subscribe(turtle_name+"/pose", 10, &poseCallback);

        // Loop waiting callback function
    ros::spin();

    return 0;
};
  1. Process Flow Chart

  1. Code parsing

Firstly, subscribe to the Little Turtle's/pose pose topic first. If any of the topics are published, then enter the callback function. In the callback function, first create a broadcaster for tf, and then initialize tf data. The value of the data is the data passed through the subscription/pose topic. Finally, publish the transformation of the Little Turtle's world coordinates through br.sendTransform, and let's talk about the sendTransform function here. There are four parameters, the first parameter represents the coordinate transformation of tf:: Transform type (i.e. the previously initialized tf data), the second parameter is the timestamp, and the third and fourth parameters are the source and target coordinate systems of the transformation.

10.2.4. C++Language Implementation of tf Listener

  1. In the feature pack learning_ Create a C++file (with the suffix. cpp) in the src folder of tf and name it turtle_ tf_ listener.cpp
  2. Copy and paste the program code below into the title_ tf_ In the listener. cpp file
x
#include <ros/ros.h>
#include <tf/transform_listener.h>
#include <geometry_msgs/Twist.h>
#include <turtlesim/Spawn.h>

int main(int argc, char** argv)
{
    
    ros::init(argc, argv, "turtle1_turtle2_listener");// Initialize ROS nodes

   
    ros::NodeHandle node; // Create node handle

    // Request service to generate turtle2
    ros::service::waitForService("/spawn");
    ros::ServiceClient add_turtle = node.serviceClient<turtlesim::Spawn>("/spawn");
    turtlesim::Spawn srv;
    add_turtle.call(srv);

    //Create a publisher to issue speed control commands for Turtle2
    ros::Publisher vel = node.advertise<geometry_msgs::Twist>("/turtle2/cmd_vel", 10);

    tf::TransformListener listener;// Create a listener for tf

    ros::Rate rate(10.0);

    while (node.ok())
    {
        //Obtain tf data between turtle1 and turtle2 coordinate systems
        tf::StampedTransform transform;
        try
        {
            listener.waitForTransform("/turtle2", "/turtle1", ros::Time(0), ros::Duration(3.0));
            listener.lookupTransform("/turtle2", "/turtle1", ros::Time(0), transform);
        }
        catch (tf::TransformException &ex) 
        {
            ROS_ERROR("%s",ex.what());
            ros::Duration(1.0).sleep();
            continue;
        }
![listener_cpp](C:\Users\Administrator\Desktop\nano资料更新\7. ROS advanced tutorial\10. TF release and monitoring\listener_cpp.jpg)
        // Based on the positional relationship between turtle1 and turtle2 coordinate systems, the angular velocity and linear velocity are calculated using mathematical formulas, and the speed control command for turtle2 is issued
        geometry_msgs::Twist turtle2_vel_msg;

        turtle2_vel_msg.angular.z = 6.0 * atan2(transform.getOrigin().y(),
                                        transform.getOrigin().x());
        turtle2_vel_msg.linear.x = 0.8 * sqrt(pow(transform.getOrigin().x(), 2) +
                                      pow(transform.getOrigin().y(), 2));
        vel.publish(turtle2_vel_msg);

        rate.sleep();
    }
    return 0;
};
  1. Process Flow Chart

  1. Code parsing

Firstly, generate another little turtle named Turtle2 through service invocation, and then create a Turtle2 speed control publisher; Next, create a listener to listen and look for the left transformation of turnle1 and tuetle2, which involves two functions, waitForTransform and lookupTransformWaitForTransform (target_frame, source_frame, time, timeout): Two frames represent the target coordinate system and the source coordinate system respectively, while time represents the time to wait for the transformation between the two coordinate systems. Since coordinate transformation is a blocking program, a timeout needs to be set to represent the timeout time.

LookupTransform (target_frame, source_frame, time, transform): Given the source coordinate system (source_frame) and target coordinate system (target_frame), obtain the coordinate transformation (transform) between the two coordinate systems at the specified time (time).

After lookupTransform, we obtained the result of coordinate transformation, transform, and then obtained the values of x and y through transform. getOrigin(). y(), transform. getOrigin(). x(). Then, through mathematical operations, we obtained the angular velocity angular. z and linear velocity linear. x. Finally, we published it and let turnle2 move

10.2.5 Modifying CMakelist.txt and Compiling

  1. Modify CMakelist.txtModify CMakelist.txt under the feature pack and add the following content
xxxxxxxxxx
add_executable(turtle_tf_listener src/turtle_tf_listener.cpp)
target_link_libraries(turtle_tf_listener ${catkin_LIBRARIES})

add_executable(turtle_tf_broadcaster src/turtle_tf_broadcaster.cpp)
target_link_libraries(turtle_tf_broadcaster ${catkin_LIBRARIES})
  1. compile
xxxxxxxxxx
cd ~/catkin_ws
catkin_make
source devel/setup.bash 

10.2.6 Demonstration of startup and operation effects

  1. firing
xxxxxxxxxx
roscore
rosrun turtlesim turtlesim_node
rosrun learning_tf turtle_tf_broadcaster __name:=turtle1_tf_broadcaster /turtle1
rosrun learning_tf turtle_tf_broadcaster __name:=turtle2_tf_broadcaster /turtle2
rosrun learning_tf turtle_tf_listener
rosrun turtlesim turtle_teleop_key
  1. SHOW

  1. Program Description

After starting the score, activate the Little Turtle node, and a little turtle will appear on the terminal; Then we will publish two tf transformations, turtle1->world and turtle2->world, because to know the changes between turtle2 and turtle1, we need to know the transformations between them and world; Then, start the tf listening program, and at this point, you will find that the terminal has generated another little turtle named Turtle2, and Turtle2 will move towards Turtle1; Then, we open the keyboard control and control the movement of turnle1 by pressing the directional keys, and then turnle2 will follow the movement of turnle1.

10.2.7. Implementing tf broadcaster in Python language

  1. In the feature pack learning_ Tf, create a folder script, switch to that directory, create a new. py file, and name it turtle_ tf_ broadcaster.py
  2. Copy and paste the program code below into the title_ tf_ In the broadcaster.py file
x
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import roslib
roslib.load_manifest('learning_tf')
import rospy

import tf
import turtlesim.msg

def handle_turtle_pose(msg, turtlename):
    br = tf.TransformBroadcaster()#Define a TF broadcast
  
    br.sendTransform((msg.x, msg.y, 0),
                     tf.transformations.quaternion_from_euler(0, 0, msg.theta),
                     rospy.Time.now(),
                     turtlename,
                     "world")

if __name__ == '__main__':
        
    rospy.init_node('turtle1_turtle2_tf_broadcaster')#Initialize ROS node
    
    turtlename = rospy.get_param('~turtle') 
    
    rospy.Subscriber('/%s/pose' % turtlename,
                     turtlesim.msg.Pose,
                     handle_turtle_pose,
                     turtlename)
    rospy.spin()
  1. Program flowchart

10.2.8. Python language implementation of tf listener

  1. In the feature pack learning_ Create a Python file (with a. py file suffix) in the script folder of tf and name it turtle_ tf_ listener.py
  2. Copy and paste the program code below into the title_ tf_ In the listener. py file
x
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import rospy
import math
import tf
import geometry_msgs.msg
import turtlesim.srv

if __name__ == '__main__':
    rospy.init_node('turtle_tf_listener')#Initialize ROS node

    listener = tf.TransformListener()#Initialize a listener

    rospy.wait_for_service('spawn')
    #Call service to generate another turtle turtle2
    spawner = rospy.ServiceProxy('spawn', turtlesim.srv.Spawn)
    spawner(8, 6, 0, 'turtle2')
    #Declare a publisher to release the speed of turtle2
    turtle_vel = rospy.Publisher('turtle2/cmd_vel', geometry_msgs.msg.Twist,queue_size=1)

    rate = rospy.Rate(10.0)
    while not rospy.is_shutdown():
        try:
            #Find tf changes between turtle2 and turtle1
            (trans,rot) = listener.lookupTransform('/turtle2', '/turtle1', rospy.Time(0))
        except (tf.LookupException, tf.ConnectivityException, tf.ExtrapolationException):
            continue
        #Calculate the line velocity and angular velocity through mathematical calculations, and then publish them
        angular = 6.0 * math.atan2(trans[1], trans[0])
        linear = 0.8 * math.sqrt(trans[0] ** 2 + trans[1] ** 2)
        cmd = geometry_msgs.msg.Twist()
        cmd.linear.x = linear
        cmd.angular.z = angular
        turtle_vel.publish(cmd)
        rate.sleep()
  1. Process Flow Chart

10.2.9 Demonstration of startup and operation effects

  1. Write a launch fileIn the feature pack directory, create a new folder launch, switch to launch, and create a new launch file named start_ tf_ demo_ Py. launch, copy the following content into it,
x
<launch>

    <!-- Turtle Node-->
    <node pkg="turtlesim" type="turtlesim_node" name="sim"/>
    <!--broadcast turtle1->world-->
    <node name="turtle1_tf_broadcaster" pkg="learning_tf" type="turtle_tf_broadcaster.py" respawn="false" output="screen" >
      <param name="turtle" type="string" value="turtle1" />
    </node>
    <!--broadcast turtle2->world-->
    <node name="turtle2_tf_broadcaster" pkg="learning_tf" type="turtle_tf_broadcaster.py" respawn="false" output="screen" >
      <param name="turtle" type="string" value="turtle2" /> 
    </node>
    <!--listen in-->
    <node pkg="learning_tf" type="turtle_tf_listener.py" name="listener" />
    <!--Turtle keyboard control node-->
    <node pkg="turtlesim" type="turtle_teleop_key" name="teleop" output="screen"/>
</launch>
  1. firing
xxxxxxxxxx
roslaunch learning_tf start_tf_demo_py.launch

After the program runs, click on the launch window with the mouse, press the arrow keys, and Turtle2 will follow Turtle1.

  1. The operation results are shown in the following figure

Customize service messages and usage
Must read before running

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文