# Implementation error of openai\_ros for turtlebot3

**URL:** <https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755>\
**Category:** ROSDS Support\
**Tags:** error\
**Created:** [April 19, 2022, 5:47am UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755 "2022-04-19T05:47:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlueCap](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/b/c5a1d2/32.png) [@BlueCap](https://get-help.theconstruct.ai/u/BlueCap)\
**Post date:** [April 19, 2022, 5:47am UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/1 "2022-04-19T05:47:30Z")

</div>

Dear All,

I am very new in this world.

As my first learning; I am trying to train a turtlebot3 in a maze. I am getting the error like:

[ERROR] [1650345832.962232, 0.000000]: Current /scan not ready yet, retrying for getting laser\_scan  
[ERROR] [1650345833.967828, 0.000000]: Current /scan not ready yet, retrying for getting laser\_scan  
[ERROR] [1650345834.979281, 0.000000]: Current /scan not ready yet, retrying for getting laser\_scan

I am using Neotic environment. and followed the tutorial: [[ROS Projects] - Use OpenAI\_ROS with Turtlebot2 Step by Step - Part 1 - YouTube](https://www.youtube.com/watch?v=mwGj1rjVtw4&t=1s)

I took the following codes:

[start\_training.launch](https://bitbucket.org/theconstructcore/openai_examples_projects/src/master/my_turtlebot3_openai_example/launch/start_training.launch)

[my\_turtlebot3\_openai\_qlearn\_params.yaml](https://bitbucket.org/theconstructcore/openai_examples_projects/src/master/my_turtlebot3_openai_example/config/my_turtlebot3_openai_qlearn_params.yaml)

[qlearn.py](https://bitbucket.org/theconstructcore/openai_examples_projects/src/master/my_turtlebot3_openai_example/scripts/qlearn.py)

[start\_qlearning.py](https://bitbucket.org/theconstructcore/openai_examples_projects/src/master/my_turtlebot3_openai_example/scripts/start_qlearning.py)

Also, I am running the gazebo simulation with options:

 ![image](https://get-help.robotigniteacademy.com/uploads/default/original/2X/7/742f728d51efa03173b98ac429529ea282c2d371.jpeg)

Can anyone please help me?

---

<div class="post-metadata">

**Author:** ![marco.nc.arruda](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/marco.nc.arruda/32/2639_2.png) [@marco.nc.arruda](https://get-help.theconstruct.ai/u/marco.nc.arruda)\
**Post date:** [April 19, 2022, 1:48pm UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/2 "2022-04-19T13:48:09Z")

</div>

Hi @BlueCap ,

Could you check in the training configuration which scan topic it is expeccting to have?  
I’d ask you to share the list of topics you have available in the environment as well

Regards

---

<div class="post-metadata">

**Author:** ![BlueCap](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/b/c5a1d2/32.png) [@BlueCap](https://get-help.theconstruct.ai/u/BlueCap)\
**Post date:** [April 19, 2022, 5:04pm UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/3 "2022-04-19T17:04:08Z")

</div>

Dear @marco.nc.arruda ,

As you suggested I was debugging in that line and found following issue, do you know how to resolve that? I did source/setup.bash but that is not working:

user:~/catkin\_ws$ rosmsg show sensor\_msgs/LeaserScan  
Unable to load msg [sensor\_msgs/LeaserScan]: Cannot locate message [LeaserScan] in package [sensor\_msgs] with paths [[’/opt/ros/noetic/share/sensor\_msgs/msg’]]

---

<div class="post-metadata">

**Author:** ![marco.nc.arruda](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/marco.nc.arruda/32/2639_2.png) [@marco.nc.arruda](https://get-help.theconstruct.ai/u/marco.nc.arruda)\
**Post date:** [April 19, 2022, 5:05pm UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/4 "2022-04-19T17:05:35Z")

</div>

Hi @BlueCap ,

It seems to be a typo (replace `LeaserScan` by `LaserScan`), try the command below:

`rosmsg show sensor_msgs/LaserScan`

---

<div class="post-metadata">

**Author:** ![BlueCap](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/b/c5a1d2/32.png) [@BlueCap](https://get-help.theconstruct.ai/u/BlueCap)\
**Post date:** [April 19, 2022, 5:10pm UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/5 "2022-04-19T17:10:50Z")

</div>

@marco.nc.arruda you were correct, that was typo… I am having the thing…

But, eventually that is bad news as again I got clueless about the error.

So as you asked I gave you the rostopic… do you need anything else for further analysis?

Thanks a ton in advance for helping

---

<div class="post-metadata">

**Author:** ![BlueCap](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/b/c5a1d2/32.png) [@BlueCap](https://get-help.theconstruct.ai/u/BlueCap)\
**Post date:** [April 19, 2022, 5:11pm UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/6 "2022-04-19T17:11:55Z")

</div>

Few more thing you might need to know:

user:~$ rostopic list  
/clock  
/cmd\_vel  
/gazebo/link\_states  
/gazebo/model\_states  
/gazebo/parameter\_descriptions  
/gazebo/parameter\_updates  
/gazebo/set\_link\_state  
/gazebo/set\_model\_state  
/imu  
/joint\_states  
/odom  
/rosout  
/rosout\_agg  
/scan  
/tf  
/tf\_static

user:~$ rostopic echo /scan  
WARNING: no messages received and simulated time is active.  
Is /clock being published?

user:~$ rosparam set use\_sim\_time false

user:~$ rostopic echo /scan ==\> It is not showing any data

user:~$ rostopic info /scan  
Type: sensor\_msgs/LaserScan

Publishers:

- /gazebo (http://3\_simulation:42921/)

Subscribers: None

---

<div class="post-metadata">

**Author:** ![BlueCap](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/b/c5a1d2/32.png) [@BlueCap](https://get-help.theconstruct.ai/u/BlueCap)\
**Post date:** [April 19, 2022, 5:17pm UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/7 "2022-04-19T17:17:30Z")

</div>

I was also checking turtlebot3\_env.py

from sensor\_msgs.msg import LaserScan

rospy.Subscriber("/scan", LaserScan, self.\_laser\_scan\_callback)

```
def _check_all_sensors_ready(self):
    rospy.logdebug("START ALL SENSORS READY")
    self._check_odom_ready()
    self._check_imu_ready()
    self._check_laser_scan_ready()
    rospy.logdebug("ALL SENSORS READY")

def _check_laser_scan_ready(self):
    self.laser_scan = None
    rospy.logdebug("Waiting for /scan to be READY...")
    while self.laser_scan is None and not rospy.is_shutdown():
        try:
            self.laser_scan = rospy.wait_for_message("/scan", LaserScan, timeout=1.0)
            rospy.logdebug("Current /scan READY=>")

        except:
            rospy.logerr("Current /scan not ready yet, retrying for getting laser_scan")
    return self.laser_scan

def _laser_scan_callback(self, data):
    self.laser_scan = data

def get_laser_scan(self):
    return self.laser_scan
```

---

<div class="post-metadata">

**Author:** ![BlueCap](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/b/c5a1d2/32.png) [@BlueCap](https://get-help.theconstruct.ai/u/BlueCap)\
**Post date:** [April 19, 2022, 5:28pm UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/8 "2022-04-19T17:28:58Z")

</div>

I think my main issue is:

**user:~$ rostopic echo /scan ==\> It is not showing any data**

---

<div class="post-metadata">

**Author:** ![marco.nc.arruda](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/marco.nc.arruda/32/2639_2.png) [@marco.nc.arruda](https://get-help.theconstruct.ai/u/marco.nc.arruda)\
**Post date:** [April 19, 2022, 5:53pm UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/9 "2022-04-19T17:53:25Z")

</div>

Hi @BlueCap ,

I’m not sure how you are running the AI scripts, I’m checking if there are more parameters to be  
configured.

But for debugging the simulation itself, it is important to notice it starts paused (check video below). Is that the case or you have the error when trying to run the learning algorithms?

[/uploads/default/original/2X/4/4953d64b4ec091863b4078f9f0b7145098f57e9d.mp4](https://get-help.robotigniteacademy.com/uploads/default/original/2X/4/4953d64b4ec091863b4078f9f0b7145098f57e9d.mp4)

---

<div class="post-metadata">

**Author:** ![BlueCap](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/b/c5a1d2/32.png) [@BlueCap](https://get-help.theconstruct.ai/u/BlueCap)\
**Post date:** [April 19, 2022, 6:41pm UTC](https://get-help.theconstruct.ai/t/implementation-error-of-openai-ros-for-turtlebot3/16755/10 "2022-04-19T18:41:15Z")

</div>

@marco.nc.arruda that’s exactly corect; now after running this I am not getting any further issue realted to Laser (but getting other issues, I will be opening different thread for that). So, we can treat this as closed.

THANK YOU
