SpotMicro Pybullet on Linux

$ git clone <https://github.com/Road-Balance/SpotMicroJetson.git>

# 아직 가상환경을 만들지 않으셨다면!
$ python3 -m venv <your-env>

$ source <your-env>/bin/activate
$ pip install --upgrade pip

$ cd SpotMicroJetson/Simulation/
$ pip3 install -U -r requirements.txt
$ sudo ./<your-env>/bin/python3 pybullet_automatic_gait.py

# example
$ sudo /home/swimming/Desktop/RoadBalance/test_env/bin/python3 pybullet_automatic_gait.py

<aside> 💡 오류 발생 시 ⇒ venv 폴더 삭제 후 다시 진행

</aside>

<aside> 💡 vscode terminal blank: File -> Preferences -> Setting -> Features -> Terminal -> Inherit Env

</aside>

Pybullet UI 설명

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/cbccbf2b-7cd1-4016-91c9-0c4c52909d74/Untitled.png

⚙️ 마우스 휠 ⇒ 확대 축소

🖱️ ctrl + 좌클릭 ⇒ 회전

🖱️ ctrl + 휠클릭 ⇒ 이동

➕ 각종 매개변수들

🎥 Camera 데이터들

🤖 시뮬레이션 로봇

⛱️ 시뮬레이션 배경, 지형

Pybullet 기초

pybullet_basic.py


# venv가 activate된 상태에서
$ cd SpotMicroJetson/Simulation/pybullet_tutorial

$ pip install pybullet
$ python pybullet_basic.py

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/eee95955-e01e-4b8b-b4a6-2be9c2008d29/Untitled.png

import pybullet as p
import time
import pybullet_data
# A simulation is started using the p.connect() method. 
# Several connection modes are available, with 
# p.GUI allowing for visualization and debugging, 
# and p.DIRECT providing the fastest, non-visual connection. 
physicsClient = p.connect(p.GUI)

# The module pybullet_data provides many example Universal Robotic Description
# Format (URDF) files. 
p.setAdditionalSearchPath(pybullet_data.getDataPath())
p.setGravity(0, 0, -9.8)

# You can set how many seconds to update once 
# you update in a physical simulation.
p.setTimeStep(1/200)