Skip to content
Robotlar
Industry Guide

Unitree G1 tactile sensing cloth and G1_cloth_service: data format, setup and reading

Unitree Turkey Distributor

Unitree's open-source G1_cloth_service carries the data of the Unitree G1 tactile sensing cloth onto the robot's DDS network. The service reads 256 sensor values and a gyro quaternion from the serial port, merges two packets into one message and publishes it at 100 Hz.

This guide covers the data format, setup, automatic start with systemd and reading the data in Python. The last sections show how to combine the cloth data with the Dex3-1 and Dex5-1 hand sensors for whole-body tactile data collection.

Related models

Unitree G1 humanoid robot, tactile sensing cloth data and G1_cloth_service

What does the cloth data provide?

Unitree describes the service as a serial-to-DDS bridge (serial2dds) for the G1 tactile sensing cloth. Each message holds 256 sensor values of 8 bits each, read in the range 0 to 255. At the start of the message comes a quaternion from the gyro in the cloth. The array that shows where and how hard contact occurs and the orientation of the cloth therefore arrive in the same message.

The protocol header defines five sensor types: left hand (LH), right hand (RH), left foot (LF), right foot (RF) and whole body (WB). When merging two packets, the service checks that both carry the same sensor type.

Serial protocol and frame layout

The cloth connects through a CH343 USB-to-serial converter (VID:PID 1a86:55d3, device node /dev/ttyACM*) and sends data at 921600 baud. Each frame opens with the four-byte header AA 55 03 99, followed by the packet sequence and sensor type bytes.

FieldValueLength
Header0xAA 0x55 0x03 0x994 bytes
Packet sequence0x01 first packet, 0x02 second packet1 byte
Sensor type0x01 LH, 0x02 RH, 0x03 LF, 0x04 RF, 0x05 WB1 byte
First packet dataFirst 128 sensor values128 bytes (frame 134 bytes)
Second packet dataLast 128 sensor values and 16 bytes of gyro data144 bytes (frame 150 bytes)

The parser looks for the header in the byte stream, derives the frame length from the sequence byte and keeps incomplete data for the next read. On an invalid sequence byte it drops that header and resyncs. Every four bytes of the gyro section combine into a little-endian IEEE 754 float, giving the w, x, y and z components in order.

The DDS message: rt/jq_clothstate

The service writes the merged data to the rt/jq_clothstate topic with the type sensor_msgs::msg::dds_::PointCloud2_ and uses only the message's data byte array.

BytesContent
data[0..15]Gyro quaternion, 4 float32 (w, x, y, z), little-endian
data[16..271]256 sensor values, 8 bits each

PointCloud2_ is a point cloud message, but here it only serves as a carrier. On the subscriber side, split the first 16 bytes of the data array into the quaternion and the remaining 256 bytes into the sensor array, without looking at the other fields.

Setup: Jetson Orin NX and x86_64

You can build the service on the robot's Jetson Orin NX (arm64) computer or on an x86_64 machine. The build script uses the system default compiler (C++17, CMake 3.10 or newer) and picks the SDK libraries that match uname -m. The DDS dependency unitree_sdk2 is vendored in 3rd/unitree_sdk2, prebuilt for x86_64 and aarch64.

  1. Install the serial port library with sudo apt install libserialport-dev.
  2. Clone the repository with git clone https://github.com/unitreerobotics/G1_cloth_service.
  3. Run bash build.sh in the repository directory.
  4. After the build you will find two files in bin/: bin/cloth_service is the service and bin/JqDdsTest is the DDS subscriber test tool.

For a machine without access to the package repository, 3rd/serialport holds Ubuntu 22.04 deb files, separately for arm64 (Jetson) and amd64. Install libserialport0 first, then libserialport-dev. When choosing onboard compute, our Jetson Orin guide is useful too.

Starting and checking the service

Serial port access requires root or membership of the dialout group, so start the service with sudo ./bin/cloth_service. On startup it waits up to 30 seconds for the USB device to be enumerated, then opens the port and starts publishing.

Check the data with ./bin/JqDdsTest. The tool subscribes via the loopback interface by default. For another interface, pass its name as the first argument, for example ./bin/JqDdsTest eth0. It prints the receive rate, the quaternion and the 256 sensor values.

If the service exits with "Serial device 1a86:55d3 not found", check the cloth's cable. Look for 1a86:55d3 in the lsusb output and for the device node with ls /dev/ttyACM*. To read the data with JqDdsTest on another machine, put both machines on the same subnet and pass the correct interface name.

Automatic start with systemd and log rotation

After testing, the bash setup_autostart.sh script installs the G1_cloth.service unit, and the service then starts bin/cloth_service on every boot. According to Unitree's Chinese README, the unit runs with Restart=always as user unitree in group dialout, with LD_LIBRARY_PATH pointing at the vendored SDK libraries.

Manage the unit with sudo systemctl status, restart, stop and disable. For live logs use sudo journalctl -u G1_cloth.service -f. Historical log files are kept under /unitree/var/log/cloth_service and rotate asynchronously as 3 files of 10 MB, as set in config/default_logconf.json.

Reading the data in Python

To decode the DDS data in Python, use the python/g1_giysi.py decoder in our Turkish repository. It splits the data array of the rt/jq_clothstate message according to the table above: four little-endian float32 values from the first 16 bytes give the quaternion, and the remaining 256 bytes become the sensor array in the range 0 to 255.

If you write your own code, Python's struct module does the same split: the "<4f" format reads w, x, y and z from the first 16 bytes, and the data[16:272] slice gives the sensor array. We cover the SDK setup needed for DDS subscription in our Unitree SDK guide.

Whole-body tactile data with the Dex3-1 and Dex5-1

The G1's hands also offer tactile sensing options. According to Unitree, the Dex3-1 offers 7 degrees of freedom across three fingers and is listed on the G1 product page with an optional 33-sensor tactile array. The tactile version of the Dex5-1, the Dex5-1P, carries 94 sensors in 12 pressure arrays according to the manufacturer. The cloth gives the contact map on the body and the hand sensors give the pressure during grasping. Recording both sources together keeps the contact the robot makes with its hands and its body in one dataset.

These recordings can become part of demonstration data for imitation learning. While teleoperating the G1, add the rt/jq_clothstate topic as an extra subscriber in your recording script next to the cameras, joint states and hand tactile data. Our unitree_lerobot guide covers converting recordings to the LeRobot format and moving on to training. The G1 teleoperation page summarises the data collection setup. Unitree describes the G1-D as a data collection, training and inference platform. If you want to combine tactile recordings with motion generation, the Unitree G1 and MotionBricks guide covers the reference motion side.

Frequently asked questions

At what rate does the cloth data arrive?

The service publishes the merged data over DDS at 100 Hz. The serial link runs at 921600 baud.

Which computers does the service run on?

Jetson Orin NX (arm64) and x86_64 machines. The vendored unitree_sdk2 libraries are prebuilt for both architectures, and the offline deb packages target Ubuntu 22.04.

Which topic do I subscribe to?

rt/jq_clothstate, with the type sensor_msgs::msg::dds_::PointCloud2_. Only the data byte array is used.

What does a sensor value represent?

Each value has 8 bits and reads from 0 to 255. The 256 values come from two packets: the first carries the first 128 values and the second the last 128.

Can I read the data from another machine?

Yes. Both machines must be on the same subnet; pass the correct network interface name (for example eth0) to JqDdsTest or your own subscriber.

What is the licence?

G1_cloth_service is licensed under BSD-3-Clause, with the copyright line "Copyright (c) 2026, Unitree Robotics".

The Unitree G1 and the tactile cloth in Turkey

As Unitree Robotics' official distributor in Turkey, Robotlar.org works with teams collecting data and doing robot learning on the G1 family. We published the Turkish documentation of G1_cloth_service, data format notes and a Python decoder in the unitree-g1-dokunsal-giysi-turkce repository. Our other Turkish repositories are unitree-g1-turkce, unitree-sdk2-turkce and unitree-teleoperasyon-turkce.

In a discovery call we decide with you which body, hand and sensor configuration to start with. For configuration and pricing, use the enterprise quote form or the G1 EDU quote page. If you are planning a lab, see the G1 research platform and Unitree education solutions pages.

Sources

Let's Find Your Solution

The investment depends on the selected robot platform, additional sensor and payload equipment, and the integration scope of your site. Share your requirements and our engineering team will prepare a feasibility report and a pro forma quotation for your organisation.