Skip to content

Get Publisher Names and Types

SUMMARY

Pass name=... when constructing any Synapse robot and it automatically streams joint state, TCP pose, and link transforms over Zenoh using BabyROS - no manual publisher setup required. get_publisher_names_and_types reads back the topic names and message types that background publisher exposes, so a BabyROS subscriber knows exactly what to subscribe to.

The Skill

python
robot.get_publisher_names_and_types()

Topics Published

TopicContents
synapse/robots/<ClassName>/<name>/stateJoint state (positions, velocities) and TCP pose.
synapse/robots/<ClassName>/<name>/tfNamespaced link transforms for the full kinematic tree.

<ClassName> is the robot's Python class name (e.g. UniversalRobotsUR10E) and <name> is the string passed to the constructor. get_publisher_names_and_types returns these topic names together with their message types.

The Code

python
"""
Logs the babyros topics published by a named robot and their message types.

Supports Universal Robots (UR), Epson, virtual, and Isaac Sim.

Usage:
    python get_publisher_names_and_types.py [--ip <ROBOT_IP>] [--prim_path <PRIM_PATH>]
"""

import argparse

from loguru import logger

from telekinesis.synapse.robots.manipulators import universal_robots


def main(ip: str | None, prim_path: str | None) -> None:
    """Log the babyros topics published by a named robot."""

    #===================== Create Robot ==========================================
    robot = universal_robots.UniversalRobotsUR10E(name='UR10e')

    try:
        #===================== Connect Robot ==========================================
        if ip:
            robot.connect(ip=ip)
        elif prim_path:
            robot.connect(simulation_prim_path=prim_path)

        # ==================== Run Skill ============================================
        logger.success(f"publisher_names_and_types: {robot.get_publisher_names_and_types()}")
    except (ConnectionError, OSError) as e:
        logger.error(f"Error occurred: {e}")
    finally:
        robot.disconnect()
        robot.shutdown()


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Read publisher names and types Synapse example")
    parser.add_argument("--ip", type=str, default=None,
                         help="UR robot IP address for real hardware, e.g. 192.168.1.100")
    parser.add_argument("--prim_path", type=str, default=None,
                         help='Isaac Sim articulation prim path, e.g. "/World/ur10e"')
    args = parser.parse_args()

    main(ip=args.ip, prim_path=args.prim_path)

Running the Example

bash
python get_publisher_names_and_types.py
bash
python get_publisher_names_and_types.py --prim_path /World/ur10e
bash
python get_publisher_names_and_types.py --ip 192.168.1.100

For all options:

bash
python get_publisher_names_and_types.py --help

Parameter Configuration

This skill takes no input parameters.

Returns

TypeDescription
list[tuple[str, type]](topic_name, message_type) pairs describing every topic the background publisher is currently emitting - the same state and tf topics listed above. Returns an empty list if the robot was constructed without a name (no publisher exists).

Where to Use the Skill

  • Dynamic subscriber setup - Build a BabyROS subscriber without hardcoding topic names or message types.
  • Remote monitoring - Discover what a robot is streaming before wiring up a dashboard or logging service.
  • Digital twin - Confirm the topics feeding a Rerun visualization match what you expect from a separate process.

When Not to Use the Skill