# ROS 2 Reinforcement learning

**URL:** <https://discourse.openrobotics.org/t/ros-2-reinforcement-learning/40898>\
**Category:** Projects\
**Tags:** ros2, simulation, ai\
**Created:** [December 1, 2024, 12:46pm UTC](https://discourse.openrobotics.org/t/ros-2-reinforcement-learning/40898 "2024-12-01T12:46:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wiktor-99](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/wiktor-99/32/22106_2.png) [@Wiktor-99](https://discourse.openrobotics.org/u/Wiktor-99)\
**Post date:** [December 1, 2024, 12:46pm UTC](https://discourse.openrobotics.org/t/ros-2-reinforcement-learning/40898/1 "2024-12-01T12:46:04Z")

</div>

For some time, I have been working on a basic reinforcement learning playground designed to enable experimentatio with simple systems in the ROS 2 environment and Gazebo.

Currently, you can try it with a cart-pole example. The repository includes both reinforcement learning nodes and model-based control, with full calculations provided in a Jupyter notebook. The project also comes with a devcontainer, making it easy to set up.

You can find the code here: [GitHub - Wiktor-99/reinforcement\_learning\_playground: ROS 2 Reinforcement learning playground](https://github.com/Wiktor-99/reinforcement_learning_playground)

 ![cart_pole](https://us1.discourse-cdn.com/flex022/uploads/ros/original/3X/3/6/363bfd6af9e4d6542456986dbb8136f17a094cc7.png)

---

<div class="post-metadata">

**Author:** ![Wiktor-99](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/wiktor-99/32/22106_2.png) [@Wiktor-99](https://discourse.openrobotics.org/u/Wiktor-99)\
**Post date:** [December 7, 2024, 4:05pm UTC](https://discourse.openrobotics.org/t/ros-2-reinforcement-learning/40898/2 "2024-12-07T16:05:47Z")

</div>

Video with working example: [https://youtube.com/shorts/ndO6BQfyxYg](https://youtube.com/shorts/ndO6BQfyxYg)

---

<div class="post-metadata">

**Author:** ![azmyin12](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/azmyin12/32/22409_2.png) [@azmyin12](https://discourse.openrobotics.org/u/azmyin12)\
**Post date:** [December 8, 2024, 3:19pm UTC](https://discourse.openrobotics.org/t/ros-2-reinforcement-learning/40898/3 "2024-12-08T15:19:16Z")

</div>

Hi @Wiktor-99, I was wondering are you using Gazebo Classic for this project? If that is the case, is there any plans for updating the packages to use Gazebo Harmonic/Ionic ?

---

<div class="post-metadata">

**Author:** ![Wiktor-99](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/wiktor-99/32/22106_2.png) [@Wiktor-99](https://discourse.openrobotics.org/u/Wiktor-99)\
**Post date:** [December 8, 2024, 3:48pm UTC](https://discourse.openrobotics.org/t/ros-2-reinforcement-learning/40898/4 "2024-12-08T15:48:35Z")

</div>

Hi, I used latest gazebo and jazzy distro
