> 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.1.-robotis-op3/4.1.1.-robotis-ros-motion-mo-zu/4.1.1.4.-op3_walking_module.md).

# 4.1.1.4. op3\_walking\_module

**Overview**

* 本節介紹控制 OP3 行走的模組。該模組被編譯為要在 \[op3\_manager] 中使用的程式庫。

**Getting Started**

* Download & Build
  * 參考： [**Installing ROBOTIS ROS Package**](http://emanual.robotis.com/docs/en/platform/op3/recovery/#installing-robotis-ros-packages)
* 用法。此 Motion 模組在 manager 中以程式庫的形式使用
  * 參考： [**Creating new robot manager**](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/tutorials/#creating-new-robot-manager)

**ROS API**

* Subscribed Topics
  * **/robotis/walking/command** ([std\_msgs/String](http://emanual.robotis.com/docs/en/popup/std_msgs_string/))
    * 此消息請求開始和停止行走。
  * **/robotis/walking/set\_params** ([op3\_walking\_module\_msgs/WalkingParam](http://emanual.robotis.com/docs/en/popup/op3_WalkingParam.msg/))
    * 此消息設置步行所需要的參數。有關詳細信息，請參閱[**WalkingParam.msg**](http://emanual.robotis.com/docs/en/popup/op3_online_WalkingParam.msg/)。
* Published Topics
  * **/robotis/status** ([robotis\_controller\_msgs/StatusMsg](http://emanual.robotis.com/docs/en/popup/op3_GetWalkingParam.srv/))
    * 此消息會通知 op3\_walking\_module 的狀態。
* Services
  * **/robotis/walking/get\_params** ([op3\_walking\_module\_msgs/GetWalkingParam](http://emanual.robotis.com/docs/en/popup/op3_GetWalkingParam.srv/))&#x20;
    * 此服務取得步行的參數。

**Parameters**

* **/walking\_param\_path**(字串, 預設值 : “op3\_walking\_module/config/param.yaml”)
  * 指示步行參數位置的文件路徑。

**Data**

* Walking parameters 行走參數
* 數據文件路徑：[/op3\_walking\_module/config/param.yaml](http://emanual.robotis.com/docs/en/popup/op3_walking_module_param.yaml/)
* YAML 格式
* x\_offset：x 方向的偏移（正面和背面）\[m]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-Lmcc_DMexs3a8DuEsoz%2Fop3_walking_module_image142.jpg?alt=media&amp;token=1ab2cb92-a68d-40c9-a398-5ff20df7d879" alt=""></div>

* y\_offset：y 方向的偏移（左和右）\[m]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-LmccuyUTm4sThL-ysB7%2Fop3_walking_module_image143.jpg?alt=media&amp;token=9662c025-65ec-425d-8b84-52f3e3bf0a71" alt=""></div>

* z\_offset：z 方向的偏移（向上和向下）\[m]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-Lmcd3UmAMrrdFVepcgq%2Fop3_walking_module_image144.jpg?alt=media&amp;token=5c137003-d8b0-4af0-98b8-6ce699078478" alt=""></div>

* roll\_offset：roll 橫滾偏移值（x 坐標）\[度]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-LmcdfDjWoOylPxEmlk8%2Fop3_walking_module_image145.jpg?alt=media&amp;token=7f0aca99-c40b-4a40-93e3-bc48103b3f94" alt=""></div>

* pitch\_offset：pitch 俯仰偏移值（y 坐標）\[度]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-LmceL83neI7nMm3tmRG%2Fop3_walking_module_image146.jpg?alt=media&amp;token=34970c19-00e5-4bee-9574-b3472f8b8d49" alt=""></div>

* yaw\_offset：偏航偏移值（z 坐標）\[度]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-Lmcf_1WszuAM4_NnOJe%2Fop3_walking_module_image2.gif?alt=media&amp;token=8819d623-5fb8-4421-b12c-a33982a3d7d4" alt=""></div>

* hip\_pitch\_offset：臀部水平的俯仰偏移值（y 坐標）。值是針對髖關節俯仰的 Dynamixel 智能馬達位置值。 \[度]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-Lmch7m7GOFDbMl1pxyh%2Fop3_walking_module_image147.jpg?alt=media&amp;token=204d3bf0-1441-41ca-95d7-e6b8465a2056" alt=""></div>

* period\_time：ROBOTIS-OP3 完成兩個完整步行（左腳和右腳）所需的時間\[ms]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-LmciQMgvznxokFkfw9V%2Fop3_walking_module_image148.jpg?alt=media&amp;token=1496f3eb-1de9-4739-b14e-e6d3e3b1962e" alt=""></div>

* dsp\_ratio：雙腳接地時到行走週期的時間比。

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-LmcjIwQzaNZJB84nxuG%2Fop3_walking_module_image149.jpg?alt=media&amp;token=43431746-5e83-402a-9521-084ab5b3b7a2" alt=""></div>

* foot\_height：步行時的腳抬高高度 \[m]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-LmcjbhScI14oXQ73RHC%2Fop3_walking_module_image152.jpg?alt=media&amp;token=fc5d45b9-ee28-404f-b0e2-5118d81c6cf7" alt=""></div>

* swing\_right\_left：在步行期間向左或向右擺動 \[m]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-LmcjrZ9lGJje5OCpYFv%2Fop3_walking_module_image153.jpg?alt=media&amp;token=a66e7d44-a061-4a40-b04f-14172252c36c" alt=""></div>

* swing\_top\_down：走路時上下擺動 \[m]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-Lmck0tujmq7pyvTrZCr%2Fop3_walking_module_image154.jpg?alt=media&amp;token=520c6cd5-8d12-4d1f-be84-b2a8dbc9abe4" alt=""></div>

* pelvis\_offset：骨盆水平的滾動偏移（x坐標）。值適用於髖部關節滾動的 Dynamixel 智能馬達位置值\[度]

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Lmc5R0YaMF1UaBvQ9kY%2F-LmckwGWiv9N7r7MzzKD%2Fop3_walking_module_image155.jpg?alt=media&amp;token=646a0512-983d-4001-9d1e-97e0eac8822a" alt=""></div>

* arm\_swing\_gain：相對於前進/後退的手臂擺動增益。 如果左腳向前移動，則右臂擺動。
* balance\_hip\_roll\_gain：陀螺儀 roll 滾動的增益
* balance\_knee\_gain：陀螺儀 pitch 俯仰的增益
* balance\_ankle\_roll\_gain：陀螺儀 roll 滾動的增益
* balance\_ankle\_pitch\_gain：陀螺儀 pitch 俯仰的增益
* p\_gain：尚未實現
* i\_gain：尚未實現
* d\_gain：尚未實現
