Ask Your Question
0

openai_ros start_training.launch does not work (q-learning example)

asked 2020-08-23 08:02:34 -0600

autonomousfan gravatar image

hi! I have tried to run the turtlebot2 q learning example from OpenAI and until now I managed to run the launchfile where gazebo starts:

roslaunch gym_construct main.launch

After typing:

roslaunch turtle2_openai_ros_example start_training.launch

the launchfile starts but then it shows the following error:

henry@henry:~/catkin_ws$ roslaunch turtle2_openai_ros_example start_training.launch 
... logging to /home/henry/.ros/log/504dc8b6-e53e-11ea-b60d-b8763ff5fae7/roslaunch-henry-10939.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://henry:39203/

SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.7
 * /turtlebot2/alpha: 0.1
 * /turtlebot2/angular_speed: 0.3
 * /turtlebot2/desired_pose/x: 5.0
 * /turtlebot2/desired_pose/y: 0.0
 * /turtlebot2/desired_pose/z: 0.0
 * /turtlebot2/end_episode_points: 200
 * /turtlebot2/epsilon: 0.9
 * /turtlebot2/epsilon_discount: 0.999
 * /turtlebot2/forwards_reward: 5
 * /turtlebot2/gamma: 0.7
 * /turtlebot2/init_linear_forward_speed: 0.0
 * /turtlebot2/init_linear_turn_speed: 0.0
 * /turtlebot2/linear_forward_speed: 0.5
 * /turtlebot2/linear_turn_speed: 0.05
 * /turtlebot2/max_laser_value: 6
 * /turtlebot2/min_laser_value: 0
 * /turtlebot2/min_range: 0.5
 * /turtlebot2/n_actions: 4
 * /turtlebot2/n_observations: 6
 * /turtlebot2/nepisodes: 500
 * /turtlebot2/new_ranges: 5
 * /turtlebot2/nsteps: 10000
 * /turtlebot2/number_splits: 10
 * /turtlebot2/pos_step: 0.016
 * /turtlebot2/running_step: 0.06
 * /turtlebot2/speed_step: 1.0
 * /turtlebot2/turn_reward: 1
 * /turtlebot2/wait_time: 0.1

NODES
  /
    turtlebot2_maze (turtle2_openai_ros_example/start_qlearning.py)

ROS_MASTER_URI=http://localhost:11311 process[turtlebot2_maze-1]: started with pid [10959] [ERROR] [1598186669.537051, 27.380000]: NOT Initialising Simulation Physics Parameters [WARN] [1598186669.544562, 27.387000]: Start Init ControllersConnection [WARN] [1598186669.546238, 27.387000]: 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'))
Traceback (most recent call last):
  File "/home/henry/catkin_ws/src/openai_examples_projects/turtle2_openai_ros_example/scripts/start_qlearning.py", line 25, in <module>
    pkg_path = rospack.get_path('my_turtlebot2_maze')
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 207, in get_path
    raise ResourceNotFound(name, ros_paths=self._ros_paths)
rospkg.common.ResourceNotFound: my_turtlebot2_maze
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/henry/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
[turtlebot2_maze-1] process has died [pid 10959, exit code 1, cmd /home/henry/catkin_ws/src/openai_examples_projects/turtle2_openai_ros_example/scripts/start_qlearning.py __name:=turtlebot2_maze __log:=/home/henry/.ros/log/504dc8b6-e53e-11ea-b60d-b8763ff5fae7/turtlebot2_maze-1.log]. log file: /home/henry/.ros/log/504dc8b6-e53e-11ea-b60d-b8763ff5fae7/turtlebot2_maze-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done 

I did not change anything in the start_qlearning.py file but it seems that it wants my_turtlebot2_maze as a package but there is only a my_turtblebot2_maze.py file. Can somebody help me please Thank you

edit retag flag offensive close merge delete

Comments

Hi, did you solve this? I am having the same problem. Any help would be appreciated. Thanks. [Update: Fixed it, see the answer by me]

prav2909 gravatar image prav2909  ( 2020-11-28 14:39:29 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-11-29 07:16:34 -0600

Hi, I fixed it and got it running, you need to change line 30: "​pkg_path = rospack.get_path('turtle2_openai_ros_example')" of start_training.py to "pkg_path = rospack.get_path('my_turtlebot2_training')". Revert if this doesn't work.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-08-23 08:02:34 -0600

Seen: 149 times

Last updated: Nov 29 '20