ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

openai_ros example turtlebot2 does only circular movements

asked 2020-08-25 14:58:55 -0500

autonomousfan gravatar image

updated 2022-05-01 12:57:58 -0500

lucasw gravatar image

Hi! I followed the OpenAI tutorial with the turtlebot2 example and used the start_qlearning.py file, but when I run the launchfiles the turtlebot only moves in a circle then it seems to restart (some kind of collision?) and this happens all the time..

This is the output from the terminal:

NODES
  /
    turtlebot2_maze (turtle2_openai_ros_example/start_qlearning.py)

ROS_MASTER_URI=http://localhost:11311 process[turtlebot2_maze-1]: started with pid [8204] [ERROR] [1598386894.407863, 24.150000]: NOT Initialising Simulation Physics Parameters [WARN] [1598386894.414771, 24.157000]: Start Init ControllersConnection [WARN] [1598386894.416358, 24.157000]: END Init ControllersConnection
/home/henry/.local/lib/python2.7/site-packages/gym/logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
  warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
[WARN] [1598386896.373830, 24.964000]: mod=120 [WARN] [1598386896.376594, 24.964000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.379235, 24.964000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.382009, 24.964000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.384714, 24.964000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.386477, 24.964000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.387933, 24.964000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.389596, 24.964000]: ############### Start Step=>0 [WARN] [1598386896.391132, 24.964000]: Next action is:2 [WARN] [1598386896.603553, 25.170000]: mod=120 [WARN] [1598386896.605311, 25.170000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.606913, 25.170000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.609013, 25.170000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.610608, 25.170000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.611779, 25.170000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.612802, 25.170000]: NOT done Validation >>> item=-inf< 0.5 [ERROR] [1598386896.613971, 25.170000]: TurtleBot2 is Ok ==> [WARN] [1598386896.615367, 25.170000]: [30.0, 30.0, 30.0, 30.0, 30.0, 30.0] 1 [WARN] [1598386896.616569, 25.170000]: # state we were=>30.030.030.030.030.030.0 [WARN] [1598386896.617597, 25.170000]: # action that we took=>2 [WARN] [1598386896.619158, 25.170000]: # reward that action gave=>1 [WARN] [1598386896.620522, 25.170000]: # episode cumulated_reward=>1 [WARN] [1598386896.622563, 25.170000]: # State in which we will start next step=>30.030.030.030.030.030.0 [WARN] [1598386896.624011, 25.170000]: NOT DONE [WARN] [1598386896.625498, 25.170000]: ############### END Step=>0 [WARN] [1598386896.626990, 25.170000]: ############### Start Step=>1 [WARN] [1598386896.628236, 25.170000]: Next action is:2 [WARN] [1598386896.844001, 25.377000]: mod=120 [WARN] [1598386896.845982, 25.377000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.847937, 25.377000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.849289, 25.377000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.850256, 25.377000]: NOT done Validation >>> item=-inf< 0.5 [WARN] [1598386896.851219, 25.377000]: NOT done Validation >>> item ...
(more)
edit retag flag offensive close merge delete

Comments

Hey,

I think I solved this one.

I'll just link the thread I opened, but in short summary, there is probably no backwards or forwards potential actions set for your turtlebot.

ROS THREAD

wirobot gravatar image wirobot  ( 2022-04-24 19:45:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-04-24 18:58:32 -0500

wirobot gravatar image

updated 2022-04-24 19:53:02 -0500

I think I may be running into a similar issue but my terminal is giving me this error:

UnboundLocalError: local variable 'linear_speed' referenced before assignment

With action 3:

Which I think may have to do with

line 125 in my_turtlebot2_maze.py:

        linear_speed = -self.linear_turn_speed

And line 131 as well:

    self.move_base(linear_speed, angular_speed, epsilon=0.05, update_rate=10)

ISSUE SOLVED (I believe, @autonomousfan, please chime in if this does not solve your problem.

THREAD LINK

Disclaimer: I setup this package with a ROS Kinetic system using ROS Development Studio from the Construct. I did this because it was very difficult to install ROS Noetic using Ubuntu 16.04 on my old windows computer, but that may be possible. I do believe it is easier to make these packages to work using ROS Kinetic, as that is what they were developed on and they have not seen much support in years.

THREAD

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-08-25 14:58:55 -0500

Seen: 133 times

Last updated: Apr 24 '22