<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>xml | UCSC OSPO</title><link>https://deploy-preview-1007--ucsc-ospo.netlify.app/tag/xml/</link><atom:link href="https://deploy-preview-1007--ucsc-ospo.netlify.app/tag/xml/index.xml" rel="self" type="application/rss+xml"/><description>xml</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Mon, 29 Sep 2025 00:00:00 +0000</lastBuildDate><image><url>https://deploy-preview-1007--ucsc-ospo.netlify.app/media/logo_hub6795c39d7c5d58c9535d13299c9651f_74810_300x300_fit_lanczos_3.png</url><title>xml</title><link>https://deploy-preview-1007--ucsc-ospo.netlify.app/tag/xml/</link></image><item><title>Scenic-RoboSuite Integration: Building the First Working Prototype</title><link>https://deploy-preview-1007--ucsc-ospo.netlify.app/report/osre25/ucsc/scenic/20250929-sahil-tgs/</link><pubDate>Mon, 29 Sep 2025 00:00:00 +0000</pubDate><guid>https://deploy-preview-1007--ucsc-ospo.netlify.app/report/osre25/ucsc/scenic/20250929-sahil-tgs/</guid><description>&lt;p>I&amp;rsquo;m &lt;a href="https://sahiltgs.super.site/" target="_blank" rel="noopener">Sahil&lt;/a>, presenting the first working prototype of the Scenic-RoboSuite integration. This &lt;a href="https://sahiltgs.super.site/gsoc/uc-ospo-proposal" target="_blank" rel="noopener">project&lt;/a> is being mentored by &lt;a href="https://ucsc-ospo.github.io/author/daniel-fremont/" target="_blank" rel="noopener">Daniel Fremont&lt;/a> and &lt;a href="https://ucsc-ospo.github.io/author/eric-vin/" target="_blank" rel="noopener">Eric Vin&lt;/a>.&lt;/p>
&lt;p>After months of development, we have achieved a functional prototype of the &lt;a href="https://scenic-lang.org/" target="_blank" rel="noopener">Scenic&lt;/a>-&lt;a href="https://robosuite.ai/" target="_blank" rel="noopener">RoboSuite&lt;/a> interface. Researchers can now write basic declarative robotic manipulation scenarios in Scenic that execute with physics simulation in RoboSuite. While still in development, the prototype demonstrates the feasibility and potential of bridging probabilistic scenario generation with detailed robot control.&lt;/p>
&lt;h2 id="major-achievements">Major Achievements&lt;/h2>
&lt;h3 id="mjcf-xml-injection">MJCF XML Injection&lt;/h3>
&lt;p>The interface introduces direct MJCF XML support, allowing Scenic to build RoboSuite-native manipulable objects from raw XML definitions. Users can define custom objects with complex mesh geometries, textures, and physics properties directly in their Scenic scenarios:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">dragon_xml = &amp;#39;&amp;#39;&amp;#39;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&amp;lt;mujoco&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &amp;lt;asset&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &amp;lt;mesh file=&amp;#34;dragon.stl&amp;#34; scale=&amp;#34;0.01 0.01 0.01&amp;#34;/&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &amp;lt;texture file=&amp;#34;dragon_texture.png&amp;#34;/&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &amp;lt;/asset&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &amp;lt;worldbody&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &amp;lt;body name=&amp;#34;object&amp;#34;&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &amp;lt;geom mesh=&amp;#34;dragon_mesh&amp;#34; type=&amp;#34;mesh&amp;#34;/&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &amp;lt;/body&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &amp;lt;/worldbody&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&amp;lt;/mujoco&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&amp;#39;&amp;#39;&amp;#39;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">dragon = new CustomObject with mjcfXml dragon_xml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The system automatically handles collision geometry generation, joint creation for physics, and asset file resolution.&lt;/p>
&lt;h3 id="complex-mesh-object-support">Complex Mesh Object Support&lt;/h3>
&lt;p>Import and manipulate arbitrary 3D models (STL, OBJ) with automatic mesh repair and texture mapping. The interface resolves file paths relative to Scenic files, copies assets to temporary directories for MuJoCo, and converts textures (JPG to PNG) when needed. This enables using custom robotic tools, industrial parts, or any 3D model in manipulation scenarios.&lt;/p>
&lt;h3 id="custom-arena-definition">Custom Arena Definition&lt;/h3>
&lt;p>Define complete custom environments using MJCF XML, extending beyond RoboSuite&amp;rsquo;s built-in arenas:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">custom_arena = new CustomArena with arenaXml localPath(&amp;#34;warehouse.xml&amp;#34;)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This allows creating specialized workspaces, factory floors, or research-specific environments while maintaining full physics simulation.&lt;/p>
&lt;h3 id="multi-robot-support">Multi-Robot Support&lt;/h3>
&lt;p>The interface handles multiple robots operating in the same workspace:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">robot1 = new Panda at (-0.5, 0, 0)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">robot2 = new UR5e at (0.5, 0, 0)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">table = new Table at (0, 0, 0.425)
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Each robot maintains independent control and can execute coordinated or individual behaviors.&lt;/p>
&lt;h3 id="built-in-manipulation-behaviors">Built-in Manipulation Behaviors&lt;/h3>
&lt;p>Ready-to-use behaviors for immediate testing and development:&lt;/p>
&lt;ul>
&lt;li>&lt;code>MoveToPosition&lt;/code> - Precise end-effector positioning&lt;/li>
&lt;li>&lt;code>PickObject&lt;/code> - Automated grasping with approach and closure&lt;/li>
&lt;li>&lt;code>LiftToHeight&lt;/code> - Controlled lifting to target heights&lt;/li>
&lt;li>&lt;code>PickAndLift&lt;/code> - Complete pick-and-place sequence&lt;/li>
&lt;/ul>
&lt;p>These behaviors use Operational Space Control (OSC) for intuitive 3D movement commands.&lt;/p>
&lt;h3 id="extended-environment-configuration">Extended Environment Configuration&lt;/h3>
&lt;p>The interface extends RoboSuite&amp;rsquo;s configurability through Scenic&amp;rsquo;s parameter system:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">param controller_config = {&amp;#39;type&amp;#39;: &amp;#39;OSC_POSITION&amp;#39;, &amp;#39;impedance&amp;#39;: &amp;#39;low&amp;#39;}
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">param camera_view = &amp;#39;robot0_eye_in_hand&amp;#39;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">param lite_physics = True # Faster simulation for testing
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="example-probabilistic-pick-and-place">Example: Probabilistic Pick-and-Place&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">model scenic.simulators.robosuite.model
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"># Randomly position cube on table
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">table = new Table at (0.6, 0, 0.425)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">cube = new Box on table,
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> with color (1, 0, 0, 1),
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> with position (Uniform(-0.2, 0.2), Uniform(-0.2, 0.2), _)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"># Robot adapts to random cube position
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">behavior AdaptivePickup():
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> do PickAndLift(cube, height=1.1)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">ego = new Panda at (0, 0, 0),
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> with behavior AdaptivePickup()
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Each scenario run generates a different cube position, testing the robot&amp;rsquo;s adaptive capabilities.&lt;/p>
&lt;h2 id="challenges-overcome">Challenges Overcome&lt;/h2>
&lt;h3 id="understanding-dual-architecture-paradigms">Understanding Dual Architecture Paradigms&lt;/h3>
&lt;p>RoboSuite and Scenic operate on fundamentally different principles. RoboSuite builds environments imperatively through MuJoCo XML composition, expecting complete scene specification upfront. Scenic generates scenes probabilistically through constraint solving, requiring geometric knowledge before simulation. Bridging these required developing a two-pass system where we first extract geometry from a temporary RoboSuite environment, update Scenic&amp;rsquo;s understanding, then create the final simulation. This architectural mismatch touched every aspect of the integration, from object creation to property updates.&lt;/p>
&lt;h3 id="discovering-and-extending-manipulationenv">Discovering and Extending ManipulationEnv&lt;/h3>
&lt;p>RoboSuite&amp;rsquo;s documentation focuses on using pre-built tasks, not creating custom environments. Through extensive source code analysis, we discovered that &lt;code>ManipulationEnv&lt;/code> was the key - it accepts robots as configuration while allowing customizable arenas and objects as components. This class became our foundation, but required significant extension. We implemented &lt;code>ScenicManipulationEnv&lt;/code> to intercept Scenic&amp;rsquo;s object configurations, handle dynamic arena selection (EmptyArena vs MultiTableArena based on scene content), and manage the complex initialization sequence where robots, arenas, and objects must be assembled in specific order for MuJoCo compilation.&lt;/p>
&lt;h3 id="xml-to-3d-mesh-pipeline">XML to 3D Mesh Pipeline&lt;/h3>
&lt;p>Converting MJCF XML to usable 3D meshes proved complex. MuJoCo uses XML to describe geometry, but Scenic needs actual mesh data for collision checking. We built a multi-stage pipeline: First, &lt;code>ElementTree&lt;/code> parses the XML to extract mesh references and primitive definitions. Then, we handle two paths - for mesh files, we load STL/OBJ files with trimesh and apply XML-specified transformations; for primitives (boxes, cylinders), we generate meshes programmatically. The challenge intensified with composite objects - a table might have a box tabletop and four cylinder legs. We developed &lt;code>ComponentExtractor&lt;/code> to analyze the MuJoCo scene graph, identify related geometries through naming patterns and hierarchy, and export each component as a separate GLB file with proper world transforms preserved.&lt;/p>
&lt;h3 id="file-path-resolution-discrepancies">File Path Resolution Discrepancies&lt;/h3>
&lt;p>Scenic and RoboSuite handle file paths completely differently. Scenic uses &lt;code>localPath()&lt;/code> for paths relative to the scenario file, while RoboSuite expects paths relative to its package structure or absolute paths. MJCF XML compounds this - mesh references can be relative to the XML file location, not the calling code. We implemented a sophisticated path resolution system: detect whether paths come from embedded XML (relative to Scenic file) or external XML files (relative to XML location), copy all referenced assets (meshes, textures) to temporary directories accessible to MuJoCo, and handle texture format conversion (JPG to PNG) when needed. This system transparently manages assets whether they&amp;rsquo;re in the Scenic project, RoboSuite package, or absolute paths, making the interface truly portable.&lt;/p>
&lt;h2 id="impact-and-applications">Impact and Applications&lt;/h2>
&lt;p>This bridge enables:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Research&lt;/strong>: Generate diverse manipulation scenarios for robot learning algorithms&lt;/li>
&lt;li>&lt;strong>Testing&lt;/strong>: Validate robotic systems against probabilistic task variations&lt;/li>
&lt;li>&lt;strong>Development&lt;/strong>: Rapid prototyping of manipulation tasks without manual scene setup&lt;/li>
&lt;li>&lt;strong>Education&lt;/strong>: Teach robotics concepts through declarative scenario specification&lt;/li>
&lt;/ul>
&lt;p>The integration makes complex robotic simulations accessible through Scenic&amp;rsquo;s intuitive language while preserving RoboSuite&amp;rsquo;s detailed physics and control capabilities.&lt;/p>
&lt;h2 id="documentation-and-resources">Documentation and Resources&lt;/h2>
&lt;p>The project includes:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>example scenarios&lt;/strong> demonstrating all features&lt;/li>
&lt;li>&lt;strong>Comprehensive STATUS.md&lt;/strong> tracking working features and known issues&lt;/li>
&lt;li>&lt;strong>Technical documentation&lt;/strong> in &lt;code>docs/&lt;/code> covering architecture and troubleshooting&lt;/li>
&lt;li>&lt;strong>Mesh extraction utilities&lt;/strong> for pre-processing and caching&lt;/li>
&lt;/ul>
&lt;h2 id="current-status-and-future-work">Current Status and Future Work&lt;/h2>
&lt;p>This prototype demonstrates that the Scenic-RoboSuite bridge is viable and functional. Basic features are working reliably:&lt;/p>
&lt;ul>
&lt;li>Single-robot manipulation scenarios execute successfully&lt;/li>
&lt;li>MJCF XML injection creates custom objects&lt;/li>
&lt;li>Pick-and-place behaviors operate consistently&lt;/li>
&lt;li>Multi-robot support functions in controlled scenarios&lt;/li>
&lt;/ul>
&lt;p>However, significant work remains:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Stability improvements&lt;/strong>: Some features work intermittently and need refinement&lt;/li>
&lt;li>&lt;strong>Velocity tracking&lt;/strong>: Full implementation awaits framework updates&lt;/li>
&lt;li>&lt;strong>Multi-robot coordination&lt;/strong>: Advanced synchronization primitives needed&lt;/li>
&lt;li>&lt;strong>Performance optimization&lt;/strong>: Mesh extraction and caching can be streamlined&lt;/li>
&lt;li>&lt;strong>Extended testing&lt;/strong>: More diverse scenarios and edge cases need validation&lt;/li>
&lt;/ul>
&lt;p>The prototype serves as a proof of concept, showing that probabilistic scenario specification can successfully drive physics-based robot simulation. The architecture is sound, the core features function, and the path forward is clear.&lt;/p>
&lt;h2 id="conclusion">Conclusion&lt;/h2>
&lt;p>This working prototype of the Scenic-RoboSuite integration represents significant progress toward bridging probabilistic programming with robotic simulation. We&amp;rsquo;ve successfully demonstrated that declarative scenario specification can control detailed physics simulation, opening new possibilities for robotic system development and testing.&lt;/p>
&lt;p>While not yet production-ready, the prototype provides a solid foundation for future development. Researchers can begin experimenting with basic manipulation scenarios, developers can test the interface with their use cases, and the community can contribute to making this bridge more robust and feature-complete.&lt;/p>
&lt;p>The challenges overcome - from understanding dual architectures to implementing XML-to-mesh pipelines - have resulted in a functional system that validates our approach. This prototype proves that Scenic&amp;rsquo;s elegant scenario language and RoboSuite&amp;rsquo;s detailed physics can work together, setting the stage for a powerful new tool in robotics research and development.&lt;/p></description></item></channel></rss>