aws / aws/amazon-sagemaker-examples

Deepracer Closest Waypoints

Open
#736 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

The sage maker documentation found [here](https://github.com/aws-samples/aws-deepracer-workshops/tree/master/Workshops/2019-AWSSummits-AWSDeepRacerService/Lab1) says that the reward function receives the closest waypoint and a list of waypoints. It also states: "_https://github.com/aws-samples/aws-deepracer-workshops/tree/master/Workshops/2019-AWSSummits-AWSDeepRacerService/Lab1_"

However: the function get_closest_waypoint(self): (**Line: 378 of deepracer_env.py**) calculates the euclidean distance between the current vehicle location and all the waypoints. Returning the waypoint with the shortest distance. This waypoint is not necessarily the next waypoint.

For example using the track type "HARD_TRACK_WORLD", at position [1.5:0] will return waypoint 0 as the closest, while at position [3.5:0] will return waypoint 17 as the closest. However the closest waypoint on the track should still be 0, and the next waypoint 1. The issue here is that the function does return the closest euclidean waypoint, however, this waypoint is then used in the progress calculation. (calculate_current_progress line 392) this means that as the vehicle moves down the initial straight the progress jumps and then drops again. Furthermore the use of the closest waypoint is then meaningless in the calculation of a heading between the previous waypoint and the "next one".

One possible fix is to provide more waypoints, or keep track of waypoints passed however, this will create a problem if the vehicle moves off the track.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.