> For the complete documentation index, see [llms.txt](https://idminer.gitbook.io/robotis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://idminer.gitbook.io/robotis/part-3.-robotis-op3-ren-xing-ji-qi-ren/4.-robotis-ros-tao-jian/4.5.-robotis-op3-tools/4.5.1.-op3actioneditior-dong-zuo-bian-ji/4.5.1.2.-ru-men.md).

# 4.5.1.2. 快速上手

**Download & Build**

* 參考： [**Installing ROBOTIS ROS Package**](http://emanual.robotis.com/docs/en/platform/op3/recovery/#installing-robotis-ros-packages)

**Run**

執行 launch 啟動檔。&#x20;

**op3\_action\_editor** 可直接控制 ROBOTIS-OP3，因此其他控制程式（如**op3\_manager**，**op3\_offset\_tuner** 和 **op3\_walking\_tuner**）**不應運行**。

在執行 **op3\_action\_editor** 啟動檔之前，應先結束其他程式。

```
$ roslaunch op3_action_editor op3_action_editor.launch
```

**UI 使用介面說明**

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-LmgYYjhDiPnXmixNYtC%2F-LmgfSvVF_7Z8KETb8wV%2Fthormang3_action_editor_tui.jpg?alt=media&amp;token=9a19dc15-50cf-4c5a-ba97-d056cea2e899" alt=""></div>

* **Page Number 頁碼**：頁碼是所列出的頁碼。如果用戶想要創建新的動作姿態，則用戶可以使用任何空白頁。&#x20;
* **Page title 頁面標題**：ROBOTIS 建議用戶在空白頁上創建新動作時，使用頁面標題以幫助提醒。&#x20;
* **Current position 當前位置**：當前位置描述了實際從 Dynamixel 智能馬達 4,095 解析度，所轉換而來的 Dynamixel 智能馬達的位置值。此值由 op3\_action\_editor 中的 STP7 表示。有時後，該位置在 op3\_action\_editor 中可能被讀作 — - 。這表示 Dynamixel 的位置值還沒被讀取（或扭力被關閉）。如果用戶關閉 Dynamixel，則在重新打開之前無法讀取當前位置。用戶可以關閉特定 Dynamixels 的扭力。當直接從 Dynamixels 獲取位置值以獲得新的機器人姿態，而不是計算這些值時，這非常方便。要做到這一點，請關閉所需 Dynamixels 的扭力，然後將機器人擺出一個姿態並用手握住機器人關節，直到重新打開扭力。機器人將保持當前姿態，用戶可以讀取相應 Dynamixels 的位置值。&#x20;
* **Steps 步驟或 Stages 階段**：每個頁面最多可儲存 7 個步驟，從 STP0 到 STP6。但是，某些動作可能需要超過 7 個階段才能完全執行。這可以通過簡單地使用多個頁面並使用 **Next:** 連接來解決。
* **Next:**：表示是否繼續在其他頁面上執行動作。要繼續動作，只需列出要繼續動作的頁碼。數字 0 表示動作不會繼續到另一個頁面（預設值）。要連接的頁面不一定要依照數字順序。
* **Play Count 播放計數**：播放計數是此頁面動作的播放次數。&#x20;
* **Exit 退出**：可能存在必須停止操作的某些情況。在這些情況下，機器人可能處於不穩定的位置。Exit 很像 “Next”，因此 “Exit” 應連接到 ROBOTIS-OP3 可以恢復穩定姿態的頁面。如果 “Exit” 為 0，則表示沒有連接的退出頁面（預設值）。&#x20;
  * **提示**：當調用動作需要多個頁面時，ROBOTIS 強烈建議用戶從起頭的頁面調用動作。例如，clap 拍手動作從第 7 頁開始到第 8 頁結束。這意味著在調用 clap 時應該調用第 7 頁。調用第 8 頁可能會導致機器人意外行為。&#x20;
* **STP7**：“STP7” 列是 Dynamixel 智能馬達的當前位置，從其 4,095 解析度轉換而來。 “— -” 表示已釋放扭力。&#x20;
* **PauseTime 暫停時間**：“PauseTime” 是步驟 STP \[x] 的動作重放的暫停持續時間。
* **Time（x 8 msec）**：“Time” 是 ROBOTIS-OP3 完成步驟 STP \[x] 的時段。每個時間單位佔 8ms 的時間。

強烈建議當用戶測試自己新創建或已編輯的動作時，為了 ROBOTIS-OP3 的穩定性考量，位置，速度/時間和 pause 暫停值等，都應該是小的增量變化，不要一次有大幅度的改變。

**預設 Action File 的內容**

下表顯示了預設 action file 的內容。

| page number | page title  | brief description of page                             | number of pages |
| ----------- | ----------- | ----------------------------------------------------- | --------------- |
| 1           | walki\_init | initial standing pose                                 | 1               |
| 2           | hello       | greeting                                              | 1               |
| 3           | thank\_you  | Thank you                                             | 1               |
| 4           | yes         | yes                                                   | 1               |
| 5           | no          | no                                                    | 1               |
| 6           | fighting    | fighting                                              | 1               |
| 7           | clap        | clap                                                  | 2               |
| 9           | S\_H\_RE    | ready for shaking hands                               | 1               |
| 10          | S\_H        | shaking hands                                         | 1               |
| 11          | S\_H\_END   | move to initialpose fram ready pose for shaking hands | 1               |
| 12          | scanning    | looking around                                        | 1               |
| 13          | ceremony    | ceremony                                              | 1               |

**Action Editor 動作編輯器的基本指令**

輸入 “help” 後，指令列表將如下所示。

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-LmgYYjhDiPnXmixNYtC%2F-Lmgvadd1seFJJaIzdnA%2Fthormang3_action_editor_tui_command_list.jpg?alt=media&amp;token=6628fba7-87a4-47b0-bf13-e8143cd73fb4" alt=""></div>

* **exit** ：退出程式。&#x20;
* **re**：刷新螢幕。&#x20;
* **b**：移至上一頁。&#x20;
* **n**：進入下一頁。&#x20;
* **page \[index]**：移動到 \[index] 頁面。例如，鍵入 page 5 可在螢幕上輸出第 5 頁的數據。&#x20;
* **list**：輸出頁面列表。&#x20;
* **new**：清除所有智能馬達位置數據，初始化當前頁面。&#x20;
* **copy \[index]**：將數據從 \[index] 頁面複製到當前頁面。例如，如果你在第 5 頁並想要復製第 9 頁，則鍵入 copy 9。&#x20;
* **set \[value]**：設置所選智能馬達的位置值。例如，如果您希望 ID19（頭部 pan 平移）的值為 512，則使用鍵盤的方向鍵將遊標置於 ID19 上並鍵入 set 512。&#x20;
* **save**：保存你所做的任何更改。保存的動作檔（motion\_4096.bin 可以在“op3\_action\_module/data” 中找到）&#x20;
* **play**：播放當前頁面的動作。&#x20;
* **name**：更改當前頁面的名稱。您可以在螢幕右上角查看頁面名稱。例如，第 2 頁標題為 hello; 要更改頁面名稱，則輸入 name，然後按 “ENTER” 鍵。“name：” 將出現在螢幕的底部，之後輸入所需的頁面名稱，例如 good，再次按 “ENTER” 鍵。
* **i**：將數據從 STP7 插入 STP0。如果有的話，將數據從 STP \[x] 移動到STP \[x + 1]。
* **i \[index]**：將數據從 STP7 插入 STP \[index]。如果有的話，將數據從 STP \[index] 移動到 STP \[index + 1]。&#x20;
* **m \[index] \[index2]**：將數據從 \[index2] 移動到 \[index]。&#x20;
* **d \[index]**：從 STP \[index] 中刪除數據。將數據從 STP \[index] 移動到 STP \[index - 1]。&#x20;
* **on/off**：打開/關閉所有 Dynamixels 智能馬達的扭力。&#x20;
* **on/off \[index1] \[index2] \[index3]**：從 ID \[index1] ID \[index2] ID \[index3] 打開/關閉 Dynamixel 智能馬達的扭力。例如，off 20 從 ID20 釋放扭力。請注意，ID20 的 STP7 將讀取\[ —- ]。鍵入 20 將再次打開 ID20 的扭力，螢幕輸出 ID20 的當前位置數據。

**使用 op3\_action\_editor 編輯動作範例**

1\. 執行 op3\_action\_editor&#x20;

2\. 輸入 “list” 以便找到 “walking\_init page” 所在的頁面

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmh1uDSpLOEmO8nmD3O%2F-Lmh9yIntWgfSW3hwOGK%2Fthormang3_action_editor_tui_action_editing_example1.jpg?alt=media&amp;token=3604f19a-9530-4400-9db3-b38ed0bcb5f5" alt=""></div>

3\. 退出列表並輸入 “page \[x]” 轉到任何空白頁（例如，第 15 頁）。

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmh1uDSpLOEmO8nmD3O%2F-LmhAI8BemjcabETdO9P%2Fthormang3_action_editor_tui_action_editing_example2.jpg?alt=media&amp;token=af088fbb-106f-4bbd-9f4f-45a5a0d16f99" alt=""></div>

4\. 並將頁面 1 複製到頁面 \[x]。

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmh1uDSpLOEmO8nmD3O%2F-LmhAVs7s8RFVh12xE4R%2Fthormang3_action_editor_tui_action_editing_example3.jpg?alt=media&amp;token=3870a9a0-f49b-4717-9bfa-01ba8db50c99" alt=""></div>

5\. 輸入“play” 轉到 “walking\_init” 姿態&#x20;

6\. 輸入“off 2 4 8”，關閉 ID 2, 4 和 8 的扭力

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmh1uDSpLOEmO8nmD3O%2F-LmhArec73_XIUQjprU2%2Fthormang3_action_editor_tui_action_editing_example4.jpg?alt=media&amp;token=b075dffb-a7f1-4ead-b422-5c7472b325c5" alt=""></div>

7\. 調整好 ROBOTIS OP3 所需的姿態後，輸入 "on" 來打開扭力。然後輸入“i 1” 將姿態插入步驟 1

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmh1uDSpLOEmO8nmD3O%2F-LmhBc8MbZqheg3XbQJq%2Fthormang3_action_editor_tui_action_editing_example5.jpg?alt=media&amp;token=529fb191-9461-4bdd-91bf-a185455b5304" alt=""></div>

8\. 編輯 STP1 的“Pause Time”，“Time” 以及 “Page Step”，如下圖所示。

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmh1uDSpLOEmO8nmD3O%2F-LmhC1oMVhnWEErLU7wW%2Fthormang3_action_editor_tui_action_editing_example6.jpg?alt=media&amp;token=1bcc117b-2778-4e9c-9cfe-948a0cba8324" alt=""></div>

9\. 輸入“play” 並檢查 ROBOTIS-OP3 的動作
