Stretch 4 MJCF and URDF
The MJCF is now dynamically generated on-the-fly from the stretch4_urdf package using urdf2mjcf and programmatic DOM manipulations.
When the simulator is initialized, get_robot_xml_path() dynamically invokes mjcf_generator.py to convert the appropriate URDF into an MJCF and applies custom modifications required by Mujoco.
Programmatic Transformations Applied
The mjcf_generator.py applies the following changes to the raw urdf2mjcf output:
Removes all tags except
assetandworldbody.Removes specific tags from worldbody (e.g.,
light,camera,groundplane).Replaces the default wheel joints with custom bodies (
link_left_wheel,link_right_wheel,link_back_wheel) containingclass="wheel"and associated wheel rollers to support omnibase motion, and includesomniwheels.xml.Encapsulates lidar and camera geoms with dedicated bodies and includes
hemisphere_lidar_cameras_right/left.xml.Replaces
link_mastgeometry with appropriatecollisionandvisualgeomclasses.Renames the root body to
base_linkand adds animusite.Encapsulates gripper fingers into
link_gripper_slider(if present, e.g. for sg4 tool).Adjusts
class="visualgeom"and addsclass="rubber"to gripper fingers.Modifies wrist roll to include
gripper_cameras.xml.Adds
gravcomp="1"to lift, arm, and wrist components.Maps joints to appropriate classes defined in
defaults.xml(lift_stretch4,telescope,wrist_yaw_stretch4, etc.).
These steps have been fully automated and replace the previously documented manual processes.
Last updated
Was this helpful?
