Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomized Desk + New Views from R3M #32

Open
wants to merge 4 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mj_envs/envs/hand_manipulation_suite/assets/DAPG_door.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
<camera name="fixed" pos="0 -0.7 0.7" quat="0.92388 0.382683 0 0" />
<!-- Camera for the VIL paper -->
<camera name="vil_camera" pos="0 -1.2 1.2" quat="0.92388 0.382683 0 0" />
<camera name="view_1" pos="-0.8 -0.8 0.8" euler="0.785 -0.785 -0.785" />
<camera name="view_2" pos="0 0.5 0.2" euler="-1.57 0 3.14" />
<camera name="view_3" pos="0 0.2 -0.2" euler="-2.35 0 3.14" />
<camera name="view_4" pos="0.8 -0.8 0.8" euler="0.785 0.785 0.785" />
<camera name="view_5" pos="0 -0.25 -0.4" euler="-3.2 0 3.14" />
<camera name="top" pos="0 0 1.5" euler="0 0 3.14" />

<!-- ======= TABLE ======= -->
Expand Down
5 changes: 5 additions & 0 deletions mj_envs/envs/hand_manipulation_suite/assets/DAPG_hammer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
<camera name="fixed" pos="0 -0.7 0.7" quat="0.92388 0.382683 0 0" />
<!-- Camera for the VIL paper -->
<camera name="vil_camera" pos="0 -1.2 1.2" quat="0.92388 0.382683 0 0" />
<camera name="view_1" pos="-0.8 -0.8 0.8" euler="0.785 -0.785 -0.785" />
<camera name="view_2" pos="0 0.5 0.2" euler="-1.57 0 3.14" />
<camera name="view_3" pos="0 0.2 -0.2" euler="-2.35 0 3.14" />
<camera name="view_4" pos="0.8 -0.8 0.8" euler="0.785 0.785 0.785" />
<camera name="view_5" pos="0 -0.25 -0.4" euler="-3.2 0 3.14" />
<camera name="top" pos="0 0 1.1" euler="0 0 3.14" />
vikashplus marked this conversation as resolved.
Show resolved Hide resolved

<!-- ======= TABLE ======= -->
Expand Down
1 change: 1 addition & 0 deletions mj_envs/envs/hand_manipulation_suite/assets/DAPG_pen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<camera name="view_3" pos="0 0.2 -0.2" euler="-2.35 0 3.14" />
<camera name="view_4" pos="0.8 -0.8 0.8" euler="0.785 0.785 0.785" />
<camera name="view_5" pos="0 -0.25 -0.4" euler="-3.2 0 3.14" />
<camera name="top" pos="0 0 1.5" euler="0 0 3.14" />

<!-- ======= TABLE ======= -->
<body name="table">
Expand Down
6 changes: 6 additions & 0 deletions mj_envs/envs/hand_manipulation_suite/assets/DAPG_relocate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<camera name="fixed" pos="0 -0.7 0.7" quat="0.92388 0.382683 0 0" />
<!-- Camera for the VIL paper -->
<camera name="vil_camera" pos="0 -1.2 1.2" quat="0.92388 0.382683 0 0" />
<camera name="view_1" pos="-0.8 -0.8 0.8" euler="0.785 -0.785 -0.785" />
<camera name="view_2" pos="0 0.5 0.2" euler="-1.57 0 3.14" />
<camera name="view_3" pos="0 0.2 -0.2" euler="-2.35 0 3.14" />
<camera name="view_4" pos="0.8 -0.8 0.8" euler="0.785 0.785 0.785" />
<camera name="view_5" pos="0 -0.25 -0.4" euler="-3.2 0 3.14" />
<camera name="top" pos="0 0 1.5" euler="0 0 3.14" />

<!-- ======= TABLE ======= -->
<body name="table">
Expand Down
1 change: 1 addition & 0 deletions mj_envs/envs/relay_kitchen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
DEMO_ENTRY_POINT = "mj_envs.envs.relay_kitchen:KitchenFrankaDemo"
RANDOM_ENTRY_POINT = "mj_envs.envs.relay_kitchen:KitchenFrankaRandom"
FIXED_ENTRY_POINT = "mj_envs.envs.relay_kitchen:KitchenFranka"
RANDOM_DESK_ENTRY_POINT = "mj_envs.envs.relay_kitchen:KitchenFrankaRandomDesk"

# Kitchen
register(
Expand Down
4 changes: 3 additions & 1 deletion mj_envs/envs/relay_kitchen/assets/franka_kitchen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Details :: https://github.com/vikashplus/furniture_sim
License :: Under 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.
====================================================== -©vk©-->
<size njmax='1000' nconmax='1000'/>
<size njmax='4000' nconmax='4000'/>

<include file="../../../sims/scene_sim/basic_scene.xml"/>
<include file="../../../sims/franka_sim/assets/assets.xml"/>
Expand Down Expand Up @@ -49,6 +49,8 @@

<site name='target' pos='0 0 0' size='0.1' rgba='0 2 0 .2'/>
<camera name='left_cap' pos='-1.2 -0.5 1.8' quat='0.78 0.49 -0.22 -0.32' />
<camera name='left_cap2' mode='targetbody' target='knob 1' pos='-1.4 -1.0 1.8'/>
<camera name='right_cap2' mode='targetbody' target='microwave' pos='1.3 -0.7 3.4'/>
<camera name='right_cap' pos='1.2 -0.5 1.8' quat='0.76 0.5 0.21 0.35'/>

<!-- Robot -->
Expand Down
16 changes: 16 additions & 0 deletions mj_envs/envs/relay_kitchen/kitchen_multitask_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,19 @@ def reset(self, reset_qpos=None, reset_qvel=None):
* (self.robot_ranges[:, 1] - self.robot_ranges[:, 0])
)
return super().reset(reset_qpos=reset_qpos, reset_qvel=reset_qvel)

class KitchenFrankaRandomDesk(KitchenFrankaFixed):
def reset(self, reset_qpos=None, reset_qvel=None):
if reset_qpos is None:
reset_qpos = self.init_qpos.copy()
reset_qpos[self.robot_dofs] += (
0.05
* (self.np_random.uniform(size=len(self.robot_dofs)) - 0.5)
* (self.robot_ranges[:, 1] - self.robot_ranges[:, 0])
)
ncon = 10
while ncon > 4:
self.sim.model.body_pos[14] = np.array([-0.1, 0.75, 0.0]) + np.random.uniform(-0.1, 0.1, (3,))
self.sim.step()
ncon = self.sim.data.ncon
return super().reset(reset_qpos=reset_qpos, reset_qvel=reset_qvel)