Skip to content

Commit

Permalink
Fixed some imports and xml
Browse files Browse the repository at this point in the history
  • Loading branch information
yidingjiang committed Jul 18, 2019
1 parent d1ee5a6 commit a1b41b0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
10 changes: 5 additions & 5 deletions assets/clevr_default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@
<geom name='table' type='plane' pos='0 0.5 -0.325' size='1 1 0.1' contype='1' conaffinity='1'/>

<!--<body name='object' pos='0.55 -0.3 -0.275' >-->
<body name='object1' pos='-0.80 -0.1 -0.225' >
<body name='obj1' pos='-0.80 -0.1 -0.225' >
<!--<geom rgba='1 1 1 0' type='sphere' size='0.05 0.05 0.05' density='0.00001' conaffinity='0'/>-->
<geom rgba='1 1 1 1' type='cylinder' size='0.05 0.1 0.1' density='0.00001' contype='1' conaffinity='0'/>
<joint name='obj1_slidey' type='slide' pos='0 0 0' axis='0 1 0' range='-10.3213 10.3' damping='0.5'/>
<joint name='obj1_slidex' type='slide' pos='0 0 0' axis='1 0 0' range='-10.3213 10.3' damping='0.5'/>
</body>

<body name='object2' pos='0.60 -0.05 -0.275' >
<body name='obj2' pos='0.60 -0.05 -0.275' >
<!--<geom rgba='1 1 1 0' type='sphere' size='0.05 0.05 0.05' density='0.00001' conaffinity='0'/>-->
<geom rgba='0 1 1 1' type='cylinder' size='0.05 0.05 0.05' density='0.00001' contype='1' conaffinity='0'/>
<joint name='obj2_slidey' type='slide' pos='0 0 0' axis='0 1 0' range='-10.3213 10.3' damping='0.5'/>
<joint name='obj2_slidex' type='slide' pos='0 0 0' axis='1 0 0' range='-10.3213 10.3' damping='0.5'/>
</body>

<body name='object3' pos='0.30 0.60 -0.225' >
<body name='obj3' pos='0.30 0.60 -0.225' >
<!--<geom rgba='1 1 1 0' type='box' size='0.1 0.1 0.1' density='0.00001' conaffinity='0'/>-->
<geom rgba='0 1 0.5 1' type='box' size='0.1 0.1 0.1' density='0.00001' contype='1' conaffinity='0'/>
<joint name='obj3_slidey' type='slide' pos='0 0 0' axis='0 1 0' range='-10.3213 10.3' damping='0.5'/>
<joint name='obj3_slidex' type='slide' pos='0 0 0' axis='1 0 0' range='-10.3213 10.3' damping='0.5'/>
</body>

<body pos='-0.4793 -0.1582 -0.2228' name='obj4'>
<body pos='-0.4793 -0.1582 -0.2228' name='obj0'>
<geom size='0.1021 0.1021 0.1021' conaffinity='1' contype='1' density='1' rgba='0.2 1 0 1' type='box'/>
<joint pos='0 0 0' damping='0.75' type='free' limited='false' name='obj3_slide'/>
</body>

<body pos='0.3660 0.4967 -0.2166' name='obj0'>
<body pos='0.3660 0.4967 -0.2166' name='obj4'>
<geom size='0.1083 0.0902 0.05' conaffinity='1' contype='1' density='1' rgba='0.2 1 0 1' type='box'/>
<joint pos='0 0 0' damping='0.75' type='free' limited='false' name='obj4_slide'/>
</body>
Expand Down
4 changes: 2 additions & 2 deletions env.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
import third_party.clevr_robot_env_utils.generate_scene as gs
import third_party.clevr_robot_env_utils.question_engine as qeng

import clevr_robot_env.utils.load_utils as load_utils
from clevr_robot_env.utils import load_utils
from clevr_robot_env.utils.xml_utils import convert_scene_to_xml

try:
import cv2
import mujoco_env # custom mujoco_env
import clevr_robot_env.mujoco_env as mujoco_env # custom mujoco_env
from dm_control import mujoco
except ImportError as e:
print(e)
Expand Down
Empty file added third_party/__init__.py
Empty file.
11 changes: 9 additions & 2 deletions third_party/clevr_robot_env_utils/generate_question.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
import re
import time

import third_party.clevr_robot_env_utils.question_engine as qeng
try:
import third_party.clevr_robot_env_utils.question_engine as qeng
except ImportError as e:
print(e)


synonyms_json = os.path.join(__file__, '..', 'templates', 'synonyms.json')
parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
synonyms_json = os.path.join(
os.path.abspath(os.path.join(parent_dir, os.pardir)),
'templates',
'synonyms.json')


with open(synonyms_json, 'r') as f:
Expand Down
15 changes: 15 additions & 0 deletions utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

0 comments on commit a1b41b0

Please sign in to comment.