Bạn đã có robot trên stage và đã biết vòng lặp mô phỏng. Giờ là lúc bắt robot cử động bằng code. Isaac Sim 5.x dùng lớp Articulation (nhiều robot) và SingleArticulation (một robot) trong isaacsim.core.prims.
- Nạp robot từ thư viện asset và lấy danh sách khớp.
- Điều khiển khớp theo vị trí, vận tốc, mômen.
- Tránh nhầm lẫn giữa đặt trạng thái và ra lệnh.
1. Nạp robot và tạo đối tượng Articulation
Ví dụ sau dựa trên getting_started_robot.py đi kèm bản 5.1: một tay Franka và một xe Nova Carter trong cùng cảnh.
from isaacsim import SimulationApp
simulation_app = SimulationApp({"headless": False})
import numpy as np
from isaacsim.core.api import World
from isaacsim.core.prims import Articulation
from isaacsim.core.utils.stage import add_reference_to_stage
from isaacsim.storage.native import get_assets_root_path
root = get_assets_root_path() # máy chủ asset của NVIDIA (hoặc bản tải về máy)
world = World(stage_units_in_meters=1.0)
world.scene.add_default_ground_plane()
add_reference_to_stage(root + "/Isaac/Robots/FrankaRobotics/FrankaPanda/franka.usd", "/World/Arm")
arm = Articulation(prim_paths_expr="/World/Arm", name="arm")
add_reference_to_stage(root + "/Isaac/Robots/NVIDIA/NovaCarter/nova_carter.usd", "/World/Car")
car = Articulation(prim_paths_expr="/World/Car", name="car")
arm.set_world_poses(positions=np.array([[0.0, 1.0, 0.0]])) # tách hai robot trước khi chạy
car.set_world_poses(positions=np.array([[0.0, -1.0, 0.0]]))
world.reset()
print(arm.dof_names) # 7 khớp tay + 2 khớp ngón
print(car.num_dof) # 7 bậc tự do của Nova Carter

Mọi hàm của Articulation làm việc với mảng 2 chiều (số robot, số khớp) – kể cả khi chỉ có một robot, nên bạn thấy [[...]]. Nếu chỉ có một robot và muốn mảng 1 chiều, dùng SingleArticulation(prim_path=..., name=...).
2. Đọc trạng thái
q = arm.get_joint_positions() # rad (khớp quay) / m (khớp tịnh tiến)
dq = arm.get_joint_velocities()
tau = arm.get_measured_joint_efforts()
pos, quat = arm.get_world_poses() # quat (w, x, y, z)
idx = arm.get_dof_index("panda_joint2")
3. "Đặt" và "ra lệnh" – hai việc khác nhau

| Hàm | Bản chất | Dùng khi |
|---|---|---|
set_joint_positions(), set_joint_velocities() | Ghi thẳng trạng thái – khớp "dịch chuyển tức thời", bỏ qua động lực học | Đặt tư thế ban đầu, reset tập huấn luyện |
apply_action(ArticulationActions(...)), set_joint_position_targets() | Đặt đích cho drive; drive kéo khớp tới bằng lực | Điều khiển trong lúc chạy |
set_joint_efforts() | Đặt mômen trực tiếp (drive nên có stiffness = damping = 0) | Điều khiển lực, chính sách RL dạng mômen |
set_joint_positions() trong vòng điều khiển. Robot trông như chạy đúng, nhưng vật bị gắp không theo, va chạm vô nghĩa và mọi số đo mômen đều sai. Tài liệu triển khai chính sách RL cũng cảnh báo điều này: luôn dùng apply_action().4. Ra lệnh bằng ArticulationActions
from isaacsim.core.utils.types import ArticulationActions
# tay máy: điều khiển vị trí 9 khớp
target = np.array([[0.0, -0.5, 0.0, -2.0, 0.0, 1.6, 0.8, 0.04, 0.04]])
arm.apply_action(ArticulationActions(joint_positions=target))
# chỉ điều khiển vài khớp: truyền thêm chỉ số
j2 = arm.get_dof_index("panda_joint2")
arm.apply_action(ArticulationActions(joint_positions=np.array([[-1.0]]),
joint_indices=np.array([j2])))
# xe: điều khiển vận tốc hai bánh dẫn động
wheels = [car.get_dof_index(n) for n in ("joint_wheel_left", "joint_wheel_right")]
car.apply_action(ArticulationActions(joint_velocities=np.array([[5.0, 5.0]]),
joint_indices=np.array(wheels)))
Với SingleArticulation hoặc robot lớp Robot, lệnh tương ứng là robot.get_articulation_controller().apply_action(ArticulationAction(...)) (số ít, mảng 1 chiều) – đây là kiểu bạn sẽ gặp trong các controller có sẵn ở bài #13 – #15.

5. Lệnh không có tác dụng? Kiểm tra theo thứ tự
- Đã
world.reset()(hoặcinitialize()) chưa? Trước đó handle vật lý chưa tồn tại. - Mô phỏng có đang Play không? Lệnh gửi lúc dừng không làm gì.
- Drive của khớp có phù hợp kiểu lệnh không: lệnh vận tốc cho khớp stiffness lớn sẽ bị "giữ chặt"; lệnh vị trí cho khớp stiffness 0 không có lực kéo.
- Thứ tự khớp: luôn lấy chỉ số qua
get_dof_index()thay vì đoán; thứ tựdof_namescó thể khác thứ tự trong URDF. - Max force của drive quá nhỏ so với tải.
Bài tiếp theo (#13): robot di động – WheeledRobot, bộ điều khiển vi sai, đa hướng và Ackermann.
Tài liệu tham khảo
- Core API Tutorial: Hello Robot
- Articulation Controller
- Robot Simulation Snippets
- Core API Overview
- Ví dụ standalone đi kèm Isaac Sim 5.1 (GitHub isaac-sim/IsaacSim)
Loạt bài "Robot với Isaac Sim" viết theo tài liệu và mã nguồn NVIDIA Isaac Sim 5.1.0. Isaac Sim, Omniverse, PhysX, RTX là thương hiệu của NVIDIA.
Một số ảnh minh họa lấy từ tài liệu NVIDIA Isaac Lab (github.com/isaac-sim/IsaacLab), Copyright © 2022-2025 The Isaac Lab Project Developers, phát hành theo giấy phép BSD-3-Clause; ảnh được thu nhỏ/ghép, giữ nguyên nội dung.