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.
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.shGo 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.
In "training.py" you can start your training phase.
algo = PPO_PT(env, discrete=True)
algo.loop(10000) #Change to add or remove episodesHere 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
Load your saved model in "testing.py" and execute the script. Now you can visualize how your model perform in the environment with results
For simulation with ros, move "ROS2Package/TurtleBot3_Sim" in colcon_ws repository in your home (this folder was created using installation scripts)
- 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 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
- Enrico Angelico
- Riccardo Portaro