Giter VIP home page Giter VIP logo

lukovicaleksa / autonomous-driving-turtlebot-with-reinforcement-learning Goto Github PK

View Code? Open in Web Editor NEW
96.0 2.0 30.0 4.77 MB

Implementation of Q-learning algorithm and Feedback control for the mobile robot (turtlebot3_burger) in ROS.

Python 99.10% CMake 0.90%
ros reinforcement-learning python feedbackcontroller linux gazebo turtlebot3 machine-learning autonomous-driving mobile-robotics

autonomous-driving-turtlebot-with-reinforcement-learning's Introduction

autonomous-driving-turtlebot-with-reinforcement-learning

Implementation of Q-learning algorithm and Feedback control for the mobile robot (turtlebot3_burger) in ROS.

  • Algorithm is implemented from scratch.
  • To run the code in gazebo simulator, export the model (burger) and roslaunch turtlebot3_world.launch file.
  • To run the code live on a physical TurtleBot, the ROS_MASTER_URI and ROS_HOSTNAME need to be set via the terminal by editing the ~/.bashrc script.
  • After setting up the environment, rosrun the desired nodes!
  • Link to video: https://www.youtube.com/watch?v=zw1BCfku1Dc&t=3s

radno okruzenje 3

Content

  • Thesis -> master thesis and learning phase flow chart
  • Log_feedback_1, 2, 3 -> folders containing data and parameters from Feedback Control algorithm testing
  • Log_learning ... -> folder containing data and parameters from the learning phase, as well as the Q-table
  • rqt_graphs -> folder containing rqt graphs in ROS
  • scripts -> python scripts
    • Control.py -> functions for robot control, Odometry message processing and setting robot's initial position
    • Lidar.py -> functions for Lidar message processing and discretization
    • Qlearning.py -> functions for Q-learning algorithm
    • Plots.py -> plotting the data from learning phase and Q-table
    • scan_node.py -> initializing the node for displaying the Lidar measurements and the current state of the agent
    • learning_node.py -> initializing the node for learning session
    • feedback_control_node.py -> initializing the node for applying Feedback Control algorithm
    • control_node.py -> initializing the node for applying the Q-learning algorithm combined with Feedback control
    • learning phase flow chart -> flow chart of the learning phase of the algorithm

autonomous-driving-turtlebot-with-reinforcement-learning's People

Contributors

lukovicaleksa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

autonomous-driving-turtlebot-with-reinforcement-learning's Issues

LaunchFile or what are the desired Nodes?

Hello,
I saw your great YouTube Video, and I wanted to try this by myself. After I read your ReadMe.md I was a bit confused, because there where no explanation how to launch this project. Can You just explain which of the nodes you used or share a launchflie to start the project in the right way.

I would be really happy to get an answer.

How to run this code?

I am interested in this video. And I just want to follow this . But I'm a beginner of ROS.
So I'cant begin this git project. When I run this project, gazebo simulation is fail (turtlebot is crashed)
I think this is because I just run each python file. (like use this command to run scan_node.py $ python scan_node.py)
Can you explain how can I run this whole file. (like rqt graph)
I think I must use roslaunch command but I don't know how can i use this command.

could you give me a code when you start this simulation in gazebo?

Real world error

Hey,
first of all, amazing work! secondly, in the simulation everything worked fine but in real world , it gives an error.
lidar_right = min(lidar[(ANGLE_MAX - HORIZON_WIDTH):(ANGLE_MAX)])
ValueError: min() arg is an empty sequence
I have set REAL_ROBOT = True

Real world?????????????????

Hello, I'm glad the simulation worked fine before. But now, when I try to run it as a turtlebot in a real environment, it keeps crashing. The wheels don't stop and keep spinning even when bumped. Do I need Gazebo or Rvis even when running in a real environment? Do I need to upload a map? It's an honor to do your project.

Improve model with distance rewards

Hi, your project is amazing. I want to improve a model by using your model and then set rewards only for distance to get to the goal. Do you think will it be possible?

AttributeError: 'NoneType' object has no attribute 'close'

Hello,
I get this error when running learning_node.py
the error message appear (occasionally) in between the episode output
can anyone help, please
(i'm using ubuntu 20.04.3, python 3.8.10, and ros noetic 1.15.13)


Episode 8 ==> CRASH {-0.20,-0.17,34.12} 30/12/2021 16:45:18
episode time: 4.94 s (avg step: 0.21 s)
episode steps: 23
episode reward: -103.50
episode max | avg | min reward: 0.10 | -4.70 | -100.00
T = 17.458432

Exception in thread /scan:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_pubsub.py", line 185, in robust_connect_subscriber
conn.receive_loop(receive_cb)
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 846, in receive_loop
self.close()
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py", line 858, in close
self.socket.close()
AttributeError: 'NoneType' object has no attribute 'close'

Episode 9 ==> CRASH {-0.11,-0.23,19.62} 30/12/2021 16:45:24
episode time: 5.97 s (avg step: 0.21 s)
episode steps: 28
episode reward: -106.90
episode max | avg | min reward: 0.00 | -3.96 | -100.00
T = 16.585511

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.