The movement of the machine can be controlled by the gamepad, and the grasping of objects can be realized with the gripper or the suction pump.
Note: The handle needs to be purchased separately, please consult the official customer service for details
The corresponding functions of the handle buttons are as follows:
myCobot:
- 1: RX coordinate value increases
- 2: RX coordinate value decreases
- 3: RY coordinate value increases
- 4: RY coordinate value decreases
- 5: X coordinate value increases
- 6: X coordinate value decreases
- 7: Y coordinate value decreases
- 8: Y coordinate value increases
- 9: Z coordinate value decreases
- 10: Z coordinate value increases
- 11: RZ coordinate value decreases
- 12: RZ Coordinate value increases
- 13: Wake up the handle. If the handle is not used for a long time after connection, it will enter sleep mode. You need to press this button to continue using it.
- X: Click the button to open the jaws
- Y: Click the button to close the jaws
- A: Click the button to turn on the suction pump
- B: Click the button to turn off the suction pump
- Left 1: Press and hold for 2s to initialize the robot to the joint zero position state.
- Left 2: Press and hold for 2s, the robot stops torque output and relaxes all joints.
- Right 1: Press and hold for 2s to initialize the robot to the initial point of movement.
- Right 2: Press and hold for 2s, the robot turns on torque output and all joints are locked.
myArm
- 1: RX direction coordinate value increases
- 2: RX direction coordinate value decreases
- 3: RY direction coordinate value decreases
- 4: RY direction coordinate value increases
- 5: X direction coordinate value increases
- 6: X direction coordinate value decreases
- 7: Y direction coordinate value decreases
- 8: Y direction coordinate value increases
- 9: Currently not functional
- 10: Currently not functional
- 11: Currently not functional
- 12: Currently not functional
- 13: Wake up the handle. After the handle is not used for a long time after connection, it will enter sleep mode. You need to press this button to wake up.
- 14: Check the connection status of the machine. The atom LED flashes green three times to indicate that the machine is normal; flashes red three times to indicate that the state is abnormal.
- X: Z direction coordinate value increases
- Y:Z direction coordinate value decreases
- A: open suction gripper
- B: Shut down the suction gripper
- Left 1: Press and hold for 2s to initialize the robot to the joint zero state.
- Left 2: Press and hold for 2s, the robot stops torque output and relaxes all joints.
- Right 1: Press and hold for 2s to initialize the robot to move to the initial point.
- Right 2: Press and hold for 2s, the robot turns on the torque output, and all joints are locked
instructions
1.Connecting devices
Connect the MyCobot and handle to the computer.
2.Install required libraries
Download code: https://github.com/elephantrobotics/pymycobot
Open the terminal, Enter the pymycobot/demo/handle_control
folder, and run the following command。
pip3 install -r requirements.txt
3.Modify port number
myCobot
Edit the myCobot280_handle_control.py file
import pygame
import time
from pymycobot import MyCobot280
import threading
# Change com7 to the actual port number detected by your computer
mc = MyCobot280("com7", 115200)
...
Run the program.
python3 myCobot280_handle_control.py
Note: After running the program, first click the Right 1 button. After the machine reaches the initial point, other operations can be performed.
myArm
Edit the myarm_handle_control.py file
import pygame
import time
from pymycobot import MyArm
import threading
# Change com7 to the port number detected by your computer
mc = MyArm("/dev/ttyAMA0",115200)
...
Finally. run the program
python3 myarm_handle_control.py
Note: After running the program, first click the 14 button to check the machine connection status, the machine connection status is normal (if it is abnormal, you will not be able to perform other operations, please solve the abnormal connection problem first), and then click Right 1 button, other operations can only be performed after the machine reaches the initial point.