linZHank / turtlebot_rl

working on a turtlebot reinforcement learning in Gazebo and with help with a simplified openai_ros package
MIT License
7 stars 2 forks source link

Training freeze at reset #2

Closed linZHank closed 5 years ago

linZHank commented 5 years ago

Log info as follows

[DEBUG] [1538695756.662925, 3321.507000]: Reseting RobotGazeboEnvironment
[DEBUG] [1538695756.663244, 3321.507000]: START robot gazebo _reset_sim
[DEBUG] [1538695756.664229, 3321.507000]: connecting to ('linzhank-Alienware', 51839)
[DEBUG] [1538695756.665313, 3321.507000]: connecting to linzhank-Alienware 51839
[ERROR] [1538695756.665933, 3321.507000]: WORLD RESET
[DEBUG] [1538695756.666717, 3321.507000]: connecting to ('linzhank-Alienware', 51839)
[DEBUG] [1538695756.667558, 3321.507000]: connecting to linzhank-Alienware 51839
[DEBUG] [1538695756.668610, 3321.507000]: connecting to ('linzhank-Alienware', 51839)
[DEBUG] [1538695756.669391, 3321.507000]: connecting to linzhank-Alienware 51839
[DEBUG] [1538695756.669989, 3321.507000]: START ALL SENSORS READY
[DEBUG] [1538695756.670194, 3321.507000]: Waiting for /odom to be READY...
[DEBUG] [1538695756.680505, 3321.517000]: Current /odom READY=>
[DEBUG] [1538695756.680770, 3321.517000]: Waiting for /gazebo/model_states to be READY...
[DEBUG] [1538695756.681158, 3321.518000]: ALL SENSORS READY
[DEBUG] [1538695756.682198, 3321.519000]: connecting to ('linzhank-Alienware', 51839)
[DEBUG] [1538695756.683250, 3321.520000]: connecting to linzhank-Alienware 51839
[DEBUG] [1538695756.684113, 3321.521000]: END robot gazebo _reset_sim
[DEBUG] [1538695756.684654, 3321.521000]: Turtlebot was initiated as model_name: "mobile_base"
pose: 
  position: 
    x: 3.9235588966397286
    y: 0.4016402756422055
    z: 0
  orientation: 
    x: 0
    y: 0
    z: 1
    w: 2.35875505666
twist: 
  linear: 
    x: 0.0
    y: 0.0
    z: 0.0
  angular: 
    x: 0.0
    y: 0.0
    z: 0.0
reference_frame: "world"
[DEBUG] [1538751892.076280, 3321.521000]: connecting to linzhank-Alienware 51839
linZHank commented 5 years ago

figure out if this is related to rosservice?

linZHank commented 5 years ago

In crib_task_env, When setting goals at the beginning of every episode, make sure the codes resetting goal when it too close to robot are all included in the while loop.

    while np.linalg.norm(self.goal_position - self.init_position) <= 0.5:
      rospy.logerr("Goal was set too close to the robot, reset the goal...")
      goal_x = random.uniform(self.low[0]+.5, self.high[0]-.5)
      goal_y = random.uniform(self.low[1]+.5, self.high[1]-.5)
      self.goal_position = np.array([goal_x, goal_y])