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
2e123320
Commit
2e123320
authored
5 years ago
by
Abhishek Kadian
Browse files
Options
Downloads
Patches
Plain Diff
Simple NavigationEnv
parent
12a37607
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
habitat/config/default.py
+1
-0
1 addition, 0 deletions
habitat/config/default.py
navigation.py
+57
-0
57 additions, 0 deletions
navigation.py
with
58 additions
and
0 deletions
habitat/config/default.py
+
1
−
0
View file @
2e123320
...
@@ -170,6 +170,7 @@ _C.PYROBOT.ROBOTS = ["locobot"] # types of robots supported
...
@@ -170,6 +170,7 @@ _C.PYROBOT.ROBOTS = ["locobot"] # types of robots supported
_C
.
PYROBOT
.
ROBOT
=
"
locobot
"
_C
.
PYROBOT
.
ROBOT
=
"
locobot
"
_C
.
PYROBOT
.
SENSORS
=
[
"
RGB_SENSOR
"
,
"
DEPTH_SENSOR
"
]
_C
.
PYROBOT
.
SENSORS
=
[
"
RGB_SENSOR
"
,
"
DEPTH_SENSOR
"
]
_C
.
PYROBOT
.
BASE_CONTROLLER
=
"
proportional
"
_C
.
PYROBOT
.
BASE_CONTROLLER
=
"
proportional
"
_C
.
PYROBOT
.
BASE_PLANNER
=
"
none
"
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# SENSORS
# SENSORS
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
navigation.py
0 → 100644
+
57
−
0
View file @
2e123320
import
numpy
as
np
import
habitat
from
habitat.sims
import
make_sim
class
NavEnv
:
def
__init__
(
self
,
forward_step
,
angle_step
,
base_controller
):
config
=
habitat
.
get_config
()
config
.
defrost
()
config
.
PYROBOT
.
BASE_CONTROLLER
=
base_controller
config
.
freeze
()
self
.
_reality
=
make_sim
(
id_sim
=
"
PyRobot-v0
"
,
config
=
config
.
PYROBOT
)
self
.
_angle
=
(
angle_step
/
180
)
*
np
.
pi
self
.
_actions
=
{
"
forward
"
:
[
forward_step
,
0
,
0
],
"
left
"
:
[
0
,
0
,
self
.
_angle
],
"
right
"
:
[
0
,
0
,
-
self
.
_angle
],
"
stop
"
:
[
0
,
0
,
0
],
}
def
reset
(
self
):
return
self
.
_reality
.
reset
()
@property
def
reality
(
self
):
return
self
.
_reality
def
step
(
self
,
action
):
if
action
not
in
self
.
_actions
:
raise
ValueError
(
"
Invalid action type {}
"
.
format
(
action
))
if
action
==
"
stop
"
:
raise
NotImplementedError
(
"
stop action not implemented
"
)
observations
=
self
.
_reality
.
step
(
"
go_to_relative
"
,
{
"
xyt_position
"
:
self
.
_actions
[
action
],
"
use_map
"
:
False
,
"
close_loop
"
:
True
,
"
smooth
"
:
False
}
)
return
observations
def
main
():
env
=
NavEnv
()
if
__name__
==
"
__main__
"
:
main
()
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