Skip to content

Commit

Permalink
custom numeric data in xml is no longer a part of scene but rather agent
Browse files Browse the repository at this point in the history
  • Loading branch information
mginoya committed Feb 11, 2024
1 parent ff8c00e commit e3db984
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
14 changes: 14 additions & 0 deletions alfredo/agents/A1/a1.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
<agent>

<custom>
<numeric data="2500" name="constraint_limit_stiffness" />
<numeric data="27000" name="constraint_stiffness" />
<numeric data="30" name="constraint_ang_damping" />
<numeric data="80" name="constraint_vel_damping" />
<numeric data="-0.05" name="ang_damping" />
<numeric data="0.5" name="joint_scale_pos" />
<numeric data="0.1" name="joint_scale_ang" />
<numeric data="0" name="spring_mass_scale" />
<numeric data="1" name="spring_inertia_scale" />
<numeric data="20" name="matrix_inv_iterations" />
<numeric data="15" name="solver_maxls" />
</custom>

<body name="alfredo" pos="0 0 1.4">
<camera name="followme" mode="trackcom" pos="0 -4 0" xyaxes="1 0 0 0 0 1" />

Expand Down
2 changes: 1 addition & 1 deletion alfredo/agents/aant/aant.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self,

super().__init__(sys=sys, backend=backend, **kwargs)

print(sys)
print(self.sys.init_q)

self._ctrl_cost_weight = ctrl_cost_weight
self._use_contact_forces = use_contact_forces
Expand Down
14 changes: 14 additions & 0 deletions alfredo/agents/aant/aant.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
<agent>

<custom>
<numeric data="0.0 0.0 0.55 1.0 0.0 0.0 0.0 0.0 1.0 0.0 -1.0 0.0 -1.0 0.0 1.0" name="init_qpos"/>
<numeric data="1000" name="constraint_limit_stiffness"/>
<numeric data="4000" name="constraint_stiffness"/>
<numeric data="10" name="constraint_ang_damping"/>
<numeric data="20" name="constraint_vel_damping"/>
<numeric data="0.5" name="joint_scale_pos"/>
<numeric data="0.2" name="joint_scale_ang"/>
<numeric data="0.0" name="ang_damping"/>
<numeric data="1" name="spring_mass_scale"/>
<numeric data="1" name="spring_inertia_scale"/>
<numeric data="15" name="solver_maxls"/>
</custom>

<body name="torso" pos="0 0 0.75">
<camera name="track" mode="trackcom" pos="0 -3 0.3" xyaxes="1 0 0 0 0 1"/>
<geom name="torso_geom" pos="0 0 0" size="0.25" type="sphere"/>
Expand Down
14 changes: 0 additions & 14 deletions alfredo/scenes/flatworld/flatworld_A1_env.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@

<option iterations="30" timestep="0.002" />

<custom>
<numeric data="2500" name="constraint_limit_stiffness" />
<numeric data="27000" name="constraint_stiffness" />
<numeric data="30" name="constraint_ang_damping" />
<numeric data="80" name="constraint_vel_damping" />
<numeric data="-0.05" name="ang_damping" />
<numeric data="0.5" name="joint_scale_pos" />
<numeric data="0.1" name="joint_scale_ang" />
<numeric data="0" name="spring_mass_scale" />
<numeric data="1" name="spring_inertia_scale" />
<numeric data="20" name="matrix_inv_iterations" />
<numeric data="15" name="solver_maxls" />
</custom>

<size nkey="5" nuser_geom="1" />

<visual>
Expand Down
3 changes: 3 additions & 0 deletions alfredo/tools/tXMLCompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ def compose_scene(xml_env, xml_agent):
worldbody = env_root.find('worldbody')

ag_root = agent_tree.getroot()
ag_custom = ag_root.find('custom')
ag_body = ag_root.find('body')
ag_actuator = ag_root.find('actuator')


worldbody.append(ag_body)
env_root.append(ag_custom)
env_root.append(ag_actuator)

beautify(env_root)
Expand Down

0 comments on commit e3db984

Please sign in to comment.