Skip to main content
🤝

이 가이드는 인류와 AI가 함께 만드는 지식입니다.

이 콘텐츠는 Human + AI Partnership 철학 아래 모든 사람이 로봇·AI를 배울 수 있도록 무료로 제공됩니다. 당신의 질문과 기여가 다음 학생의 미래를 바꿉니다.

ROS 2 Collaborative Robots Guide 2026

Cobots work safely alongside people without cages — the fastest-growing segment of industrial robotics. This guide covers the ROS 2 stack for collaborative arms: UR/Franka/KUKA integration, MoveIt 2 planning, force control, and the ISO/TS 15066 safety that makes collaboration legal.

1. The Cobot Stack

sudo apt-get install -y   ros-humble-moveit   ros-humble-ros2-control   ros-humble-ros2-controllers   ros-humble-ur-robot-driver   ros-humble-franka-ros2

# Layers:
#   1. Hardware driver   (UR / Franka / KUKA ros2_control)
#   2. Controllers        (position / velocity / force)
#   3. MoveIt 2           (planning + collision checking)
#   4. Safety monitor      (speed & separation, force limits)
#   5. Task / skills        (pick-place, assembly, hand-guide)

2. Connecting Real Cobots

# Universal Robots UR5e
ros2 launch ur_robot_driver ur_control.launch.py   ur_type:=ur5e robot_ip:=192.168.1.102   launch_rviz:=false

# Franka Emika (FR3 / Panda) with real-time control
ros2 launch franka_bringup franka.launch.py   robot_ip:=172.16.0.2 arm_id:=fr3

# Verify controllers are active
ros2 control list_controllers
#   joint_state_broadcaster   active
#   scaled_joint_trajectory_controller  active

3. Motion Planning with MoveIt 2

from moveit.planning import MoveItPy
from geometry_msgs.msg import PoseStamped

moveit = MoveItPy(node_name="cobot_moveit")
arm = moveit.get_planning_component("manipulator")

target = PoseStamped()
target.header.frame_id = "base_link"
target.pose.position.x = 0.4
target.pose.position.y = 0.1
target.pose.position.z = 0.3
target.pose.orientation.w = 1.0

arm.set_start_state_to_current_state()
arm.set_goal_state(pose_stamped_msg=target, pose_link="tool0")
plan = arm.plan()
if plan:
    moveit.execute(plan.trajectory, controllers=[])

4. Force & Compliance Control

Cobots must yield on contact. Use admittance/impedance control for safe interaction and assembly:

def admittance_step(self, wrench, dt):
    # Compliant motion: measured force -> commanded velocity
    # M x'' + D x' + K x = F_ext  (here mass-damper, K=0 for free float)
    accel = (wrench - self.D * self.vel) / self.M
    self.vel += accel * dt
    pose_delta = self.vel * dt
    # A push on the tool moves the arm gently — the basis of
    # hand-guiding and force-controlled insertion (peg-in-hole).
    return pose_delta

5. Hand-Guiding (Teaching by Demonstration)

def hand_guide_record(self):
    self.enter_gravity_compensation()   # arm becomes weightless
    waypoints = []
    while self.teach_button_pressed():
        waypoints.append(self.current_pose())   # operator moves the arm
        sleep(0.1)
    self.exit_gravity_compensation()
    return simplify(waypoints)   # replay as a trajectory later

6. ISO/TS 15066: Collaborative Safety

7. Speed & Separation in Practice

def ssm_speed_scale(self, human_distance):
    # Scale robot speed with distance to the nearest person
    if human_distance < self.stop_dist:      # e.g. 0.3 m
        return 0.0                            # protective stop
    if human_distance > self.full_speed_dist: # e.g. 2.0 m
        return 1.0
    # Linear ramp in between
    span = self.full_speed_dist - self.stop_dist
    return (human_distance - self.stop_dist) / span
    # Multiply the trajectory controller's speed override by this.

8. Collision-Aware Planning

# Maintain the MoveIt planning scene from live perception
from moveit_msgs.msg import CollisionObject

def add_workspace_obstacle(self, box_pose, size):
    obj = CollisionObject()
    obj.header.frame_id = "base_link"
    obj.id = "fixture"
    # ... define primitive box at box_pose with 'size'
    self.planning_scene.apply_collision_object(obj)
    # MoveIt now plans around it; a depth camera can update this
    # in real time so the cobot avoids people and clutter.

9. Common Cobot Tasks

10. Deployment Checklist

Key Takeaways

Cobots make robotics safe around people — but only when the safety is engineered, not assumed. Drive UR/Franka/KUKA arms through ros2_control and plan with MoveIt 2, use admittance control for compliant contact and hand-guiding, and implement ISO/TS 15066 speed-and-separation and power-and-force limiting. A cobot is only "collaborative" after a real risk assessment and validated contact forces — design safety in from the first line of code.