[TB3] Machine Learning Tutorial

Do you want to try the machine learning?

We provide machine learning tutorial with TurtleBot3.

First, we wanted to try machine learning, but we provided an installation tutorial for people who were frustrated at the installation stage.

Second, This tutorial is reinforcement learning using DQN. We provide basic theory of DQN and algorithms that we use to help users understand reinforcement learning so that they can apply their own learning. What is important in learning and what to do to get the learning you want.

Finally, In this tutorial, TurtleBot3 learns to go to the goal in gazebo maps:
No obstacle, Static obstacle, Moving obstacle, Combination obstacle

Each map has different learning time and reward function.
Challenge to create more efficient learning models and create agents with different goals in different maps.
We are by your side.

For more information, please refer to the manuals below.
[Source code] : https://github.com/ROBOTIS-GIT/turtlebot3_machine_learning
[Document] : http://emanual.robotis.com/docs/en/platform/turtlebot3/machine_learning/#installation

3 Likes

Hi, Gilbert. This is really a great tutorial to start learning machine learning in ROS. I am very new in machine learning in ROS and my knowledge on machine learning is also not professional. But I have few questions:

  1. Every time I launch “roslaunch turtlebot3_dqn turtlebot3_dqn_stage_#.launch”, it will start a new learning, right? Is it possible to start the learning with learned Q-Value?

  2. Where is result of learning stored? Can we just run with the learned Q-Value without learning? How?

Hi @krizchong :slight_smile:
Sure, you can do it. This tutorial stores the model for each tenth episode as stage_#EP#.h5 in save_model folder. When you want to restart launch using save_model, Change self.load_model = false to true and self.load_episode = 0 to episode you wanted in turtlebot3_dqn_stage# file.

And then… now you can’t just run without learning. But, I’ll update switch function between learning mode and non-learning mode.

TB3 Machine Learning Tutorial Anaconda2 Installation Question

My Linux Xenal 16.04 PC has an existing Anaconda3/Python 3.7 environment. Following Turtlebot3 eManual 14.1.1 Anaconda I installed a second environment - Anaconda2/Python2.7. My terminal prompts are slightly different than in the eManual. It appears that I must activate the conda environment after installing the Anaconda2 before the Ananconda python version is displayed, shown below. With the activated Anaconda2, then I followed the eManual to install tensor flow and Keras. My prompt is preceded by “(base)”

So my question is this a correct installation procedure? Also listed here is the conda info that shows the installed Anaconda2 and Anaconda3 environments.

turtlebot@copernicus:~ python --version Python 2.7.12 turtlebot@copernicus:~ python3 --version
Python 3.5.2
turtlebot@copernicus:~ conda activate (base) turtlebot@copernicus:~ python -V
Python 2.7.16 :: Anaconda, Inc.
(base) turtlebot@copernicus:~ turtlebot@copernicus:~ conda info --envs
WARNING: The conda.compat module is deprecated and will be removed in a future release.

conda environments:

base * /home/turtlebot/anaconda2
tensorflow /home/turtlebot/anaconda2/envs/tensorflow
/home/turtlebot/anaconda3

(base) turtlebot@copernicus:~ conda deactivate turtlebot@copernicus:~