Integration / ROS 2

micro-ROS node setup and MoveIt 2 configuration.

The TK firmware ships with a built-in micro-ROS node. No bridging required. This guide covers node initialization, topic layout, launch file structure, and MoveIt 2 SRDF integration.

Humble / Iron / Jazzy
Supported ROS 2 distributions
400 Hz
Control loop cycle time
URDF + SRDF included
MoveIt 2 ready out of the box
Integration / ROS 2

ROS 2 Integration

Prerequisites

Before you start, ensure you have:

  • ROS 2 Humble, Iron, or Jazzy installed on your host machine
  • A TK actuator with firmware v1.2+ (check with tknd_fw_version)
  • USB-to-UART adapter for initial micro-ROS transport (or Ethernet for EtherCAT path)
  • micro_ros_agent package installed: sudo apt install ros-$ROS_DISTRO-micro-ros-agent

micro-ROS Agent Setup

The TK firmware runs a micro-ROS node on the STM32. The micro-ROS agent bridges the UART transport to your ROS 2 graph. Start the agent:

ros2 run micro_ros_agent micro_ros_agent serial \
  --dev /dev/ttyUSB0 \
  --baudrate 921600

Once connected, the actuator announces itself on the ROS 2 graph. Verify with:

ros2 node list
# /tk_joint_0 (or whichever node ID is configured)

Topic Layout

Each actuator node exposes these standard topics:

TopicTypeDirection
/tk_joint_N/joint_statesensor_msgs/JointStatePublished
/tk_joint_N/cmd_posstd_msgs/Float64Subscribed
/tk_joint_N/cmd_velstd_msgs/Float64Subscribed
/tk_joint_N/cmd_torquestd_msgs/Float64Subscribed
/tk_joint_N/impedance_paramstknd_msgs/ImpedanceParamsSubscribed
/tk_joint_N/diagnosticsdiagnostic_msgs/DiagnosticArrayPublished

Where N is the actuator node ID (0–63), set in firmware via EEPROM[0x2001].

Launch Files

A sample launch file for a 6-DOF arm with TK-120 at each joint:

from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    agents = []
    for i in range(6):
        agents.append(Node(
            package='micro_ros_agent',
            executable='micro_ros_agent',
            name=f'tk_agent_{i}',
            arguments=['serial', '--dev', f'/dev/ttyUSB{i}',
                       '--baudrate', '921600'],
        ))
    return LaunchDescription(agents)

Note: For EtherCAT transport, use the tknd_ethercat_bridge package instead of direct serial agents. See the EtherCAT guide for setup.

MoveIt 2 SRDF

The TK firmware package includes URDF and SRDF files for each actuator model. Copy them into your MoveIt 2 config package:

cp $TKND_FIRMWARE_PKG/urdf/tk_120.urdf.xacro \
   ~/ros2_ws/src/my_robot_moveit/config/

cp $TKND_FIRMWARE_PKG/srdf/tk_120.srdf \
   ~/ros2_ws/src/my_robot_moveit/config/

The included SRDF defines one planning group per joint (joint_group_N) and a default virtual joint for each axis. Edit as needed for your kinematic chain.

Joint State Publisher

To aggregate all TK joint state topics into a single /joint_states message for robot_state_publisher:

ros2 run joint_state_publisher joint_state_publisher \
  --ros-args -p source_list:="[
    '/tk_joint_0/joint_state',
    '/tk_joint_1/joint_state',
    '/tk_joint_2/joint_state'
  ]"

This is required for RViz and MoveIt 2 to track the robot's current configuration. Adjust the list for your DOF count.

Related guides

EtherCAT Setup CANopen Integration Quickstart Guide
Request Engineering Sample