Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Motor_Controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Spring
WP6_Robot_Behavior
Motor_Controller
Commits
abcbfcce
Commit
abcbfcce
authored
1 year ago
by
AUTERNAUD Alex
Browse files
Options
Downloads
Patches
Plain Diff
optimal_path_2d stopping criteria
parent
853d5dc8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
social_mpc/utils.py
+8
-5
8 additions, 5 deletions
social_mpc/utils.py
with
8 additions
and
5 deletions
social_mpc/utils.py
+
8
−
5
View file @
abcbfcce
...
...
@@ -103,8 +103,7 @@ def constraint_angle(angle, min_value=-np.pi, max_value=np.pi):
return
new_angle
def
optimal_path_2d
(
travel_time
,
starting_point
,
dx
,
coords
,
goal
,
N
=
100
,
max_distance
=
None
):
def
optimal_path_2d
(
travel_time
,
starting_point
,
dx
,
coords
,
goal
=
None
,
max_d_orientation
=
None
,
N
=
100
):
"""
Find the optimal path from starting_point to the zero contour
of travel_time. dx is the grid spacing
...
...
@@ -163,9 +162,13 @@ def optimal_path_2d(travel_time, starting_point, dx, coords, goal,
for
i
in
range
(
N
):
# xp, vp = sym(x, v)
d
=
get_distance
(
x
)
if
((
max_distance
is
not
None
)
and
(
np
.
linalg
.
norm
(
goal
-
np
.
asarray
(
x
))
<
max_distance
)):
d
=
get_distance
(
x
)[
0
][
0
]
# if negative value d < 0, waypoint in an obstacle
if
d
<
0
:
return
False
# goal is implicit defined in the travel_time map but we need to test it explicitly because we can not really trust d
if
((
goal
is
not
None
and
max_d_orientation
is
not
None
)
and
(
np
.
linalg
.
norm
(
goal
-
np
.
asarray
(
x
))
<
max_d_orientation
)):
if
dl
:
break
xl
.
append
(
x
[
0
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment