ROS 2 tutorial
ROS 2 tactile sensing: from synthetic messages to replay
Follow a source-checked ROS 2 tactile message and replay workflow. Explore an ICRA hardware tutorial, with runtime and compatibility limits stated.
Publish a deterministic synthetic array, inspect its contract, record one topic and replay it with the publisher stopped. No robot, hardware driver or actuator command is involved.
Pinned commit 7bf81d2: the original source check is dated September 16. Four dependency-free tests and Python syntax compilation passed again on November 3, 2026. Historical Lyrical CI built packages and inspected the interface. No local ROS launch, live transport, recording, replay or hardware test is claimed.
1. Use one ROS and operating-system combination
This walkthrough targets Ubuntu 26.04 (Resolute), Bash and ROS 2 Lyrical. The inspected August 23, 2026 CI run used osrf/ros:lyrical-desktop with Ubuntu Resolute package sources inside the container; its Ubuntu 24.04 host runner is a separate environment. That historical run does not pin the current contents of the image tag. Do not mix these commands with a Humble, Jazzy or Kilted workspace.
Follow the official Lyrical Ubuntu installation guide to configure UTF-8, the Ubuntu repositories and the ROS apt source, then install the desktop packages and development tools below. This requires administrator access on that Linux environment. Run rosdep init only on a fresh installation; skip it if rosdep is already initialized.
These installation and runtime commands are source-checked instructions, not a local ROS execution transcript. The upstream CI result covers building and interface inspection only.
sudo apt update
sudo apt install ros-lyrical-desktop ros-dev-tools git
source /opt/ros/lyrical/setup.bash
sudo rosdep init # once per fresh rosdep installation
rosdep update
printenv ROS_DISTRO2. Get the inspected code and build the workspace
Use a new workspace. Pin the inspected commit so the interface and commands below remain reviewable. rosdep reads the actual package manifests; colcon builds the message package and the Python demo. Source the resulting overlay in every terminal that uses these packages.
mkdir -p ~/roboskin_ws/src
cd ~/roboskin_ws/src
git clone https://github.com/roboskin-ai/ros2-tactile-starter-kit.git
cd ros2-tactile-starter-kit
git checkout 7bf81d2575e3ef4b62034f4771daf948033b4d76
cd ~/roboskin_ws
source /opt/ros/lyrical/setup.bash
rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install
source install/setup.bash
ros2 interface show roboskin_tactile_msgs/msg/TactileArray3. Publish a synthetic tactile field
The launch file starts synthetic_publisher and contract_monitor from roboskin_tactile_demo. Its exposed launch arguments are rows, columns and publish_rate_hz. The default is a 4 × 4 grid with a requested timer rate of 10 Hz.
The values come from sine and cosine functions in the source. They are deterministic normalized signals for integration exercises, not sensor measurements or physics simulation. A requested timer rate is not a measured sampling-rate guarantee.
For the physical concepts behind a tactile signal, read the tactile sensing introduction before interpreting channel names as measurements. The values published in this exercise remain synthetic and normalized.
cd ~/roboskin_ws
source /opt/ros/lyrical/setup.bash
source install/setup.bash
ros2 launch roboskin_tactile_demo demo.launch.py rows:=4 columns:=4 publish_rate_hz:=10.0cd ~/roboskin_ws
source /opt/ros/lyrical/setup.bash
source install/setup.bash
ros2 topic info /tactile/array --verbose
ros2 topic echo /tactile/array --once --qos-reliability best_effort --qos-durability volatile4. Read shape, units, validity and time correctly
The type is roboskin_tactile_msgs/msg/TactileArray, an experimental reference implementation rather than an official ROS standard. It is not a completed hardware driver or evidence of compatibility with a commercial sensor.
The monitor checks dimensions, array lengths and validity bytes, then reports pressure-channel statistics every tenth accepted frame. It does not check all semantic errors: channel units, nonfinite numbers, clock synchronization, calibration and geometry still need separate inspection. The channel name pressure does not make its normalized values physical pressure.
Before replacing a synthetic publisher with hardware, use the GelSight Mini and DIGIT integration comparison to identify the documented sensor output. An optical image needs its own acquisition and message contract; it is not the normalized taxel array used here.
| Field or concept | Meaning in this demo |
|---|---|
| rows / columns | 4 / 4 by default; 16 logical taxels. |
| channels / units | pressure, shear_x, shear_y; all three units are normalized. No newtons or pascals. |
| values / valid | 48 channel-major values and 16 validity bytes by default. 1 = usable; 0 = masked/invalid. |
| Flattening | ((channel * rows) + row) * columns + column. Read channel order from each message. |
| header.frame_id / sensor_id | demo_tactile_surface / demo_surface. A name alone does not provide TF geometry. |
| Sampling time | For real acquisition, the measurement time. Here header.stamp is the ROS clock read after synthetic values are computed; there is no physical sample. |
| Receive time | A subscriber-side timestamp on arrival. The included monitor does not record it. A bag timestamp must be interpreted with its recording and middleware semantics. |
| End-to-end latency | Requires a defined start and end, compatible clocks and measured timestamps. Neither the publisher rate nor this monitor measures sensor-to-action latency. |
5. Record the topic with rosbag2
Keep Terminal A running. In Terminal B, record the topic using the repository’s best-effort, volatile QoS override. This path follows the actual cloned directory name, ros2-tactile-starter-kit.
Let messages arrive, then press Ctrl+C in Terminal B so rosbag2 closes the recording. Inspect the bag information and verify the topic, type and a nonzero message count. Counts and storage metadata depend on your run; no example count is asserted here. Choose a new output directory if tactile_demo already exists.
cd ~/roboskin_ws
ros2 bag record --topics /tactile/array \
--qos-profile-overrides-path src/ros2-tactile-starter-kit/src/roboskin_tactile_demo/config/rosbag2_qos_overrides.yaml \
-o tactile_demo
# Press Ctrl+C before running the next command.
ros2 bag info tactile_demo6. Stop live publishing, then replay
Press Ctrl+C in Terminal A to stop both launched nodes. Start only the monitor there. Play the recording in Terminal B after the monitor has started. This prevents live and recorded messages from mixing on the same topic.
The replay preserves the recorded header stamps while publication happens later. A wall-clock subtraction against an old stamp measures age plus other effects, not the original live transport latency. This monitor does not use simulation time or compute latency, so the exercise does not require --clock.
cd ~/roboskin_ws
source /opt/ros/lyrical/setup.bash
source install/setup.bash
ros2 run roboskin_tactile_demo contract_monitorcd ~/roboskin_ws
ros2 bag play tactile_demo \
--qos-profile-overrides-path src/ros2-tactile-starter-kit/src/roboskin_tactile_demo/config/rosbag2_qos_overrides.yaml7. What was actually verified
On 2026-09-16, we cloned commit 7bf81d2, read the message, package entry points, launch file, publisher, monitor and QoS configuration, and ran the four dependency-free contract tests with CPython 3.13.3 on Windows. Python compilation also passed. The output below is from that local contract-test run; it is not ROS terminal output.
GitHub Actions run 32648006098 reports successful dependency installation, colcon build and generated-interface inspection in osrf/ros:lyrical-desktop for this exact commit. We inspected the workflow and run/job results. That workflow does not launch the demo or record and replay a bag.
This local environment has no ROS 2 installation, Docker runtime or installed WSL distribution. The launch, inspection, recording and playback commands above remain unexecuted here. There is no claimed live message output, timing measurement, hardware test or calibration result.
When moving from this software exercise to research data, consult the tactile dataset access and reproduction review to check actual files, licenses and splits. A working message pipeline does not establish that a paper's dataset can be obtained or reproduced.
test_demo_is_explicitly_synthetic_and_normalized ... ok
test_message_fields_and_layout_rule_are_published ... ok
test_qos_matches_ros_sensor_data_profile_shape ... ok
test_sample_frame_is_a_complete_two_by_two_grid ... ok
Ran 4 tests
OKChallenges & Limitations
Synthetic signals cannot validate a sensor. At the pinned starter-kit revision, the publisher constructs its channels from sine and cosine functions and labels every unit normalized. Successful message delivery would test the software contract, not physical pressure, shear calibration, contact detection or hardware compatibility.
QoS compatibility does not guarantee a complete recording. ROS 2 Lyrical documents that incompatible publisher/subscriber policies can prevent delivery, and that best-effort delivery may lose samples. This publisher uses the sensor-data QoS profile. Inspect the actual publisher, subscriber and rosbag2 settings and message counts before treating a bag as complete evidence.
Timestamps and grid shape do not supply latency or geometry. The publisher stamps each generated frame with its ROS clock; it does not measure a physical acquisition-to-action path. The message contract requires separate clock/synchronization documentation, taxel positions, calibration and invalid-taxel metadata. Replaying old stamps cannot recover a live latency measurement that was never recorded.
Troubleshooting by symptom
Work through these checks before changing the interface or treating an empty stream as a sensor fault.
| Symptom | Check and next step |
|---|---|
| ros2 or a package cannot be found | Source /opt/ros/lyrical/setup.bash and ~/roboskin_ws/install/setup.bash in that terminal. Check the first colcon error if the overlay was not built. |
| rosdep reports an existing default sources file | Skip rosdep init on that installation; run rosdep update. Do not repeatedly initialize it. |
| Echo or recording receives no data | Check that Terminal A is alive, both terminals use the same ROS_DOMAIN_ID and middleware environment, and the subscriber uses best-effort / volatile QoS. Inspect ros2 topic info --verbose. |
| QoS file does not exist | Run from ~/roboskin_ws and use src/ros2-tactile-starter-kit/…; a differently named clone needs a correspondingly different path. |
| Bag output directory already exists | Choose a new -o directory. Preserve recordings you still need. |
| Monitor prints nothing during a short replay | It reports every tenth accepted frame. Inspect the bag count and use topic echo to inspect a shorter stream. Start the monitor before playback. |
| Unexpected shape, units or invalid values | Compare lengths with rows × columns × channels; inspect units and validity. Do not turn invalid taxels into zero or interpret normalized data as force. |
| Replay appears to contain extra frames | Stop the live publisher before playback and check for other publishers on the same topic. |
What each verification stage can establish
On November 3, 2026, we reread the same full starter-kit commit, checked its public files against their Git blob hashes and reran the four existing dependency-free tests on Windows CPython 3.13.3. Five Python files also compiled in memory. No ROS package was imported or executed by that check. The September record above remains a separate historical run.
The tests inspect source conventions and the separate 2 by 2 CSV fixture; they do not execute the default 4 by 4 publisher. Passing them is useful evidence about the teaching contract, but it cannot establish delivered message counts or a recording that can be replayed. The stages below show what evidence to collect next, without presenting unrun steps as results.
For raw, filtered and transformed physical observations, compare the Kilted force/torque pipeline interpretation. It explains a different interface and version scope; its configuration examples are not drop-in additions to this Lyrical kit.
Before assigning physical units, use the tactile calibration guide to choose an independent reference. A normalized array with valid dimensions is not a calibrated sensor.
| Stage | Evidence in this review | Still not established |
|---|---|---|
| Source and fixture contract | Four existing tests passed; five Python files compiled on November 3. | ROS imports, node execution and middleware behavior. |
| Package build and interface | Successful August 23 CI run for the pinned commit; historical logs reread. | A fresh build on your machine or the current mutable container image. |
| Live publication and inspection | Commands retained; local runtime not executed. | Actual delivered rate, complete frames and clock behavior. |
| Record and replay | Procedure retained; no new bag or playback result. | Message completeness or faithful replay in your installation. |
| Physical sensing and control | No hardware experiment. | Calibration, acquisition-to-action latency or task performance. |
Hardware follow-up: the ICRA 2026 tactile gripper tutorial
The tutorial authors provide a PincOpen two-finger gripper example with Melexis Tactaxis sensing. Their repository includes CAD, electronics, an assembly guide, a bill of materials, ROS 2 packages and Python examples. It is a concrete hardware follow-up to the synthetic message and replay exercises on this page.
The repository documents a ROS 2 Humble environment and Ubuntu 22.04 testing by its authors. Check the current instructions and hardware revision before following it. RoboSkin.ai has reviewed the public documentation but has not built this gripper or verified its ROS runtime; the existing starter-kit exercise and this hardware project are separate implementations.
- Start with the hardware assembly and wiring documents, then confirm axis conventions, units and zero-load behavior.
- Bring verified measurements into a timestamped data contract before recording, replaying or using them in a controller.
- Do not assume packages or launch files from one tutorial work unchanged with the other.
Common questions
Is this a hardware driver or standard message?
No. It is an Apache-2.0 experimental message and synthetic publisher. Hardware acquisition, calibration, compatibility and actuator control have not been implemented or verified by this tutorial.
Can I use the CSV from the repository as a captured run?
No. sample_data/tactile_frame.csv is a separate 2 × 2, four-row synthetic fixture, not a recording of the default 4 × 4 publisher.
How do I inspect data before learning ROS 2?
Use the Python tactile data exercise. It has independent synthetic time-series data, explicit validity checks and actual generated results, without a ROS dependency.
Next steps
- Robotics programming learning path →
Connect first programs, middleware and sensor feedback.
- Process synthetic tactile data with Python →
Run a CSV quality check, generate plots and export teaching contact events.
- Dataset reproduction evidence →
Check access, licenses and splits before choosing training data.
- RoboSkin ROS 2 starter kit →
Open the Apache-2.0 code and its source history.