Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Multi-agent interaction planning
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Larkin Heintzman
Multi-agent interaction planning
Commits
db895687
Commit
db895687
authored
Dec 10, 2019
by
Larkin Heintzman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
c227b249
Pipeline
#24
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
generateObstacles.m
Matlab Code/generateObstacles.m
+34
-0
No files found.
Matlab Code/generateObstacles.m
0 → 100644
View file @
db895687
function
[
x_pts
,
y_pts
]
=
generateObstacles
(
env
,
threshold
,
dx
,
init_conf
,
final_conf
,
safe_radius
)
xdim
=
env
(
2
)
-
env
(
1
);
ydim
=
env
(
4
)
-
env
(
3
);
im
=
zeros
(
xdim
/
dx
,
ydim
/
dx
);
im
=
perlin_noise
(
im
);
obs_points
=
im
;
obs_points
=
obs_points
+
abs
(
min
(
min
(
obs_points
)));
% make it positive
obs_points
=
obs_points
/
max
(
max
(
obs_points
));
% make it normal
obs_points
=
smoothdata
(
obs_points
,
1
,
'movmean'
,
10
);
obs_points
=
smoothdata
(
obs_points
,
2
,
'movmean'
,
10
);
[
x_pts
,
y_pts
]
=
find
(
obs_points
<=
threshold
);
x_pts
=
x_pts
.*
dx
;
y_pts
=
y_pts
.*
dx
;
% iterate through to get rid of points interferring with starting and
% ending points
% but do it for all points in initial and final configurations
for
i
=
1
:
size
(
init_conf
,
1
)
init_d
=
sqrt
((
init_conf
(
i
,
1
)
-
x_pts
)
.^
2
+
(
init_conf
(
i
,
2
)
-
y_pts
)
.^
2
);
x_pts
=
x_pts
(
init_d
>=
safe_radius
);
y_pts
=
y_pts
(
init_d
>=
safe_radius
);
end
for
i
=
1
:
size
(
final_conf
,
1
)
final_d
=
sqrt
((
final_conf
(
i
,
1
)
-
x_pts
)
.^
2
+
(
final_conf
(
i
,
2
)
-
y_pts
)
.^
2
);
x_pts
=
x_pts
(
final_d
>=
safe_radius
);
y_pts
=
y_pts
(
final_d
>=
safe_radius
);
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment