You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tobi f3a5695858 Add CozmoVideo 3 years ago
CozmoVideo Add CozmoVideo 3 years ago
PythonProject/BachelorarbeitCozmo Change 3 years ago
UnityProject Change directory to subfolder UnityProject 3 years ago
.gitattributes Add CozmoVideo 3 years ago
.gitignore Readd mlagents 0.8.1 3 years ago Change 3 years ago
UnitySDK.log Action Mask and working cozmo 3 years ago

Reinforcement Learning with Cozmo and Unity

@Author: Tobias Hassel

This project uses Reinforcement Learning to teach a virtual Cozmo-Robot to follow a line drawn on the ground.The plugin ML-Agents for Unity is used to train the robot. A camera in combination with OpenCvSharp identifies the line. Based on the Center of Gravity the reward is calculated for the robot. After the training the result is a model file which can be used by the real robot. A python project controls the real Cozmo using the pre-trained model.

Testing the project:

The different models are already pre-trained and can be used out of the box. To test the real robot you need to:

  1. have access to a smartphone which is able to run the app for the Cozmo-Robot. A list of supported devices can be found here:

  2. install the app on your smartphone and connect it to the robot. The connection works as follows:

  3. set the Cozmo-App to use SDK mode and connect your smartphone to your PC using a cable.

  4. open a command prompt and go to the PythonProject\BachelorarbeitCozmo\venv\Scripts folder.

  5. execute the by typing “python” into the shell.

Alternatively you can open the project in PyCharm and run the

If the program complains you might need to install some modules. These requirements are listed in the requirements.txt file which can be found in the PythonProject\BachelorarbeitCozmo\venv folder. It should usually be enough to install the specific versions of “cozmo”, “Pillow”, “opencv-python” and “tensorflow”, because all other modules are installed together with theses by default.