Skip to content

Commit

Permalink
feat: alpha 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mqjinwon committed Oct 16, 2024
1 parent 6311c20 commit 4ba0a46
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 13 deletions.
3 changes: 3 additions & 0 deletions Asset/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Asset/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Asset/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 38 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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를 부르는 것부터해서 학습 및 병렬 실행도 가능하다.

## 코드 포맷팅

Expand Down
16 changes: 8 additions & 8 deletions exts/StrideSim/StrideSim/anymal_articulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand All @@ -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:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion exts/StrideSim/StrideSim/network/policy.pt
Git LFS file not shown

0 comments on commit 4ba0a46

Please sign in to comment.