# 12.8. MoveIt! 套件

* 要啟動 MoveIt!，請開新的 terminal 視窗然後輸入以下指令。

```
$ export TURTLEBOT3_MODEL=${TB3_MODEL}
$ roslaunch open_manipulator_with_tb3_tools manipulation.launch use_platform:=true
```

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Ll0n37W252i0qrYy1E9%2F-Ll10ZfS36BS217FZWCG%2Fopen_manipulator_moveit_sim_1.jpg?alt=media&#x26;token=94caff1f-634d-416b-b7f4-8819f611e787" alt=""></div>

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Ll0n37W252i0qrYy1E9%2F-Ll10clND88nyaEAFlSA%2Fopen_manipulator_moveit_sim_2.jpg?alt=media&#x26;token=3d646029-4166-40cd-9458-677dbf96e2f6" alt=""></div>

* 以下是 rqt 插件顯示控制 OpenManipulator 範例

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Ll0n37W252i0qrYy1E9%2F-Ll118LL-O1XT3nHdWQU%2Fjoint_position_service.png?alt=media&#x26;token=b7c8af3c-31fb-4c25-a73d-daab846c7dc6" alt=""></div>

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Ll0n37W252i0qrYy1E9%2F-Ll11D9HmUqR8OHeJyhO%2Fkinematic_position_service.png?alt=media&#x26;token=63226e2a-7542-4d13-8ab3-494b34db3867" alt=""></div>

* 由 rosservice 訊息可得知機器人狀態

```
$ rosservice call /arm/moveit/get_joint_position "planning_group: 'arm'" 
joint_position: 
  joint_name: [joint1, joint2, joint3, joint4]
  position: [-0.003067961661145091, -0.42644667625427246, 1.3084856271743774, -0.8452234268188477]
  max_accelerations_scaling_factor: 0.0
  max_velocity_scaling_factor: 0.0
```

```
$ rosservice call /arm/moveit/get_kinematics_pose "planning_group: 'arm'
end_effector_name: ''" 
header: 
  seq: 0
  stamp: 
    secs: 1550714737
    nsecs: 317547871
  frame_id: "/base_footprint"
kinematics_pose: 
  pose: 
    position: 
      x: 0.0918695085861
      y: -0.000263644738325
      z: 0.218597669468
    orientation: 
      x: 1.82347658316e-05
      y: 0.023774433021
      z: -0.000766773548775
      w: 0.999717054001
  max_accelerations_scaling_factor: 0.0
  max_velocity_scaling_factor: 0.0
  tolerance: 0.0
```

* 為了控制 OpenMANIPULATOR 的爪夾（range 範圍可從 -0.01 \~ 0.01），下面的service 指令可能會有所幫助。

```
$ rosservice call /om_with_tb3/gripper "planning_group: ''
joint_position:
  joint_name:
  - ''
  position:
  - 0.15
  max_accelerations_scaling_factor: 0.0
  max_velocity_scaling_factor: 0.0
path_time: 0.0"
```

<div align="left"><img src="https://3058168660-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LkXc5k_SFaP9gK2gsU8%2F-Ll0n37W252i0qrYy1E9%2F-Ll12SOwOXhw8137uAqR%2Fopen_manipulator_gripper.png?alt=media&#x26;token=46d7aec4-99f9-4402-949c-fdb29a126a10" alt=""></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://idminer.gitbook.io/robotis/part-1-turtlebot3/12.-manipulation-ji-qi-shou-bi/12.8.-moveit-tao-jian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
