diff --git a/CMakeLists.txt b/CMakeLists.txt index 034dd96..0e941cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ set(ROBOTS lite lite_bimanual lite_biped + lite_biped_debug lite_dummy lite_pro ) diff --git a/robot_assets/workflow/urdf_to_mjcf.py b/robot_assets/workflow/urdf_to_mjcf.py index a9dc34d..ab02e5a 100644 --- a/robot_assets/workflow/urdf_to_mjcf.py +++ b/robot_assets/workflow/urdf_to_mjcf.py @@ -336,9 +336,18 @@ def is_collision(geom: ET.Element) -> bool: def walk(body: ET.Element, in_foot: bool) -> None: nonlocal n_foot, n_other foot = in_foot or (body.get("name") in foot_bodies) + # Name collision geoms _collision_. MuJoCo leaves URDF-imported + # geoms anonymous, but the training env selects them BY NAME -- mjlab's + # friction DR matches r"^(left|right)_foot_collision_\d+$" -- and an + # unnamed geom can never match, so the randomization would silently do + # nothing. Only fills blanks; an explicit name in the MJCF wins. + collision_index = 0 for geom in body.findall("geom"): if not is_collision(geom): continue + if not geom.get("name"): + geom.set("name", f"{body.get('name')}_collision_{collision_index}") + collision_index += 1 if foot: geom.set("condim", "3") geom.set("friction", foot_friction_str) diff --git a/robots/lite/mjcf/lite.xml b/robots/lite/mjcf/lite.xml index 5a0cfbc..291da4d 100644 --- a/robots/lite/mjcf/lite.xml +++ b/robots/lite/mjcf/lite.xml @@ -462,4 +462,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/robots/lite_biped/mjcf/lite_biped.xml b/robots/lite_biped/mjcf/lite_biped.xml index 3900d3d..0d145ba 100644 --- a/robots/lite_biped/mjcf/lite_biped.xml +++ b/robots/lite_biped/mjcf/lite_biped.xml @@ -35,7 +35,7 @@ - + @@ -44,7 +44,7 @@ - + @@ -57,17 +57,17 @@ - - - - - - - - - - - + + + + + + + + + + + @@ -83,7 +83,7 @@ - + @@ -92,7 +92,7 @@ - + @@ -105,17 +105,17 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/robots/lite_biped_debug/cad/config.json b/robots/lite_biped_debug/cad/config.json new file mode 100644 index 0000000..ad5b4ab --- /dev/null +++ b/robots/lite_biped_debug/cad/config.json @@ -0,0 +1,28 @@ +{ + "output_format": "urdf", + "output_filename": "lite_biped_debug", + + "document_id": "e9ee61a2e2678af2088d9f31", + "workspace_id": "26c0b8ae0ee1fec90698ed7b", + "assembly_name": "Biped", + + "configuration": "Configuration=Sim Biped", + "robot_name": "lite_biped_debug", + + "ignore": {}, + "include_configuration_suffix": false, + "round_decimals": 12, + + "joint_properties": { + "default": { + "max_effort": 100, + "max_velocity": 100, + "friction": 0.1 + } + }, + + "merge_stls": true, + "simplify_stls": true, + "max_stl_size": 2, + "use_scads": true +} \ No newline at end of file diff --git a/robots/lite_biped_debug/cad/joint_properties.json b/robots/lite_biped_debug/cad/joint_properties.json new file mode 100644 index 0000000..c463beb --- /dev/null +++ b/robots/lite_biped_debug/cad/joint_properties.json @@ -0,0 +1,27 @@ +{ + "(left|right)_hip_(pitch|roll)": { + "friction_loss": 0.1, + "armature": 0.008, + "effort_limit": 36.0 + }, + "(left|right)_hip_yaw": { + "friction_loss": 0.1, + "armature": 0.005, + "effort_limit": 17.0 + }, + "(left|right)_knee_pitch": { + "friction_loss": 0.1, + "armature": 0.008, + "effort_limit": 36.0 + }, + "(left|right)_ankle_(yaw|pitch)": { + "friction_loss": 0.1, + "armature": 0.002, + "effort_limit": 14.0 + }, + "(left|right)_ankle_roll": { + "friction_loss": 0.1, + "armature": 0.001, + "effort_limit": 5.5 + } +} diff --git a/robots/lite_biped_debug/cad/physics.json b/robots/lite_biped_debug/cad/physics.json new file mode 100644 index 0000000..9b21246 --- /dev/null +++ b/robots/lite_biped_debug/cad/physics.json @@ -0,0 +1,13 @@ +{ + "_comment": "MuJoCo