Skip to content

Commit

Permalink
slight tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed May 15, 2024
1 parent 14e237b commit 9126948
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion sim/scripts/create_fixed_torso.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"""This script updates the URDF file to fix the joints of the robot."""

import xml.etree.ElementTree as ET

from sim.stompy.joints import StompyFixed

STOMPY_URDF = "stompy/robot.urdf"


def update_urdf():
def update_urdf() -> None:
tree = ET.parse(STOMPY_URDF)
root = tree.getroot()
stompy = StompyFixed()
Expand Down
2 changes: 1 addition & 1 deletion sim/scripts/create_mjcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import mujoco


def create_mjcf():
def create_mjcf() -> None:
model_xml = mujoco.MjModel.from_xml_path(os.path.join(os.getenv("MODEL_DIR"), "robot.urdf"))
mujoco.mj_saveLastXML(os.path.join(os.getenv("MODEL_DIR"), "robot.xml"), model_xml)

Expand Down
3 changes: 2 additions & 1 deletion sim/scripts/simulate_mjcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
Run with mjpython:
mjpython mjpython sim/scripts/simulate_mjcf.py
"""

import time

import mujoco
import mujoco.viewer

from sim.env import stompy_mjcf_path


model = mujoco.MjModel.from_xml_path(stompy_mjcf_path())
data = mujoco.MjData(model)

Expand Down

0 comments on commit 9126948

Please sign in to comment.