Skip to content

Commit

Permalink
Merge pull request #92 from elephantrobotics/ros-gripper-en
Browse files Browse the repository at this point in the history
Ros gripper en
  • Loading branch information
wangWking authored Nov 29, 2024
2 parents 9555a6c + bea9ef0 commit 0e433ed
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,13 @@ mc.send_angle(1, 40, 20)
- **Return value:**
- `1`: complete

#### 9.4 `init_eletric_gripper()`
#### 9.4 `init_electric_gripper()`

- **function**: Electric gripper initialization (it needs to be initialized once after inserting and removing the gripper)
- **Return value:**
- `1`: complete

#### 9.5 `set_eletric_gripper(status)`
#### 9.5 `set_electric_gripper(status)`

- **function**: Set Electric Gripper Mode
- **Parameters**:
Expand Down Expand Up @@ -994,7 +994,7 @@ from pymycobot import utils
<tr>
<td>Read gripper ID</td>
<td style="text-align: center;">14</td>
<td style="text-align: center;">3</td>
<td style="text-align: center;">4</td>
</tr>
<tr>
<td>Read gripper clockwise runnable error</td>
Expand Down
14 changes: 7 additions & 7 deletions 10-ApplicationBasePython/10.2_320_M5-ApplicationPython/2_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,23 @@ mc.send_angle(1, 40, 20)
</tr>
<tr>
<td style="text-align: center;">1</td>
<td>-170 ~ 170</td>
<td>-168 ~ 168</td>
</tr>
<tr>
<td style="text-align: center;">2</td>
<td>-137 ~ 137</td>
<td>-135 ~ 135</td>
</tr>
<tr>
<td style="text-align: center;">3</td>
<td>-151 ~ 142</td>
<td>-145 ~ 145</td>
</tr>
<tr>
<td style="text-align: center;">4</td>
<td>-148 ~ 184</td>
</tr>
<tr>
<td style="text-align: center;">5</td>
<td>-169 ~ 169</td>
<td>-168 ~ 168</td>
</tr>
<tr>
<td style="text-align: center;">6</td>
Expand Down Expand Up @@ -676,13 +676,13 @@ mc.send_angle(1, 40, 20)
- **Return value:**
- `1`: complete

#### 9.4 `init_eletric_gripper()`
#### 9.4 `init_electric_gripper()`

- **function**: Electric gripper initialization (it needs to be initialized once after inserting and removing the gripper)
- **Return value:**
- `1`: complete

#### 9.5 `set_eletric_gripper(status)`
#### 9.5 `set_electric_gripper(status)`

- **function**: Set Electric Gripper Mode
- **Parameters**:
Expand Down Expand Up @@ -1001,7 +1001,7 @@ from pymycobot import utils
<tr>
<td>Read gripper ID</td>
<td style="text-align: center;">14</td>
<td style="text-align: center;">3</td>
<td style="text-align: center;">4</td>
</tr>
<tr>
<td>Read gripper clockwise runnable error</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,55 @@ poster="" data-setup='{"aspectRatio":"16:9"}'>
<source src="../../../resources/11-ApplicationBaseROS/video/320-m5-ros1-gripper-slider.mp4"></video>

Open a command line and run:

>> **Note: If the end effector uses myGripper F100 force-controlled gripper, the version of the pymycobot driver library must be greater than 3.6.4**
```bash
# The default serial port name of 2022 mycobot 320-M5 version is "/dev/ttyUSB0", and the baud rate is 115200. The serial port name of some models is "dev/ttyACM0". If the default serial port name is wrong, you can change the serial port name to "/dev/ttyACM0".
roslaunch new_mycobot_320 mycobot_320_slider.launch port:=/dev/ttyUSB0 baud:=115200

# If the end is equipped with an adaptive gripper, run (only supports M5 version, serial port modification is the same as above):
# If the end is equipped with a Pro adaptive gripper, run (serial port modification is the same as above):
roslaunch new_mycobot_320 mycobot_320_gripper_slider.launch port:=/dev/ttyUSB0 baud:=115200

# If the end is equipped with a myGripper F100 force-controlled gripper, run (serial port modification is the same as above):
roslaunch new_mycobot_320 mycobot_320_force_gripper_slider.launch port:=/dev/ttyACM0 baud:=115200
```

**rviz and a slider component will be opened**, and you will see the following interface:

<img src =../../../resources/11-ApplicationBaseROS/12.2.7-4.jpg
width ="500" align = "center">

If the end is equipped with an adaptive gripper, you will see the following screen:
If the Pro adaptive gripper is installed at the end, you will see the following interface:

<img src =../../../resources/11-ApplicationBaseROS/12.1.4-4.png
width ="500" align = "center">
width ="500" align = "center">

If the myGripper F100 force-controlled gripper is installed at the end, you will see the following interface:

<img src =../../../resources/11-ApplicationBaseROS/12.1.4-20.png
width ="500" align = "center">

Then you can **control the model in rviz to make it move by dragging the slider**. If you want the real mycobot to move with the model, you need to open another command line and run:

>> **Note: If the end effector uses myGripper F100 force-controlled gripper, the version of the pymycobot driver library must be greater than 3.6.4**
```bash
# The default serial port name of 2022 mycobot 320-M5 version is "/dev/ttyUSB0", and the baud rate is 115200. The serial port name of some models is "dev/ttyACM0". If the default serial port name is wrong, you can change the serial port name to "/dev/ttyACM0".
rosrun new_mycobot_320 mycobot_320_slider.py _port:=/dev/ttyUSB0 _baud:=115200

# If the end is equipped with an adaptive gripper, run (only supports M5 version, serial port modification is the same as above):
# If the end is equipped with a Pro adaptive gripper, run (serial port modification is the same as above):
rosrun new_mycobot_320 mycobot_320_gripper_slider.py _port:=/dev/ttyUSB0 _baud:=115200

# If the end is equipped with a myGripper F100 force-controlled gripper, run (serial port modification is the same as above):
rosrun new_mycobot_320 mycobot_320_force_gripper_slider.py _port:=/dev/ttyACM0 _baud:=115200
```

**Note: Since the robot arm will move to the current position of the model when the command is input, make sure that the model in rviz does not appear to be worn out before you use the command.**

**Do not drag the slider quickly after connecting the robot arm to prevent damage to the robot arm**.

### 2 Model Following
## 2 Model Following

In addition to the above controls, we can also let the model move by following the real robot arm.

Expand All @@ -67,7 +82,7 @@ roslaunch new_mycobot_320 mycobot_320_follow_display.launch

It will **open rviz to show the model following effect.**

### 3 GUI control
## 3 GUI control

On the basis of the previous contents, this package also **provides a simple GUI control interface.** This method is used for interaction between real robot arms. Connect to mycobot.

Expand All @@ -87,7 +102,7 @@ width ="500" align = "center">

**Note:** Before using the gripper switch button, make sure the adaptive gripper is connected to the end of the robot arm.

### 4 Keyboard control
## 4 Keyboard control

**Keyboard control is added** in `new_mycobot_320` package, and real-time Synchronization is performed in rviz. This function depends on pythonApi, so be sure to connect with the real robot arm.

Expand Down Expand Up @@ -203,10 +218,12 @@ Parameters supported by this script:
* _speed: the movement speed of the robot arm
* _change_percent: movement distance percentage
### 5 moveit use
## 5 moveit use
`mycobot_ros` has integrated the MoveIt section.
>> **Note: If the end effector uses myGripper F100 force-controlled gripper, the version of the pymycobot driver library must be greater than 3.6.4**
<video id="my-video" class="video-js" controls preload="auto" width="100%"
poster="" data-setup='{"aspectRatio":"16:9"}'>
<source src="../../../resources/11-ApplicationBaseROS/video/320-m5-ros1-moveit.mp4"></video>
Expand All @@ -216,31 +233,42 @@ Open the command line and run:
```bash
roslaunch new_mycobot_320_moveit mycobot320_moveit.launch
# If the end is equipped with an adaptive gripper, run (only M5 version is supported):
# If the end is equipped with a Pro adaptive gripper, run:
roslaunch new_mycobot_320_gripper_moveit mycobot320_gripper_moveit.launch
# If the end is equipped with a myGripper F100 force-controlled gripper, run:
roslaunch new_mycobot_320_force_gripper_moveit mycobot320_force_gripper_moveit.launch
```
The operation effect is as follows:
<img src =../../../resources/11-ApplicationBaseROS/12.2.7-9.jpg
width ="500" align = "center">
If the end is equipped with an adaptive gripper, the operation effect is as follows:
If the end is equipped with a Pro adaptive gripper, the operation effect is as follows:
<img src =../../../resources/11-ApplicationBaseROS/12.1.4-5.png
width ="500" align = "center">>
width ="500" align = "center">
If the end is equipped with a myGripper F100 force-controlled gripper, the operation effect is as follows:
<img src =../../../resources/11-ApplicationBaseROS/12.1.4-21.png
width ="500" align = "center">
If you want a real robot arm to execute a plan synchronously, you need to open another command line and run:
```bash
# The default serial port name of 2022 mycobot 320-M5 version is "/dev/ttyUSB0", and the baud rate is 115200. The serial port name of some models is "dev/ttyACM0". If the default serial port name is wrong, you can change the serial port name to "/dev/ttyACM0".
rosrun new_mycobot_320_moveit sync_plan.py _port:=/dev/ttyUSB0 _baud:=115200
# If the end is equipped with an adaptive gripper, run (only supports M5 version, serial port modification is the same as above):
# If the end is equipped with a Pro adaptive gripper, run (serial port modification is the same as above):
rosrun new_mycobot_320_gripper_moveit sync_plan.py _port:=/dev/ttyUSB0 _baud:=115200
# If the end is equipped with a myGripper F100 force-controlled gripper, run (serial port modification is the same as above):
rosrun new_mycobot_320_force_gripper_moveit sync_plan.py _port:=/dev/ttyACM0 _baud:=115200
```
**Note:** If the end is equipped with an adaptive gripper, and you need to plan the gripper, you need to switch the planning group to the planning group of the gripper.
**Note:** If the end point is equipped with Pro adaptive grippers or myGripper F100 force-controlled grippers and the grippers need to be planned, you need to switch the planning group to the planning group of the grippers.
<img src =../../../resources/11-ApplicationBaseROS/12.1.4-6.jpg
width ="500" align = "center">>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,35 @@ width ="500" align = "center">
width ="500" align = "center">

Then run the command:

>> **Note: If the end effector uses myGripper F100 force-controlled gripper, the version of the pymycobot driver library must be greater than 3.6.4**
```bash
# The default serial port name of 2022 mycobot 320-Pi version is "/dev/ttyAMA0", and the baud rate is 115200.
roslaunch new_mycobot_320_pi mycobot_320_slider.launch port:=/dev/ttyAMA0 baud:=115200

# If the end is equipped with a Pro adaptive gripper, run:
roslaunch new_mycobot_320_pi mycobot_320_gripper_slider.launch

# If the end is equipped with a myGripper F100 force-controlled gripper, run:
roslaunch new_mycobot_320_pi mycobot_320_force_gripper_slider.launch
```

**rviz and a slider component will be opened**, and you will see the following interface:

<img src =../../../resources/11-ApplicationBaseROS/12.2.7-4.jpg
width ="500" align = "center">

If the Pro adaptive gripper is installed at the end, you will see the following interface:

<img src =../../../resources/11-ApplicationBaseROS/12.1.4-4.png
width ="500" align = "center">

If the myGripper F100 force-controlled gripper is installed at the end, you will see the following interface:

<img src =../../../resources/11-ApplicationBaseROS/12.1.4-20.png
width ="500" align = "center">

Then you can **control the model in rviz to make it move by dragging the slider**. If you want the real mycobot to move with the model, you need to open another ROS1 environment terminal:

<img src =../../../resources/11-ApplicationBaseROS/12.1.4-1.jpg
Expand All @@ -34,16 +52,24 @@ width ="500" align = "center">

Then run the command:

>> **Note: If the end effector uses myGripper F100 force-controlled gripper, the version of the pymycobot driver library must be greater than 3.6.4**
```bash
# The default serial port name of 2022 mycobot 320-Pi version is "/dev/ttyAMA0", and the baud rate is 115200.
rosrun new_mycobot_320_pi mycobot_320_slider.py _port:=/dev/ttyAMA0 _baud:=115200

# If the end is equipped with a Pro adaptive gripper, run:
rosrun new_mycobot_320_pi mycobot_320_gripper_slider.py

# If the end is equipped with a myGripper F100 force-controlled gripper, run:
rosrun new_mycobot_320_pi mycobot_320_force_gripper_slider.py
```

**Note: Since the robot arm will move to the current position of the model when the command is input, make sure that the model in rviz does not appear to be worn out before you use the command.**

**Do not drag the slider quickly after connecting the robot arm to prevent damage to the robot arm**.

### 2 Model Following
## 2 Model Following

In addition to the above controls, we can also let the model move by following the real robot arm. Open a ROS1 environment terminal:

Expand Down Expand Up @@ -78,7 +104,7 @@ roslaunch new_mycobot_320 mycobot_320_follow_display.launch

It will **open rviz to show the model following effect.**

### 3 GUI control
## 3 GUI control

On the basis of the previous contents, this package also **provides a simple GUI control interface.** This method is used for interaction between real robot arms. Connect to mycobot.

Expand All @@ -103,7 +129,7 @@ width ="500" align = "center">

**Note:** Before using the gripper switch button, make sure the adaptive gripper is connected to the end of the robot arm.

### 4 Keyboard control
## 4 Keyboard control

**Keyboard control is added** in `new_mycobot_320_pi` package, and real-time Synchronization is performed in rviz. This function depends on pythonApi, so be sure to connect with the real robot arm.

Expand Down Expand Up @@ -233,28 +259,51 @@ Parameters supported by this script:
* _speed: the movement speed of the robot arm
* _change_percent: movement distance percentage
### 5 moveit use
## 5 moveit use
`mycobot_ros` has integrated the MoveIt section.
>> **Note: If the end effector uses myGripper F100 force-controlled gripper, the version of the pymycobot driver library must be greater than 3.6.4**
Open the command line and run:
```bash
roslaunch new_mycobot_320_pi_moveit mycobot320_moveit.launch
# If the Pro adaptive gripper is installed at the end, run:
roslaunch new_mycobot_320_pi_gripper_moveit mycobot320_gripper_moveit.launch
# If the myGripper F100 force-controlled gripper is installed at the end, run:
roslaunch new_mycobot_320_pi_force_gripper_moveit mycobot320_force_gripper_moveit.launch
```
The operation effect is as follows:
<img src =../../../resources/11-ApplicationBaseROS/12.2.7-9.jpg
width ="500" align = "center">
If the end is equipped with a Pro adaptive gripper, the operation effect is as follows:
<img src =../../../resources/11-ApplicationBaseROS/12.1.4-5.png
width ="500" align = "center">>
If the end is equipped with a myGripper F100 force-controlled gripper, the operation effect is as follows:
<img src =../../../resources/11-ApplicationBaseROS/12.1.4-21.png
width ="500" align = "center">
If you want a real robot arm to execute a plan synchronously, you need to open another command line and run:
```bash
# The default serial port name of 2022 mycobot 320-Pi version is "/dev/ttyAMA0", and the baud rate is 115200.
rosrun new_mycobot_320_pi_moveit sync_plan.py _port:=/dev/ttyAMA0 _baud:=115200
```
**Note:** If the end effector is equipped with an adaptive gripper or myGripper F100 force-controlled gripper and the gripper needs to be planned, the planning group needs to be switched to the planning group of the gripper.
<img src =../../../resources/11-ApplicationBaseROS/12.1.4-6.jpg
width ="500" align = "center">>
#### Modify motion speed
In order to prevent the joints from shaking during the movement of the real robotic arm, the movement speed of the joints needs to be reduced.
Expand Down
Binary file added resources/11-ApplicationBaseROS/12.1.4-20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/11-ApplicationBaseROS/12.1.4-21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0e433ed

Please sign in to comment.