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
...
@@ -10,4 +10,4 @@ datachop_hiker.mat
BW_LFandInac_Zelev.mat
BW_LFandInac_Zelev.mat
e_x_y_data.pkl
e_x_y_data.pkl
.pytest_cache
.pytest_cache
z__test__
z__test__*.pyc
\ No newline at end of file
gp/robotgp.py
View file @
817009a2
...
@@ -103,6 +103,7 @@ class RobotGP(torch.nn.Module):
...
@@ -103,6 +103,7 @@ class RobotGP(torch.nn.Module):
y
=
torch
.
as_tensor
(
self
.
mc_handle
.
terrain
.
y
,
dtype
=
torch
.
float64
)
.
view
(
-
1
,
1
)
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
)
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
.
Xstar
=
torch
.
cat
([
x
,
y
,
z
],
1
)
.
cuda
()
# [nTest, 3]
self
.
min_Xstar
=
self
.
Xstar
self
.
num_test
=
self
.
Xstar
.
shape
[
0
]
self
.
num_test
=
self
.
Xstar
.
shape
[
0
]
# print('Initializing Xstar took {} secs.'.format(time.time() - stime))
# print('Initializing Xstar took {} secs.'.format(time.time() - stime))
...
...
mrmh_model/montecarlo.py
View file @
817009a2
...
@@ -228,10 +228,19 @@ class MonteCarlo(params.Default):
...
@@ -228,10 +228,19 @@ class MonteCarlo(params.Default):
self
.
p
[
dist_mat
<=
self
.
params
[
'ring_mobi'
][
3
]]
+=
0.20
# containment ring
self
.
p
[
dist_mat
<=
self
.
params
[
'ring_mobi'
][
3
]]
+=
0.20
# containment ring
# print(self.p)
# print(self.p)
self
.
p
=
ndimage
.
gaussian_filter
(
self
.
p
,
sigma
=
8
)
# to make betta heatmap
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
:
else
:
self
.
p
=
np
.
zeros
((
self
.
_x_shape
,
self
.
_y_shape
),
dtype
=
float
)
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
# generate lp from real model for comparison
fn
=
self
.
params
[
'lp_filename'
]
fn
=
self
.
params
[
'lp_filename'
]
self
.
comp_map
,
trash
=
load_heatmap
(
filename
=
fn
,
map_size
=
[
self
.
_x_shape
,
self
.
_y_shape
],
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):
...
@@ -336,6 +336,7 @@ class Searcher(params.Default):
@
staticmethod
@
staticmethod
def
go_forth
(
params
=
{}
):
def
go_forth
(
params
=
{}
):
print
(
"Searchers going forth"
)
if
(
params
):
if
(
params
):
Searcher
.
params
=
params
Searcher
.
params
=
params
...
@@ -354,6 +355,9 @@ class Searcher(params.Default):
...
@@ -354,6 +355,9 @@ class Searcher(params.Default):
dt
=
params
.
get
(
'dt'
,
1
)
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
.
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
Searcher
.
y_sweep_lambda
=
float
(
dt
)
*
(
_yrange
)
*
6.7e-2
...
@@ -365,6 +369,9 @@ class Searcher(params.Default):
...
@@ -365,6 +369,9 @@ class Searcher(params.Default):
- grouped search method
- grouped search method
'''
'''
sweep_num
=
params
[
'sweep_num'
]
# number of lengths of area to perform (for 'grouped' case)
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)
s_x
=
_xrange
/
(
sweep_num
*
2
*
num_searchers
)
# adjusted sweep length (2*s per searcher)
sw
=
2
*
num_searchers
*
s_x
sw
=
2
*
num_searchers
*
s_x
s_y
=
np
.
int
(
_yrange
/
20
)
# y axis bound need not be calculated
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):
...
@@ -125,6 +125,10 @@ def main(iteration = 0, parameters = -1):
mc
=
MC
.
MonteCarlo
(
params
=
params
)
# calls terrain builder
mc
=
MC
.
MonteCarlo
(
params
=
params
)
# calls terrain builder
mc
.
run_experiment
()
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...
planner
=
planning
.
Planning
(
params
,
on_terrain
=
mc
.
terrain
,
mode
=
'TOTALDIST'
)
# also calls terrain builder...
rgp
=
robotgp
.
RobotGP
(
mc
,
planner
,
_stime
=
stime
,
parameters
=
params
)
rgp
=
robotgp
.
RobotGP
(
mc
,
planner
,
_stime
=
stime
,
parameters
=
params
)
rgp
.
collect_trainData
()
# sets out paths for each robot
rgp
.
collect_trainData
()
# sets out paths for each robot
...
@@ -179,22 +183,24 @@ if __name__ == "__main__":
...
@@ -179,22 +183,24 @@ if __name__ == "__main__":
# KENTLAND case
# KENTLAND case
if
True
:
if
True
:
n_max
=
4
#Number of robots
n_max
=
3
#Number of robots
s_max
=
0
#Number of human searchers
s_max
=
1
#Number of searchers (humans)???
h_max
=
0
#Number of humans
#global_fail_max = 1000
#global_fail_max = 1000
global_fail_max
=
5
global_fail_max
=
5
global_fails
=
0
global_fails
=
0
avg_runs
=
5
avg_runs
=
1
start_time
=
time
.
time
()
start_time
=
time
.
time
()
params
=
({
params
=
({
'lp_model'
:
'
custom
'
,
'lp_model'
:
'
trust
'
,
'opt_iterations'
:
2
,
'opt_iterations'
:
2
,
'path_style'
:
'basic'
,
'path_style'
:
'basic'
,
'stats_name'
:
'kentland'
,
'stats_name'
:
'kentland'
,
'anchor_point'
:
[
37.197730
,
-
80.585233
],
# kentland
'anchor_point'
:
[
37.197730
,
-
80.585233
],
# kentland
'num_searchers'
:
s_max
,
'num_searchers'
:
s_max
,
'num_robots'
:
n_max
,
'num_robots'
:
n_max
,
'num_humans'
:
h_max
,
'lp_filename'
:
kentland_heatmap
,
'lp_filename'
:
kentland_heatmap
,
'lin_feat_filename'
:
kentland_linfeat
'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