Skip to content
New issue

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

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

Already on GitHub? # to your account

Tweak sphere rew #5

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bee1871
fix: environment was not reset if only custom_reset was used
Yasu31 Oct 7, 2023
9a21d1a
allow for potentially more dofs than in the hand (e.g. have articulat…
Yasu31 Oct 7, 2023
4e8f599
initial addition of option to fix/unfix hand or object
Yasu31 Oct 7, 2023
e7abf7b
don't reset object state if fixed
Yasu31 Oct 7, 2023
edbff31
reset hand state if not fixed
Yasu31 Oct 7, 2023
9c46e2b
if multiple objects are specirfied, use random object in list, not in…
Yasu31 Oct 7, 2023
2016d79
replace mostly useless variable with new variable that can be more ve…
Yasu31 Oct 7, 2023
8216214
remove unused member variabes and functions
Yasu31 Oct 7, 2023
0f048a4
remove unused code blocks
Yasu31 Oct 7, 2023
6ffe85b
initial addition of the crawl task
Yasu31 Oct 7, 2023
1687200
implement crawling task
Yasu31 Oct 10, 2023
070d1aa
add book
Yasu31 Oct 11, 2023
5dd98bb
reset object dof state if it has some
Yasu31 Oct 11, 2023
72ee5c4
fix error about aggregate size when introducing articulated objects
Yasu31 Oct 11, 2023
b7ffeeb
fix the documentation about quaternion element order (not wxyz, but x…
Yasu31 Nov 13, 2023
2507b31
use separate func for resetting object states
Yasu31 Nov 14, 2023
f65f903
- move the goal definition to within reset_goal_states(), so that it …
Yasu31 Nov 14, 2023
7589437
Merge branch 'merge_oss_changes' into enable_free_robot
Yasu31 Nov 15, 2023
08d4262
Merge branch 'fix_rotation_doc' into enable_free_robot
Yasu31 Nov 15, 2023
b0e2831
fix indentation
Yasu31 Nov 15, 2023
c58d3d5
tweak docs
Yasu31 Nov 15, 2023
2642785
reward maxes out at 1 rad/s and doesn't get larger or smaller after that
Yasu31 Dec 6, 2023
1e0819f
Merge branch 'enable_free_robot' into tweak_sphere_rew
Yasu31 Dec 6, 2023
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
22 changes: 22 additions & 0 deletions assets/mjcf/simple_book.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<mujoco model="book">
<!-- A5 size book -->
<option timestep="0.002" gravity="0 0 -9.81" collision="predefined"/>
<default>
<joint type="hinge" pos="0 -0.2 0.007" axis="0 1 0" limited="true" damping="0.0 1"/>
<geom rgba="0.8 0.2 .2 1"/>
</default>
<worldbody>
<body name="simple_book">
<geom name="spine" type="cylinder" size="0.01" fromto="-0.074 -0.1049 0 -0.074 0.1049 0"/>
<geom name="pages" type="box" size="0.07 0.105 0.008" rgba="1 1 1 1"/>
<body name="front_cover">
<geom name="front_cover" type="box" size="0.074 0.105 0.002" pos="0 0 0.01"/>
<joint name="front_cover_joint" pos="-0.074 0 0" range="-150 0"/>
</body>
<body name="back_cover">
<geom name="back_cover" type="box" size="0.074 0.105 0.002" pos="0 0 -0.01"/>
<joint name="back_cover_joint" pos="-0.074 0 0" range="0 150"/>
</body>
</body>
</worldbody>
</mujoco>
6 changes: 6 additions & 0 deletions faive_gym/cfg/task/FaiveHandP0_book.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
defaults:
- FaiveHandP0
# a simple example of introducing an articulated object
# doesn't learn any actual task, feel free to improve it...
env:
object_type: ["simple_book"]
41 changes: 41 additions & 0 deletions faive_gym/cfg/task/FaiveHandP0_crawl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
defaults:
- FaiveHandP0
# use the Crawl class defined in tasks/crawl.py
# see crawl.py for how to use
# doesn't actually train, just an example of how to have a free base robot
name: Crawl
env:
hand_fix_base: False
hand_start_p: [0, 0, 0.1]
hand_start_r: [0, 0, 0, 1]

object_fix_base: True
object_start_offset: [0, 0, 1] # move it to where it won't interfere with hand

rewards:
scales:
action_penalty: 0.
dof_acc_penalty: 0.
dof_vel_penalty: 0.
dof_trq_penalty: -0.0025
success: 0.
drop_penalty: 0.
simple_hand_flat: 0.0

reorienttask_obj_dist: 0.
reorienttask_obj_rot: 0.

crawl_forward_vel: 20.
crawl_penalty_upsidedown: -0.1

fall_dist_threshold: 10. # practically disabled

observations:
# change to include more stuff about body
actor_observations: ["dof_position", "dof_speed", "dof_force",
"hand_quat", "hand_vel",
"actions"]

obs_dims:
hand_quat: 4
hand_vel: 6
7 changes: 6 additions & 1 deletion faive_gym/cfg/task/RobotHandDefault.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ env:
object_start_offset: [0, 0, 0] # position of object initial position, relative to the hand
actuated_dof_range_override: None # optionally use a smaller joint range of actuation, helpful if the real robot can't achieve the full range of motion

# whether to fix objects in the world, or let them loose
object_fix_base: False
hand_fix_base: True

# hand start pose position (x, y, z)
hand_start_p: [0, 0, 0.5]
# hand start pose quaternion (w, x, y, z)
# hand start pose quaternion (x, y, z, w)
# rotate 200 degrees around x axis to make palm face up, and slightly tilt it downwards
hand_start_r: [0.9848078, 0, 0, -0.1736482]

asset:
Expand Down
2 changes: 2 additions & 0 deletions faive_gym/cfg/train/FaiveHandP0_bookPPO.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
defaults:
- FaiveHandP0PPO
2 changes: 2 additions & 0 deletions faive_gym/cfg/train/FaiveHandP0_crawlPPO.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
defaults:
- FaiveHandP0PPO
Loading