A project for the "Robot Motion Planning Workshop" at TAU.π
The project makes use of the mycobot robotic arm & the iRobot Createπ€.
- iCreate 3 (iRobot Create) - a mobile robot platform.β
- myCobot 280 robotic arm (by Elephant Robotics).πͺ
- Python 3.9 or later.π
- Installing the irobot_edu_sdk package:π»
pip install irobot_edu_sdk
- Bluetooth connection - to communicate with the iRobot Create.π‘
-
Ensure the bluetooth is enabled, and the iRobot create is charged and turned on.
-
Connect the Arduino to the myCobot.
-
Connect the 3 sensors to the Arduino:
- Trigger pins: 2, 4, 6.
- Echo pins: 3, 5, 7.
- We recommend using a breadboard to connect the sensors to the Arduino.
The following is a diagram of the Arduino setup:
- Run the following command in the terminal:
Replace
python3 irobot_locate.py <MYCOBOT_SERVER_IP> <MYCOBOT_PORT_NUMBER>
<MYCOBOT_SERVER_IP>
and<MYCOBOT_PORT_NUMBER>
with the IP address and port number of your myCobot device.β Note: The computer running the program must be connected to the same network as the myCobot device.
- Press the 2 dots button on the iRobot Create - this event will trigger the code to start running.
- The iRobot Create will start looking for objects.
- myCobot 280 robotic arm (by Elephant Robotics).πͺ
- Python 3.9 or later, installed on the myCobot's Raspberry Pi.π
- Installing the pymycobot, pyserial, Flask packages on the Raspberry Pi:π»
pip install pymycobot pyserial Flask
- Connect to the myCobot's Raspberry Pi via SSH.
- Transfer the
mycobot_server.py
file to the Raspberry Pi (e.g. via SCP). - In order to make the sensors accessible through the server, follow the Arduino instructions in the Roomball User Manual.
- Run the following command in the Raspberry Pi terminal:
Replace
python3 mycobot_server.py <MYCOBOT_SERVER_IP> <MYCOBOT_PORT_NUMBER>
<MYCOBOT_SERVER_IP>
and<MYCOBOT_PORT_NUMBER>
with the desired IP address and port number of the server. - The server will start running and log the incoming requests.
You might find it useful to automatically start the myCobot server when the Raspberry Pi boots up.
This enables you to control the myCobot remotely without the need to manually start the server via SSH each time.
To do so, follow these steps:
- Create a new service file:
sudo nano /etc/systemd/system/mycobot_server.service
- Add the following content to the file:
Replace
[Unit] Description=myCobot Server After=network.target [Service] Type=simple ExecStart=/usr/bin/python3 <MY_COBOT_SERVER_PATH>/mycobot_server.py <MYCOBOT_SERVER_IP> <MYCOBOT_PORT_NUMBER> WorkingDirectory=<MY_COBOT_SERVER_PATH> StandardOutput=append:<MY_COBOT_SERVER_PATH>/logs/log.txt StandardError=append:<MY_COBOT_SERVER_PATH>/logs/error_log.txt Restart=on-failure User=<USER_NAME> Environment="PYTHONUNBUFFERED=1" [Install] WantedBy=multi-user.target
<MY_COBOT_SERVER_PATH>
,<MYCOBOT_SERVER_IP>
, and<MYCOBOT_PORT_NUMBER>
with the desired path to the server file, IP address, and port number, respectively.
Replace<USER_NAME>
with the username of the Raspberry Pi user - it will beer
by default. - Save the file and exit the text editor.
- Reload the systemd manager configuration:
sudo systemctl daemon-reload
- Enable the service to start on boot:
sudo systemctl start mycobot_server.service sudo systemctl enable mycobot_server.service sudo systemctl status mycobot_server.service