Skip to content

Commit

Permalink
fix mujoco renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Nov 14, 2024
1 parent a0cf87b commit a218990
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 258 deletions.
3 changes: 1 addition & 2 deletions frontend/src/components/files/FileRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ const FileRenderer: React.FC<{
// funky about the way the MJCF files are being generated by the
// K-Scale Onshape Library that isn't working well with the current
// renderer.
// return <MJCFRenderer mjcfContent={fileContent} files={allFiles} />;
return <MJCFRenderer />;
return <MJCFRenderer mjcfContent={fileContent} files={allFiles} />;
} else {
return (
<div className="h-full w-full flex items-center justify-center">
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/components/files/MJCFRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
FaUndo,
} from "react-icons/fa";

import humanoidXML from "@/components/files/mujoco/humanoid.xml";
import {
MujocoRefs,
cleanupMujoco,
Expand All @@ -29,7 +28,7 @@ import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";

interface Props {
mjcfContent?: string;
mjcfContent: string;
files?: UntarredFile[];
useControls?: boolean;
}
Expand Down Expand Up @@ -218,8 +217,7 @@ const MJCFRenderer = ({ mjcfContent, files, useControls = true }: Props) => {

// Initialize MuJoCo with the humanoid model
const { mj, model, state, simulation } = await initializeMujoco({
modelXML:
mjcfContent ?? (await fetch(humanoidXML).then((res) => res.text())),
modelXML: mjcfContent,
files: files ?? [],
});

Expand Down
250 changes: 0 additions & 250 deletions frontend/src/components/files/mujoco/humanoid.xml

This file was deleted.

Loading

0 comments on commit a218990

Please sign in to comment.