Skip to content

Conversation

JanLucaF
Copy link

Reference issue

What does this implement/fix?

This change implements the A* algorithm, with the additional parameters distance to obstacles and energy costs. This gives the algorithm the ability to choose a path that is far away from obstacles and/or minimizes changes in the direction of movement. Both parameters can be adjusted via a weighting factor between 0 and 1. The path length has also been given a weighting factor.

Additional information

No additional information needed

CheckList

  • Did you add an unittest for your new example or defect fix? No
  • Did you add documents for your new example? No
  • All CIs are green? (You can check it after submitting)

Copy link
Owner

@AtsushiSakai AtsushiSakai left a comment

Choose a reason for hiding this comment

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


# Calculate the dot product of the two vectors
dot_product = prev_dx * current_dx + prev_dy * current_dy
prev_length = math.sqrt(prev_dx ** 2 + prev_dy ** 2)

Check warning

Code scanning / CodeQL

Pythagorean calculation with sub-optimal numerics Warning

Pythagorean calculation with sub-optimal numerics.
# Calculate the dot product of the two vectors
dot_product = prev_dx * current_dx + prev_dy * current_dy
prev_length = math.sqrt(prev_dx ** 2 + prev_dy ** 2)
current_length = math.sqrt(current_dx ** 2 + current_dy ** 2)

Check warning

Code scanning / CodeQL

Pythagorean calculation with sub-optimal numerics Warning

Pythagorean calculation with sub-optimal numerics.
@AtsushiSakai
Copy link
Owner

AtsushiSakai commented Feb 28, 2025

No response, so let me close this PR once. If you can finish PR, please feel free to reopen it. @JanLucaF

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.

2 participants