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
cbc6ca8e
Commit
cbc6ca8e
authored
5 years ago
by
Abhishek Kadian
Browse files
Options
Downloads
Patches
Plain Diff
Handle the case when pyrobot is not installed
parent
425bf313
No related branches found
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
habitat/sims/pyrobot/__init__.py
+17
-2
17 additions, 2 deletions
habitat/sims/pyrobot/__init__.py
habitat/sims/registration.py
+3
-1
3 additions, 1 deletion
habitat/sims/registration.py
with
20 additions
and
3 deletions
habitat/sims/pyrobot/__init__.py
+
17
−
2
View file @
cbc6ca8e
# TODO(akadian): come up with better module structure
from
habitat.sims.pyrobot.pyrobot
import
PyRobot
def
_try_register_pyrobot
():
try
:
import
pyrobot
has_pyrobot
=
True
except
ImportError
as
e
:
has_pyrobot
=
False
pyrobot_import_error
=
e
if
has_pyrobot
:
from
habitat.sims.pyrobot.pyrobot
import
PyRobot
else
:
@registry.register_simulator
(
name
=
"
PyRobot-v0
"
)
class
PyRobotImportError
(
Simulator
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
raise
pyrobot_import_error
This diff is collapsed.
Click to expand it.
habitat/sims/registration.py
+
3
−
1
View file @
cbc6ca8e
...
...
@@ -8,7 +8,7 @@ from habitat.core.logging import logger
from
habitat.core.registry
import
registry
from
habitat.core.simulator
import
Simulator
from
habitat.sims.habitat_simulator
import
_try_register_habitat_sim
from
habitat.sims.pyrobot
.pyrobot
import
PyR
obot
from
habitat.sims.pyrobot
import
_try_register_pyr
obot
def
make_sim
(
id_sim
,
**
kwargs
):
...
...
@@ -21,3 +21,5 @@ def make_sim(id_sim, **kwargs):
_try_register_habitat_sim
()
_try_register_pyrobot
()
g
\ No newline at end of file
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