Skip to content

Saiukk/TurtleBot3_v4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python PyTorch Matplotlib NumPy Unity C# Ubuntu

TurtleBot4 Project

In this repository, you can find the implementation of both simulated and real-world code to train and deploy an RL model to be used on the TurtleBot4 for maze escape, given its target destination.

image

Requirements & Installation

Ubuntu 20.04 version is required or VM (probably lagging) Execute following commands in Installation folder:

./install_unityHub.sh
./install_mono.sh
./install_ros2_foxy.sh

Create the model

Go in TurtleBot3_v4/MobileRoboticsDQN/DQN, in this repo you can find the executable file to training and save your model and test it after that.

Training

In "training.py" you can start your training phase.

algo = PPO_PT(env, discrete=True)
algo.loop(10000) #Change to add or remove episodes

Here you can change you algo, choose between DQN, Reinforce and PPO and the number of episodes of training.

Execute the file and start "TurtleBot3UnityDQN" project in Unity

Testing

Load your saved model in "testing.py" and execute the script. Now you can visualize how your model perform in the environment with results

Simulation (ROS)

For simulation with ros, move "ROS2Package/TurtleBot3_Sim" in colcon_ws repository in your home (this folder was created using installation scripts)

Usage

  • Open "Turtlebot3UnityRos2" project in Unity
  • Start Unity game
  • Open your terminal in "colcon_ws" directory and digit following commands:
colcon build
source install/setup.bash
ros2 run turtlebot3_Sim turtlebot3_Sim 

Real

Create connection with your turtlebot with ssh and repeat same commands mentioned in usage but change "ROS_DOMAIN_ID" from 0 to 30 in bashrc


Author

  • Enrico Angelico
  • Riccardo Portaro

About

Navigation environment for Turtlebot4 with Simulation and Real Testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors