Skip to content

Commit a33cfe4

Browse files
authored
Fix full path planning (#340)
* fix complex path planning * format
1 parent 4a5c8d1 commit a33cfe4

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

problems/path_planning.jl

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ function dynamicofsystem()
4646
return F_sys, L_growthbound, ngrowthbound, DF_sys, bound_DF, bound_DDF
4747
end
4848

49-
function _initTargetSets()
50-
_I_ = UT.HyperRectangle(SVector(0.4, 0.4, 0.0), SVector(0.4, 0.4, 0.0))
51-
_T_ = UT.HyperRectangle(SVector(3.0, 0.3, -100.0), SVector(3.6, 0.8, 100.0))
52-
return _I_, _T_
53-
end
54-
55-
function filter_obstacles(_X_, obs)
56-
_I_, _T_ = _initTargetSets()
49+
function filter_obstacles(_X_, _I_, _T_, obs)
5750
obstacles = typeof(_X_)[]
5851
for ob in obs
5952
if ob _X_ && isempty(ob _I_) && isempty(ob _T_)
@@ -136,12 +129,13 @@ function problem(; simple = false, approx_mode = "growth")
136129
_I_ = UT.HyperRectangle(SVector(0.4, 0.4, 0.0), SVector(0.4, 0.4, 0.0))
137130
_T_ = UT.HyperRectangle(SVector(3.0, 0.3, -100.0), SVector(3.6, 0.8, 100.0))
138131
else
139-
_X_ = UT.HyperRectangle(SVector(0.0, 0.0, -pi - 0.4), SVector(10.0, 10.0, pi + 0.4))
132+
_X_ =
133+
UT.HyperRectangle(SVector(-0.1, -0.1, -pi - 0.4), SVector(10.1, 10.1, pi + 0.4))
140134
_I_ = UT.HyperRectangle(SVector(0.4, 0.4, 0.0), SVector(0.4, 0.4, 0.0))
141135
_T_ = UT.HyperRectangle(SVector(9.0, 0.3, -100.0), SVector(9.6, 0.8, 100.0))
142136
end
143137
obs = get_obstacles(_X_)
144-
obstacles_LU = filter_obstacles(_X_, obs)
138+
obstacles_LU = filter_obstacles(_X_, _I_, _T_, obs)
145139
_X_ = UT.LazySetMinus(_X_, obstacles_LU)
146140
sys = system(_X_; approx_mode = approx_mode)
147141
problem = PB.OptimalControlProblem(sys, _I_, _T_, nothing, nothing, PB.Infinity())

0 commit comments

Comments
 (0)