Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
planning_llh_bgc
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
planning_llh_bgc
Commits
817009a2
Commit
817009a2
authored
Mar 23, 2024
by
Bryson Howell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working on getting distinct trajectories
parent
997026ba
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
8 deletions
+31
-8
.gitignore
.gitignore
+1
-1
robotgp.py
gp/robotgp.py
+1
-0
montecarlo.py
mrmh_model/montecarlo.py
+10
-1
searcher.py
mrmh_model/searcher.py
+9
-2
test_trustplanner.py
test_trustplanner.py
+10
-4
No files found.
.gitignore
View file @
817009a2
...
...
@@ -10,4 +10,4 @@ datachop_hiker.mat
BW_LFandInac_Zelev.mat
e_x_y_data.pkl
.pytest_cache
z__test__
\ No newline at end of file
z__test__*.pyc
gp/robotgp.py
View file @
817009a2
...
...
@@ -103,6 +103,7 @@ class RobotGP(torch.nn.Module):
y
=
torch
.
as_tensor
(
self
.
mc_handle
.
terrain
.
y
,
dtype
=
torch
.
float64
)
.
view
(
-
1
,
1
)
z
=
1
+
torch
.
as_tensor
(
self
.
mc_handle
.
terrain
.
h
,
dtype
=
torch
.
float64
)
.
reshape
(
-
1
,
1
)
self
.
Xstar
=
torch
.
cat
([
x
,
y
,
z
],
1
)
.
cuda
()
# [nTest, 3]
self
.
min_Xstar
=
self
.
Xstar
self
.
num_test
=
self
.
Xstar
.
shape
[
0
]
# print('Initializing Xstar took {} secs.'.format(time.time() - stime))
...
...
mrmh_model/montecarlo.py
View file @
817009a2
...
...
@@ -228,10 +228,19 @@ class MonteCarlo(params.Default):
self
.
p
[
dist_mat
<=
self
.
params
[
'ring_mobi'
][
3
]]
+=
0.20
# containment ring
# print(self.p)
self
.
p
=
ndimage
.
gaussian_filter
(
self
.
p
,
sigma
=
8
)
# to make betta heatmap
elif
self
.
params
[
'lp_model'
]
==
'trust'
:
#test for trust
self
.
p
=
np
.
zeros
((
self
.
_x_shape
,
self
.
_y_shape
),
dtype
=
float
)
for
r
in
range
(
0
,
self
.
_x_shape
):
for
c
in
range
(
0
,
self
.
_y_shape
):
self
.
p
[
r
,
c
]
=
np
.
float
(
r
+
c
)
/
np
.
float
(
self
.
_x_shape
+
self
.
_y_shape
)
else
:
self
.
p
=
np
.
zeros
((
self
.
_x_shape
,
self
.
_y_shape
),
dtype
=
float
)
#Show LP Heatmap
plt
.
imshow
(
self
.
p
)
plt
.
title
(
'Selected heatmap'
)
plt
.
show
()
# generate lp from real model for comparison
fn
=
self
.
params
[
'lp_filename'
]
self
.
comp_map
,
trash
=
load_heatmap
(
filename
=
fn
,
map_size
=
[
self
.
_x_shape
,
self
.
_y_shape
],
...
...
mrmh_model/searcher.py
View file @
817009a2
...
...
@@ -336,6 +336,7 @@ class Searcher(params.Default):
@
staticmethod
def
go_forth
(
params
=
{}
):
print
(
"Searchers going forth"
)
if
(
params
):
Searcher
.
params
=
params
...
...
@@ -354,6 +355,9 @@ class Searcher(params.Default):
dt
=
params
.
get
(
'dt'
,
1
)
if
(
num_searchers
==
0
):
Searcher
.
x_sweep_width
=
(
(
_xrange
)
/
(
2
)
)
*
1.2
else
:
Searcher
.
x_sweep_width
=
(
(
_xrange
)
/
(
2
*
num_searchers
)
)
*
1.2
# whats the deal with these constants?
Searcher
.
y_sweep_lambda
=
float
(
dt
)
*
(
_yrange
)
*
6.7e-2
...
...
@@ -365,6 +369,9 @@ class Searcher(params.Default):
- grouped search method
'''
sweep_num
=
params
[
'sweep_num'
]
# number of lengths of area to perform (for 'grouped' case)
if
(
num_searchers
==
0
):
s_x
=
_xrange
/
(
sweep_num
*
2
)
else
:
s_x
=
_xrange
/
(
sweep_num
*
2
*
num_searchers
)
# adjusted sweep length (2*s per searcher)
sw
=
2
*
num_searchers
*
s_x
s_y
=
np
.
int
(
_yrange
/
20
)
# y axis bound need not be calculated
...
...
test_trustplanner.py
View file @
817009a2
...
...
@@ -125,6 +125,10 @@ def main(iteration = 0, parameters = -1):
mc
=
MC
.
MonteCarlo
(
params
=
params
)
# calls terrain builder
mc
.
run_experiment
()
#Show terrain for fun (want to see heatmap too)
#mc.terrain.plot()
#plt.show()
planner
=
planning
.
Planning
(
params
,
on_terrain
=
mc
.
terrain
,
mode
=
'TOTALDIST'
)
# also calls terrain builder...
rgp
=
robotgp
.
RobotGP
(
mc
,
planner
,
_stime
=
stime
,
parameters
=
params
)
rgp
.
collect_trainData
()
# sets out paths for each robot
...
...
@@ -179,22 +183,24 @@ if __name__ == "__main__":
# KENTLAND case
if
True
:
n_max
=
4
#Number of robots
s_max
=
0
#Number of human searchers
n_max
=
3
#Number of robots
s_max
=
1
#Number of searchers (humans)???
h_max
=
0
#Number of humans
#global_fail_max = 1000
global_fail_max
=
5
global_fails
=
0
avg_runs
=
5
avg_runs
=
1
start_time
=
time
.
time
()
params
=
({
'lp_model'
:
'
custom
'
,
'lp_model'
:
'
trust
'
,
'opt_iterations'
:
2
,
'path_style'
:
'basic'
,
'stats_name'
:
'kentland'
,
'anchor_point'
:
[
37.197730
,
-
80.585233
],
# kentland
'num_searchers'
:
s_max
,
'num_robots'
:
n_max
,
'num_humans'
:
h_max
,
'lp_filename'
:
kentland_heatmap
,
'lin_feat_filename'
:
kentland_linfeat
})
...
...
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