Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoruXue committed Sep 25, 2024
1 parent 4550c67 commit 87d2ec2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
9 changes: 1 addition & 8 deletions dial_mpc/core/dial_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import dial_mpc.envs as dial_envs
from dial_mpc.utils.io_utils import get_example_path, load_dataclass_from_dict
from dial_mpc.examples import examples

plt.style.use("science")

Expand Down Expand Up @@ -201,14 +202,6 @@ def reverse_scan(rng_Y0_state, factor):
config_or_example.add_argument("--list-examples", action="store_true")
args = parser.parse_args()

examples = [
"unitree_h1_jog",
"unitree_h1_push_crate",
"unitree_go2_trot",
"unitree_go2_seq_jump",
"unitree_go2_crate_climb",
]

if args.list_examples:
print("Examples:")
for example in examples:
Expand Down
2 changes: 1 addition & 1 deletion dial_mpc/envs/unitree_go2_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def step(
+ reward_energy * 0.0000
+ reward_pitch * 0.0
+ reward_roll * 0.0
+ reward_contact * 0.2
+ reward_contact * 0.1
- penalty_contact * 0.0
)
# jax.debug.print("{geom}", geom=pipeline_state.contact.geom)
Expand Down
7 changes: 7 additions & 0 deletions dial_mpc/examples/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
examples = [
"unitree_h1_jog",
"unitree_h1_push_crate",
"unitree_go2_trot",
"unitree_go2_seq_jump",
"unitree_go2_crate_climb",
]
21 changes: 21 additions & 0 deletions dial_mpc/examples/unitree_go2_crate_climb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# DIAL-MPC
seed: 0
output_dir: unitree_go2_crate_climb
n_steps: 100

env_name: unitree_go2_crate_climb
Nsample: 2048
Hsample: 25
Hnode: 5
Ndiffuse: 2
Ndiffuse_init: 10
temp_sample: 0.05
horizon_diffuse_factor: 0.9
traj_diffuse_factor: 0.5
update_method: mppi

# Base environment
dt: 0.02
timestep: 0.02
leg_control: torque
action_scale: 1.0
11 changes: 0 additions & 11 deletions dial_mpc/examples/unitree_h1_push_crate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,3 @@ default_vy: 0.0
default_vyaw: 0.0
ramp_up_time: 2.0
gait: slow_walk

# Sim
# sim_model_path: /home/haoru/research/dial/dial-mpc/dial_mpc/models/unitree_h1/scene_real_feet.xml
sim_model_path: /home/haoru/research/dial/dial-mpc/dial_mpc/models/unitree_h1/scene_position_real_feet.xml
# sim_leg_control: torque
sim_leg_control: position
plot: false
record: false
real_time_factor: 1.0
sim_dt: 0.005
sync_mode: false

0 comments on commit 87d2ec2

Please sign in to comment.