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

Typing and modernisation of Agent code #8072

Merged
merged 65 commits into from
Oct 18, 2024

Conversation

Daraan
Copy link
Contributor

@Daraan Daraan commented Aug 23, 2024

Description

This PR adds:

  • TypeComments for the GlobalRoutePlanner, and barried code by TYPE_CHECKING granting good type coverage for pyright: basic
  • Updated some <0.9.13 code to use Vector3D methods that came in 0.9.13, e.g. location.
    this deprecates agents.tools.misc compute_distance and vector.
    Compatibility is granted with some slight improvements in performance by using a global constant for the eps value.
  • Removed some deprecated/unused fragments, e.g. inheritance from object, unnecessary class parentheses.
  • Some spelling mistakes also addressed in Documentation fixes & additions #7982

Where has this been tested?

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

Possible Drawbacks

  • This uses location.distance(location2) in favor of calculating the distance over numpy, the results are np.close but not identical. I do not see an issue here.
  • This changes class BasicAgent(object): -> class BasicAgent: which results in slightly different type behavior in Python 2 only.

This change is Reviewable

@Daraan Daraan requested a review from a team as a code owner August 23, 2024 15:19
@@ -15,7 +15,7 @@
from agents.navigation.local_planner import RoadOption
from agents.navigation.behavior_types import Cautious, Aggressive, Normal

from agents.tools.misc import get_speed, positive, is_within_distance, compute_distance
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functions were unused

@Daraan Daraan force-pushed the agent-modernisation branch from 481055b to a693fa8 Compare September 6, 2024 17:33
@Daraan Daraan force-pushed the agent-modernisation branch from a693fa8 to 9879cbd Compare September 6, 2024 17:36
@Daraan Daraan force-pushed the agent-modernisation branch from f6bb133 to bb2566d Compare September 9, 2024 12:03
@Blyron
Copy link
Contributor

Blyron commented Oct 18, 2024

@Daraan can you point to target ue4-dev?

@Daraan Daraan changed the base branch from dev to ue4-dev October 18, 2024 15:36
@Daraan
Copy link
Contributor Author

Daraan commented Oct 18, 2024

@Daraan can you point to target ue4-dev?

Yes and done.

@Blyron Blyron merged commit 9a59963 into carla-simulator:ue4-dev Oct 18, 2024
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.

9 participants