05. 로봇 임포트 / 조작
로봇은 보통 URDF나 MJCF로 정의된다. Isaac Sim은 두 포맷 모두 USD로 자동 변환하는 임포터를 가지고 있다 — isaacsim.asset.importer.urdf.URDFImporter. NVIDIA가 미리 변환해 둔 로봇 라이브러리(Franka, UR10, Spot, Carter, Husky 등)는 get_assets_root_path() URL로 즉시 다운로드해서 쓸 수 있다.
이 기능의 강점
- URDF·MJCF·SDFormat 임포터 빌트인 — ROS 생태계와 호환
- 변환 결과가 표준 USD라 다른 OpenUSD 툴에서도 열림
merge_mesh,collision_from_visuals같은 옵션으로 충돌·메시 자동 최적화ArticulationController+ArticulationAction으로 즉시 관절 명령
구현 방법
(A) URDF: URDFImporterConfig(urdf_path=...).import_urdf(). (B) 클라우드 자산: add_reference_to_stage(usd_path=get_assets_root_path()+"/Isaac/Robots/..."). 이후 Robot(prim_path).get_articulation_controller().apply_action(ArticulationAction(joint_positions=...)).
최소 데모
검증 결과
Franka 9-DOF (7 관절 + 2 그리퍼)가 reference 한 줄로 로드되어 RTX 렌더에 그대로 나타남.
핵심 코드 발췌
from isaacsim.core.utils.stage import add_reference_to_stage
from isaacsim.storage.native import get_assets_root_path
franka_usd = get_assets_root_path() + \
"/Isaac/Robots/FrankaRobotics/FrankaPanda/franka.usd"
robot = add_reference_to_stage(usd_path=franka_usd, prim_path="/World/Franka")
코드 다운로드 (zip)
실무 예제 — Franka 3 포즈 (home → reach → pre-grasp) 관절 명령
isaacsim.core.api.robots.Robot + ArticulationAction으로 Franka에 3가지 관절 위치 명령을 순차 적용. "home → reach 자세 → pre-grasp 자세"로 변환되는 모습을 4장에 캡처. 픽-앤-플레이스 모방학습 데이터 수집의 기본 패턴.
스크립트 stdout: pose=home ee_z=-2.40 → pose=reach ee_z=-2.00 → pose=pre_grasp ee_z=-1.70. 9개 dof (panda_joint1-7 + panda_finger_joint1/2) 인식 후 ArticulationAction이 정확히 적용됨.
실무 데모 코드
from isaacsim.core.api.robots import Robot
from isaacsim.core.utils.types import ArticulationAction
franka = Robot(prim_path="/World/Franka", name="franka")
world.scene.add(franka)
world.reset()
poses = {
"home": np.array([0,-0.5,0,-2.4,0,2.0,0.78, 0.04,0.04]),
"reach": np.array([0, 0.3,0,-2.0,0,2.3,0.78, 0.04,0.04]),
"pre_grasp": np.array([0, 0.5,0,-1.7,0,2.2,0.78, 0.02,0.02]),
}
for name, p in poses.items():
franka.get_articulation_controller().apply_action(
ArticulationAction(joint_positions=p))
for _ in range(120):
world.step(render=True)
실무 데모 코드 zip