diff --git a/Asset/image-1.png b/Asset/image-1.png new file mode 100644 index 0000000..83977c6 --- /dev/null +++ b/Asset/image-1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87d7e3fbeba68f272b1cce88913963f592f613e4ab1013c0e1af56977715b76c +size 34155 diff --git a/Asset/image-2.png b/Asset/image-2.png new file mode 100644 index 0000000..fd63f16 --- /dev/null +++ b/Asset/image-2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:652e6e983fcf9e8ec0fc64401c52c300aa52216c8881299483110fa5e6b14066 +size 156566 diff --git a/Asset/image.png b/Asset/image.png new file mode 100644 index 0000000..c4ac446 --- /dev/null +++ b/Asset/image.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf82136be660853a4ee78436b416a595e0b2f4ae2b651c3f75f2f56de35b9b45 +size 173650 diff --git a/README.md b/README.md index 65a726f..df75243 100644 --- a/README.md +++ b/README.md @@ -22,22 +22,57 @@ StrideSim은 Isaac Lab을 기반으로 한 프로젝트입니다. 이 저장소 python -m pip install -e . ``` +## 꿀팁 + +1. 환경변수 설정 + +```bash +# Isaac Sim root directory +export ISAACSIM_PATH="${HOME}/.local/share/ov/pkg/isaac-sim-4.0.0" +# Isaac Sim python executable +alias ISAACSIM_PYTHON="${ISAACSIM_PATH}/python.sh" +# Isaac Sim app +alias ISAACSIM="${ISAACSIM_PATH}/isaac-sim.sh" +``` + ## 사용법 -1. 강화학습 라이브러리 설치 (Optional) +1. 강화학습 라이브러리 설치 ```bash cd rl python -m pip install -e . ``` -2. 강화학습 라이브러리 실행 +2. 강화학습 단독 실행 ```bash python rl/train.py --task Template-Isaac-Velocity-Rough-Anymal-D-v0 ``` -TODO +3. StrideSim 실행 + +3-1. 프로그램 실행 + + ```bash + # 환경변수 설정 후 + ISAACSIM + ``` + +3-2. 확장 프로그램 설정 + +3-2-1. window -> extension 창으로 이동 +3-2-2. 삼지창 버튼을 눌러 확장 프로그램 경로 삽입 (본 프로젝트의 exts까지 넣으면 된다.) +![alt text](Asset/image.png) + +3-2-3. 좌측에 시뮬레이션 버튼을 클릭 (이때, AUTOLOAD를 활성화하면 편하다.) + +3-3. 확장 프로그램 실행 +![alt text](Asset/image-1.png) +이제 Isaac Examples 탭에 StrideSim_AnymalD 탭이 나오는 것을 확인할 수 있다. + +![alt text](Asset/image-2.png) +버튼을 누르면 위와 같은 장면을 볼수 있고, anymalD를 부르는 것부터해서 학습 및 병렬 실행도 가능하다. ## 코드 포맷팅 diff --git a/exts/StrideSim/StrideSim/anymal_articulation.py b/exts/StrideSim/StrideSim/anymal_articulation.py index 2c3ee9f..e9b9dc1 100644 --- a/exts/StrideSim/StrideSim/anymal_articulation.py +++ b/exts/StrideSim/StrideSim/anymal_articulation.py @@ -128,12 +128,12 @@ def _compute_observation(self, command): R_IB = quat_to_rot_matrix(q_IB) R_BI = R_IB.transpose() - print("lin_vel_I: ", lin_vel_I) - print("ang_vel_I: ", ang_vel_I) - print("pos_IB: ", pos_IB) - print("q_IB: ", q_IB) - print("R_IB: ", R_IB) - print("R_BI: ", R_BI) + # print("lin_vel_I: ", lin_vel_I) + # print("ang_vel_I: ", ang_vel_I) + # print("pos_IB: ", pos_IB) + # print("q_IB: ", q_IB) + # print("R_IB: ", R_IB) + # print("R_BI: ", R_BI) lin_vel_b = np.matmul(R_BI, lin_vel_I) ang_vel_b = np.matmul(R_BI, ang_vel_I) @@ -200,7 +200,7 @@ def advance(self, dt, command): action = ArticulationAction(joint_positions=self._default_joint_pos + (self.action * self._action_scale)) - print("network action: ", self.action) + # print("network action: ", self.action) self.robot.apply_action(action) @@ -213,7 +213,7 @@ def initialize(self, physics_sim_view=None) -> None: self.robot.initialize(physics_sim_view=physics_sim_view) self.robot.get_articulation_controller().set_effort_modes("force") self.robot.get_articulation_controller().switch_control_mode("position") - self.robot._articulation_view.set_gains(np.zeros(12) + 200, np.zeros(12) + 5) + self.robot._articulation_view.set_gains(np.zeros(12) + 60, np.zeros(12) + 4) def post_reset(self) -> None: """ diff --git a/exts/StrideSim/StrideSim/base_sample/base_sample_extension.py b/exts/StrideSim/StrideSim/base_sample/base_sample_extension.py index 6dc2d41..71b3587 100644 --- a/exts/StrideSim/StrideSim/base_sample/base_sample_extension.py +++ b/exts/StrideSim/StrideSim/base_sample/base_sample_extension.py @@ -98,6 +98,9 @@ def _build_ui( self._window = omni.ui.Window( name, width=window_width, height=0, visible=keep_window_open, dockPreference=ui.DockPreference.LEFT_BOTTOM ) + + self._window.deferred_dock_in("Property", ui.DockPolicy.CURRENT_WINDOW_IS_ACTIVE) + with self._window.frame: self._main_stack = ui.VStack(spacing=5, height=0) with self._main_stack: @@ -161,7 +164,7 @@ def _build_ui( ui.Label("Task Name:", width=ui.Fraction(0.3)) self._rl_task_name_field = ui.StringField(height=0, width=ui.Fraction(0.7)) self._rl_task_name_field.model.set_value("Template-Isaac-Velocity-Rough-Anymal-D-v0") - ui.Label("window popup:", width=ui.Fraction(0.3)) + ui.Label("Window popup:", width=ui.Fraction(0.3)) self._headless_dropdown = ui.ComboBox(0, "on", "off") diff --git a/exts/StrideSim/StrideSim/network/policy.pt b/exts/StrideSim/StrideSim/network/policy.pt index 95fe96d..35ba3f7 100644 --- a/exts/StrideSim/StrideSim/network/policy.pt +++ b/exts/StrideSim/StrideSim/network/policy.pt @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8ba0f7431276772638e54d7d26632f7635fd5e7d42528dcb71674b4fa562c1d8 +oid sha256:3a300c0fe3db4548a3fe9e65ee0a20c67523c16f67b4fc97df208fe35854cd5e size 1158800