Implementation error of openai_ros for turtlebot3

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

I took the following codes:



Also, I am running the gazebo simulation with options:

Can anyone please help me?

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


Dear ,

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’]]

Hi @BlueCap ,

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

rosmsg show sensor_msgs/LaserScan 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

Few more thing you might need to know:

user:~$ rostopic list

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


  • /gazebo (http://3_simulation:42921/)

Subscribers: None

I was also checking

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")
    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():
            self.laser_scan = rospy.wait_for_message("/scan", LaserScan, timeout=1.0)
            rospy.logdebug("Current /scan READY=>")

            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

I think my main issue is:

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

Hi @BlueCap ,

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

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? 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.


1 Like