Skip to content

Commit c7e93eb

Browse files
committed
Import drone data from module path.
1 parent 0e5f4b7 commit c7e93eb

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

crazyflow/sim/sim.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import jax.numpy as jnp
99
import mujoco
1010
import mujoco.mjx as mjx
11+
import drone_models
1112
from drone_controllers.mellinger import (
1213
attitude2force_torque,
1314
force_torque2rotor_vel,
@@ -91,10 +92,7 @@ def __init__(
9192

9293
# Initialize MuJoCo world and data
9394
self._xml_path = xml_path or Path(__file__).parents[1] / "scene.xml"
94-
self.drone_path = (
95-
Path(__file__).parents[2]
96-
/ f"submodules/drone-models/drone_models/data/{drone_model}.xml"
97-
)
95+
self.drone_path = Path(drone_models.__file__).parent / "data" / f"{drone_model}.xml"
9896
self.spec = self.build_mjx_spec()
9997
self.mj_model, self.mj_data, self.mjx_model, self.mjx_data = self.build_mjx_model(self.spec)
10098
self.viewer: MujocoRenderer | None = None

0 commit comments

Comments
 (0)