Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent's set_destination needs update in their logic and fix broken tailgating, but how? #7342

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Daraan
Copy link
Contributor

@Daraan Daraan commented Apr 9, 2024

Description

Addresses #7341:
set_destination does not really use the start_location, only for boolean evaluation instead of allowing users to pass a location.

In my experiments this sometimes creates troubles when passing a starting point, e.g. for tailgating the agent performs U-Turns to an old way point.

Where has this been tested?

Note: Python code only

  • Platform(s): Ubuntu 22.04
  • Python version(s): 3.7, 3.10
  • Unreal Engine version(s): 4.26

Possible Drawbacks


This change is Reviewable

Copy link

update-docs bot commented Apr 9, 2024

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update our CHANGELOG.md based on your changes.

@Daraan
Copy link
Contributor Author

Daraan commented Apr 9, 2024

@glopezdiest could you give it a look when you have the chance and share your thoughts. Thanks a lot.

@glopezdiest
Copy link
Contributor

Hello @Daraan. Yes, you are correct in that the start_location is no longer being used. After some though, I'm seeing three use-cases for the set_destination.

The first one is the more generic one. Both start_location and end_location are given, because a specific path is desired. In this case, the function should clean the previous queue, and just add the new route. In this case, the start_location can make the controller fail if it is a weird position, but that is acceptable and the fault relies on the inputs, not the function itself.

The second one is the rerouting one, where you just want to, for example, stop moving randomly, and start moving in a specific way.

The third one is the non-interference one, where you don't want to change the current behavior, and just add to it once it has finished.

The behavior agent uses the first approach, which uses the start_location, hence why it is failing. What do you think about it? These functions tend to be extended over time according to their needs, so I don't see any problem in changing it, as long as compatibility isn't broken.

@Daraan
Copy link
Contributor Author

Daraan commented Apr 21, 2024

Thank you for your reply.

As summary, we have these cases and end_location is always not None:

The first one is the more generic one. Both start_location and end_location are given, because a specific path is desired. In this case, the function should clean the previous queue, and just add the new route. In this case, the start_location can make the controller fail if it is a weird position, but that is acceptable and the fault relies on the inputs, not the function itself.

  • start_location is not None
  • clear_queue=True

The second one is the rerouting one, where you just want to, for example, stop moving randomly, and start moving in a specific way.

  • start_location is None
  • clear_queue=True

The third one is the non-interference one, where you don't want to change the current behavior, and just add to it once it has finished.

  • start_location is None
  • clear_queue=False

Theoretically this gives a fourth case similar to 3) with the problems of 1) and up to the input.

  • start_location is not None
  • clear_queue=False

I'll look again over it in the coming days/week

@glopezdiest
Copy link
Contributor

That breakdown looks good to me

Theoretically this gives a fourth case similar to 3) with the problems of 1) and up to the input.
start_location is not None
clear_queue=False
And yes, that's true, but I don't see an issue with that. It is a weird use-case from my point of view, but maybe someone can find a reasonable on later on

@glopezdiest
Copy link
Contributor

@Daraan Would you be interested in changing the set_destination function as discussed? I think this would be a good fix

@Daraan
Copy link
Contributor Author

Daraan commented May 31, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants