Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Habitat Lab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
Meta Research
Habitat Lab
Commits
1e4563d5
Commit
1e4563d5
authored
5 years ago
by
Oleksandr Maksymets
Browse files
Options
Downloads
Patches
Plain Diff
Switched code to heading and GPS sensors using single array wrapping.
parent
c928734f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/shortest_path_follower_example.py
+1
-1
1 addition, 1 deletion
examples/shortest_path_follower_example.py
test/test_sensors.py
+3
-2
3 additions, 2 deletions
test/test_sensors.py
with
4 additions
and
3 deletions
examples/shortest_path_follower_example.py
+
1
−
1
View file @
1e4563d5
...
@@ -95,7 +95,7 @@ def shortest_path_example(mode):
...
@@ -95,7 +95,7 @@ def shortest_path_example(mode):
observations
,
reward
,
done
,
info
=
env
.
step
(
best_action
)
observations
,
reward
,
done
,
info
=
env
.
step
(
best_action
)
im
=
observations
[
"
rgb
"
]
im
=
observations
[
"
rgb
"
]
top_down_map
=
draw_top_down_map
(
top_down_map
=
draw_top_down_map
(
info
,
observations
[
"
heading
"
],
im
.
shape
[
0
]
info
,
observations
[
"
heading
"
]
[
0
]
,
im
.
shape
[
0
]
)
)
output_im
=
np
.
concatenate
((
im
,
top_down_map
),
axis
=
1
)
output_im
=
np
.
concatenate
((
im
,
top_down_map
),
axis
=
1
)
images
.
append
(
output_im
)
images
.
append
(
output_im
)
...
...
This diff is collapsed.
Click to expand it.
test/test_sensors.py
+
3
−
2
View file @
1e4563d5
...
@@ -78,7 +78,7 @@ def test_state_sensors():
...
@@ -78,7 +78,7 @@ def test_state_sensors():
obs
=
env
.
reset
()
obs
=
env
.
reset
()
heading
=
obs
[
"
heading
"
]
heading
=
obs
[
"
heading
"
]
assert
np
.
allclose
(
heading
,
random_heading
)
assert
np
.
allclose
(
heading
,
[
random_heading
]
)
assert
np
.
allclose
(
obs
[
"
compass
"
],
[
0.0
],
atol
=
1e-5
)
assert
np
.
allclose
(
obs
[
"
compass
"
],
[
0.0
],
atol
=
1e-5
)
assert
np
.
allclose
(
obs
[
"
gps
"
],
[
0.0
,
0.0
],
atol
=
1e-5
)
assert
np
.
allclose
(
obs
[
"
gps
"
],
[
0.0
,
0.0
],
atol
=
1e-5
)
...
@@ -241,7 +241,7 @@ def test_pointgoal_with_gps_compass_sensor():
...
@@ -241,7 +241,7 @@ def test_pointgoal_with_gps_compass_sensor():
obs
=
env
.
step
(
sample_non_stop_action
(
env
.
action_space
))
obs
=
env
.
step
(
sample_non_stop_action
(
env
.
action_space
))
pointgoal
=
obs
[
"
pointgoal
"
]
pointgoal
=
obs
[
"
pointgoal
"
]
pointgoal_with_gps_compass
=
obs
[
"
pointgoal_with_gps_compass
"
]
pointgoal_with_gps_compass
=
obs
[
"
pointgoal_with_gps_compass
"
]
compass
=
obs
[
"
compass
"
]
compass
=
float
(
obs
[
"
compass
"
]
[
0
])
gps
=
obs
[
"
gps
"
]
gps
=
obs
[
"
gps
"
]
# check to see if taking non-stop actions will affect static point_goal
# check to see if taking non-stop actions will affect static point_goal
assert
np
.
allclose
(
assert
np
.
allclose
(
...
@@ -252,6 +252,7 @@ def test_pointgoal_with_gps_compass_sensor():
...
@@ -252,6 +252,7 @@ def test_pointgoal_with_gps_compass_sensor():
).
inverse
(),
).
inverse
(),
pointgoal
-
gps
,
pointgoal
-
gps
,
),
),
atol
=
1e-5
,
)
)
env
.
close
()
env
.
close
()
...
...
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