여기서 로봇 모델은 시뮬레이션 상의 로봇(게임오브젝트)을 의미합니다.
진짜 Unity에서 로봇 모델 Import하는 거 쉽지 않다...
1. 유니티에서 제공하는 URDF Importer 설치
상단 메뉴바에서 window → package manager
+ → add package from git URL …
아래의 URL 넣어서 패키지 설치
https://github.com/Unity-Technologies/URDF-Importer.git?path=/com.unity.robotics.urdf-importer
2. URDF Import
터틀봇3로 진행
아래의 링크의 turtlebot3_description을 유니티 Assets으로 복사
https://github.com/ROBOTIS-GIT/turtlebot3
Asssets/turtlebot3_description/urdf에서 burger를 import
그러나 stl 파일을 못찾는다고 나온다.
urdf 파일을 열어보면 mesh 파일을 아래와 같은 경로에서 찾고 있기 때문인데
<mesh filename="package://turtlebot3_description/meshes/bases/burger_base.stl" scale="0.001 0.001 0.001"/>
package://를 상대경로라고 생각해버리자
turtlebot3_description 폴더를 복사해서 urdf 폴더에 붙여넣기
그럼 Assets/turtlebot3_description/urdf에는 urdf파일들과 turtlebot3_description 디렉토리가 하나 더있는 상태
이제 다시 Import Robot from Selected URDF file을 클릭하면 로봇 모델이 잘 생성됨
이제 하이러키에서 base_footprint를 클릭후 inspector에서 arcitulation body를 추가해야 함
(아무래도 URDF importer에 문제가 있는 것 같음...)
로봇 모델 생성 성공
끝!
이면 좋겠으나 아래 링크의 <5. ROS2-시뮬레이터 연동 테스트> 부분에서 트러블 슈팅이 있다..
https://ko-ko-song.tistory.com/49
'Unity Robotics' 카테고리의 다른 글
[Unity] 3D model import 하는 방법 (0) | 2025.01.08 |
---|---|
[Unity] unityhub 로그인이 안될 때 (ubuntu 22.04) (0) | 2025.01.08 |
[Unity] vscode 연동(ubuntu 22.04) (0) | 2025.01.08 |
[Unity] Nav2 테스트 환경 구축 with turtlebot3 (1) | 2024.12.31 |
[Unity] Unity-ROS-Integration (0) | 2024.12.31 |