-
Notifications
You must be signed in to change notification settings - Fork 19
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
Sim Library Improvements #116
Changes from 2 commits
cae7a62
833f03a
6a65d01
df09d0d
102a770
0eb70d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,7 @@ def run_mujoco( | |
keyboard_use: bool = False, | ||
log_h5: bool = False, | ||
render: bool = True, | ||
h5_out_dir: str = "sim/resources", | ||
) -> None: | ||
""" | ||
Run the Mujoco simulation using the provided policy and configuration. | ||
|
@@ -178,7 +179,13 @@ def run_mujoco( | |
|
||
if log_h5: | ||
stop_state_log = int(cfg.sim_duration / cfg.dt) / cfg.decimation | ||
logger = HDF5Logger(embodiment, model_info["num_actions"], stop_state_log, model_info["num_observations"]) | ||
logger = HDF5Logger( | ||
data_name=embodiment, | ||
num_actions=model_info["num_actions"], | ||
max_timesteps=stop_state_log, | ||
num_observations=model_info["num_observations"], | ||
h5_out_dir=h5_out_dir | ||
) | ||
|
||
# Initialize variables for tracking upright steps and average speed | ||
upright_steps = 0 | ||
|
@@ -245,6 +252,7 @@ def run_mujoco( | |
"joint_pos": cur_pos_obs.astype(np.float32), | ||
"joint_vel": cur_vel_obs.astype(np.float32), | ||
"prev_actions": actions.astype(np.float32), | ||
"curr_actions": target_q.astype(np.float32), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. current actions are actions listed below There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. addressed in df09d0d There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is wrong, you are now saving latest actions and positions (target_q which are scaled actions). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay should be fixed in 0eb70d3 i renamed |
||
"ang_vel": omega.astype(np.float32), | ||
"euler_rotation": eu_ang.astype(np.float32), | ||
"buffer": hist_obs.astype(np.float32) | ||
|
@@ -312,6 +320,7 @@ def parse_modelmeta( | |
parser.add_argument("--load_model", type=str, required=True, help="Path to run to load from.") | ||
parser.add_argument("--keyboard_use", action="store_true", help="keyboard_use") | ||
parser.add_argument("--log_h5", action="store_true", help="log_h5") | ||
parser.add_argument("--h5_out_dir", type=str, default="sim/resources", help="Directory to save HDF5 files") | ||
parser.add_argument("--no_render", action="store_false", dest="render", help="Disable rendering") | ||
parser.set_defaults(render=True) | ||
args = parser.parse_args() | ||
|
@@ -363,4 +372,5 @@ def parse_modelmeta( | |
args.keyboard_use, | ||
args.log_h5, | ||
args.render, | ||
args.h5_out_dir, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the logic to the sim/produce_sim_data to use it as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in 6a65d01