# 9.1.3.3. 執行 pick & place 範例

請打開 terminal 終端視窗，輸入 roscore 指令。

```
$ roscore
```

運行 roscore 後，需再執行 OpenManipulator 的控制器。打開另一個終端視窗，輸入以下指令。

```
$ roslaunch open_manipulator_controller open_manipulator_controller.launch
```

{% hint style="danger" %}
警示：請在運行 OpenMANIPULATOR-X 之前先檢查每個關節位置。因為如果關節位置超出範圍，它可能會停止操作。下面的圖片向你展示了OpenMANIPULATOR-X 的理想方位。當未啟用 DYNAMIXEL 智能馬達的扭力時，請參照下圖所示，先調整每個關節的方位。
{% endhint %}

<div align="left"><img src="/files/-Lm3a6m_7FsJ-9rJLHYl" alt=""></div>

如果 OpenManipulator 控制器已成功啟動，終端視窗將顯示以下消息。

```
SUMMARY
========

PARAMETERS
 * /open_manipulator/control_period: 0.01
 * /open_manipulator/moveit_sample_duration: 0.05
 * /open_manipulator/planning_group_name: arm
 * /open_manipulator/using_moveit: False
 * /open_manipulator/using_platform: True
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /
    open_manipulator (open_manipulator_controller/open_manipulator_controller)

ROS_MASTER_URI=http://localhost:11311

process[open_manipulator-1]: started with pid [23452]
Joint Dynamixel ID : 11, Model Name : XM430-W350
Joint Dynamixel ID : 12, Model Name : XM430-W350
Joint Dynamixel ID : 13, Model Name : XM430-W350
Joint Dynamixel ID : 14, Model Name : XM430-W350
Gripper Dynamixel ID : 15, Model Name :XM430-W350
[ INFO] [1544509070.096942788]: Succeeded to init /open_manipulator
```

然後打開另一個終端視窗並輸入以下指令。此指令是用於執行識別 ar marker 的套件。輸入你使用的攝影機類型和 ar marker 的大小。在這個例子中，我們使用Raspberry Pi Camera V2 樹莓派攝影機和 3cm ar marker。

```
$ roslaunch open_manipulator_ar_markers ar_pose.launch camera_model:=raspicam user_marker_size:=3.0
```

{% hint style="info" %}
備註：要使用 Raspberry Pi Camera V2 攝影機，請在 Raspberry Pi 中運行 camera node 節點。
{% endhint %}

打開另一個終端視窗並輸入以下指令。

```
$ roslaunch open_manipulator_pick_and_place open_manipulator_pick_and_place.launch
```

你可以在終端視窗中看到以下消息。 您可以檢查機器手臂的狀態。

```
-----------------------------
Pick and Place demonstration!
-----------------------------
1 : Home pose
2 : Pick and Place demo. start
3 : Pick and Place demo. Stop
-----------------------------
-----------------------------
Present Joint Angle J1: 0.000 J2: 0.000 J3: 0.000 J4: 0.000
Present Tool Position: 0.000
Present Kinematics Position X: 0.000 Y: 0.000 Z: 0.000
-----------------------------
```

有三個指令選擇。請在終端視窗輸入指令號碼。

1. Home pose: 回到原位 home pose.&#x20;
2. Pick and Place demo. Start: 開始 Pick and Place 展示.&#x20;
3. Pick and Place demo. Stop: 停止 Pick and Place 展示.


---

# 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-2/9.-ros-bu-tong-ying-yong/untitled-1/9.1.3.-pick-and-place-fan-li/untitled.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.
