Open 5ervant opened 5 years ago
That version of PurePursuit was written back when we had to train on SageMaker directly. If you are training on the console, the closest waypoint param changed. Might try something like this:
waypoint_ahead = params['closest_waypoints'][1]
rabbit_x = params['waypoints'][waypoint_ahead][0]
rabbit_y = params['waypoints'][waypoint_ahead][1]
rabbit = [rabbit_x, rabbit_y]
As for the math module being undefined, that means that import math
isn't contained anywhere in the context of the reward function. Seems as though it was in the old SageMaker version. You might try just a simple import math
at the top of your function. If that isn't allowed, you can always use the elemental math functions rather than the math functions. A little googling will reveal the proper formula in Python.
Upon rewriting "PurePursuit" for the current Reward function's Code editor, I'm getting these errors:
rabbit = [waypoints[closest_waypoints+1][0], waypoints[closest_waypoints+1][1]]
radius = math.hypot(x - rabbit[0], y - rabbit[1])
pointing[0] = x + (radius math.cos(heading)) pointing[1] = y + (radius math.sin(heading))
vector_delta = math.hypot(pointing[0] - rabbit[0], pointing[1] - rabbit[1])
Is this the latest conversion for the declaration of
rabbit
?rabbit = [waypoints[closest_waypoints[1]][0],waypoints[closest_waypoints[1]][1]]
orrabbit = [waypoints[closest_waypoints[0]][0],waypoints[closest_waypoints[0]][0]]
And also how can we use
math
if it's not defined on the current AWS DeepRacer model's code editor?