Skip to content

Commit

Permalink
get name from schema
Browse files Browse the repository at this point in the history
  • Loading branch information
WT-MM committed Jan 2, 2025
1 parent d537864 commit 20add09
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sim/sim2sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ def run_mujoco(
policy = ONNXModel(args.load_model)
metadata = policy.attached_metadata

joint_names = []
for value_schema in policy.input_schema.values + policy.output_schema.values:
if value_schema.HasField("joint_positions"):
joint_names = list(value_schema.joint_positions.joint_names)
break

try:
model_info = {
"num_actions": metadata["num_actions"],
Expand All @@ -402,7 +408,7 @@ def run_mujoco(
"sim_dt": metadata["sim_dt"],
"sim_decimation": metadata["sim_decimation"],
"tau_factor": metadata["tau_factor"],
"joint_names": metadata["joint_names"],
"joint_names": joint_names,
"cycle_time": metadata["cycle_time"],
}
except Exception as e:
Expand Down

0 comments on commit 20add09

Please sign in to comment.