관절 구동체의 효율적인 미분 가능 시뮬레이션
Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin
<!-- [[Project]](https://gamma.umd.edu/researchdirections/mlphysics/diffsim/) -->
[Paper]
[Video]
[Slides]
[Code]
설정 방법 (Setup)
- 이 프로젝트는 현재 개발 중인(work-in-progress) 상태입니다. gcc 버전 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04), cmake 3.17.3, 그리고 CUDA 10.2 (MBPO에만 필요)로 빌드할 수 있습니다.
- 이 리포지토리를 클론하고 파이썬 환경을 설정합니다.
git clone [email protected]:YilingQiao/diffarticulated.git
cd diffarticulated
conda env create -f gpu-env.yml
...
- 이 라이브러리를 컴파일합니다.
mkdir build
cd build
cmake ..
...
uuid 라이브러리가 없는 경우, apt-get install uuid-dev로 설치할 수 있습니다. 저희는 곧 uuid를 third_party 디렉토리에 추가할 예정입니다.
- 예제 실행
예제 (Examples)
시각화 시작
시뮬레이션에는 meshcat을 사용합니다. 시뮬레이션을 실행하기 전에 다음 명령어를 실행하여 세션을 시작하십시오.
시뮬레이션 코드 실행
미분 가능한 물리(differentiable physics)를 사용하여 역물리(inverse physics)를 해결하는 예제는 python/exp_throw.py입니다. 다음 명령어를 실행하면
python python/exp_throw.py
60 에피소드 동안 제어 입력(control input)을 최적화합니다.
시뮬레이션 결과
- 한 프레임으로 시뮬레이션 결과를 내보내고 싶다면, 파이썬 코드에서
world.sync_visual_meshcat(sim_step)를 호출할 수 있습니다. 예제는 python/exp_throw.py에서 확인할 수 있습니다.
- 기본적으로 시뮬레이션 기록은
meshcat/his/에 저장됩니다. 이 경로는 examples/meshcat_urdf_visualizer.h의 sync_visual_transforms() 함수를 수정하여 사용자 정의할 수 있습니다.
- 시뮬레이션 기록을 obj 메시(obj meshes)로 변환하려면 다음 명령어를 실행하십시오.
cd python/results
cp -r ../../meshcat/* ./
python convert_history.py
...
새로운 기록을 생성하여 변환하기 전에, meshcat/his와 meshcat/obj의 캐시를 정리하십시오.
구슬 던지기 학습 (Learn to throw a marble)
구슬 던지기 데모를 실행하려면 다음 명령어를 사용합니다.
python python/exp_throw.py
<div align="center">
<img width="300px" src="https://github.com/YilingQiao/linkfiles/raw/master/icml21/throw.gif">
</div>
골프공 치기 학습 (Learn to hit a golf ball)
python python/exp_punch.py
<div align="center">
<img width="300px" src="https://github.com/YilingQiao/linkfiles/raw/master/icml21/punch.gif">
</div>
마찰 계수 학습 (Learn the frictional coefficient)
<div align="center">
<img width="300px" src="https://github.com/YilingQiao/linkfiles/raw/master/icml21/car.gif">
</div>
RL에 미분 가능 물리 적용하기
저희의 RL 코드는 별도의 repo에 있습니다.
- RL용 서브모듈을 클론합니다.
git submodule init
git submodule update
- MBPO 패키지를 설치합니다.
cd diffarti_mbpo/
git checkout master
pip install -e viskit
...
- 실험을 실행합니다.
정책 개선(Policy Enhancement)
diffarti_mbpo/에서 다음 명령어를 실행합니다.
chmod +x ./run_mbpo.sh
./run_mbpo.sh 8_7 pendulumours
<div align="center">
<img width="300px" src="https://github.com/YilingQiao/linkfiles/raw/master/icml21/pen.gif">
</div>
샘플 개선(Sample Enhancement)
diffarti_mbpo/에서 다음 명령어를 실행합니다.
./run_mbpo.sh final_3 antours
<div align="center">
<img width="300px" src="https://github.com/YilingQiao/linkfiles/raw/master/icml21/ant.gif">
</div>
관련 Repository
미분 가능 소프트 바디 동역학 Code Paper
Differentiable Simulation of Soft Multi-body Systems. Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin. (Neurips 2021)
미분 가능 관절 구동체 동역학 Code Paper
Efficient Differentiable Simulation of Articulated Bodies. Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin. (ICML 2021)
미분 가능 강체 및 천 결합 동역학 Code Paper
Scalable Differentiable Physics for Learning and Control. Yi-Ling Qiao, Junbang Liang, Vladlen Koltun, Ming C. Lin. (ICML 2020)
미분 가능 천 동역학 Code Paper
Differentiable Cloth Simulation for Inverse Problems. Junbang Liang, Ming C. Lin, Vladlen Koltun. (NeurIPS 2019)
감사의 글
훌륭한 오픈 소스 프로젝트인 tiny-differentiable-simulator에 감사드립니다. 이 저장소는 tinydiffsim에서 파생되었습니다. 템플릿화된 자동 미분(auto-differentiation)을 위해 원래의 tinydiffsim을 사용해 보시는 것이 좋을 수 있습니다.
Bibtex
@inproceedings{Qiao2021Efficient,
author = {Qiao, Yi-Ling and Liang, Junbang and Koltun, Vladlen and Lin, Ming C.},
title = {Efficient Differentiable Simulation of Articulated Bodies},
...