Update sim/base_sim.py
Browse files- sim/base_sim.py +3 -2
sim/base_sim.py
CHANGED
|
@@ -16,7 +16,7 @@ except ImportError:
|
|
| 16 |
print("Warning: rclpy not found. Camera image publishing will be disabled.")
|
| 17 |
from unitree_sdk2py.core.channel import ChannelFactoryInitialize
|
| 18 |
import yaml
|
| 19 |
-
|
| 20 |
from .image_publish_utils import ImagePublishProcess
|
| 21 |
from .metric_utils import check_contact, check_height
|
| 22 |
from .sim_utilts import get_subtree_body_names
|
|
@@ -84,8 +84,9 @@ class DefaultEnv:
|
|
| 84 |
|
| 85 |
def init_scene(self):
|
| 86 |
"""Initialize the default robot scene"""
|
|
|
|
| 87 |
self.mj_model = mujoco.MjModel.from_xml_path(
|
| 88 |
-
str(
|
| 89 |
)
|
| 90 |
self.mj_data = mujoco.MjData(self.mj_model)
|
| 91 |
self.mj_model.opt.timestep = self.sim_dt
|
|
|
|
| 16 |
print("Warning: rclpy not found. Camera image publishing will be disabled.")
|
| 17 |
from unitree_sdk2py.core.channel import ChannelFactoryInitialize
|
| 18 |
import yaml
|
| 19 |
+
import os
|
| 20 |
from .image_publish_utils import ImagePublishProcess
|
| 21 |
from .metric_utils import check_contact, check_height
|
| 22 |
from .sim_utilts import get_subtree_body_names
|
|
|
|
| 84 |
|
| 85 |
def init_scene(self):
|
| 86 |
"""Initialize the default robot scene"""
|
| 87 |
+
assets_root = Path(__file__).parent.parent
|
| 88 |
self.mj_model = mujoco.MjModel.from_xml_path(
|
| 89 |
+
str(assets_root / self.config["ROBOT_SCENE"])
|
| 90 |
)
|
| 91 |
self.mj_data = mujoco.MjData(self.mj_model)
|
| 92 |
self.mj_model.opt.timestep = self.sim_dt
|