Closed thaije closed 2 years ago
This is fixed. It did require a small change in how the get_current_waypoint
, get_upcoming_waypoints
, and get_all_waypoints
navigator functions are used. From now in they require the self.state_tracker
to be passed as a parameter as well, like so:
def decide_on_action(self, state):
# new is the self.state_tracker that is required for this function.
upcoming_waypints = self.navigator.get_upcoming_waypoints(self.state_tracker)
move_action = self.navigator.get_move_action(self.state_tracker)
return move_action, {"action_duration": self.move_speed}
These functions are still available without passing the state_tracker but it throws a DeprecationWarning. Reason for the warning and not just throwing an error is because this bug will be fixed in a new minor release of MATRX and thus should not break anyone's code outright.
Describe the bug Calling
navigator.get_upcoming_waypoints()
returns the waypoints still to navigate to, however this list is not updated with regards to the current agent location. So they are atleast 1 tick old. This is the same fornavigator.get_upcoming_waypoints()
andnavigator.get_current_waypoint()
.The reason for this is that the agent location and waypoints are only updated here in the
__get_route
function which is only called by theget_move_action
function.So if you fetch the next move action everything is good, but calling any of the navigator functions returns old information.
To Reproduce Run a scenario with a navigating agent (such as the example
simple case
, and callnavigator.get_upcoming_waypoints()
before thenavigator.get_move_action()
in the agent.Expected behavior
get_upcoming_waypoint
and other functions should return up to date info.Additional context A temporary workaround is to call the function yourself, e.g. something like this: