Skip to content

Commit a74ca5c

Browse files
committed
Fix material friction being ignore when parsing URDF/MJCF files.
1 parent d88faa9 commit a74ca5c

File tree

15 files changed

+147
-165
lines changed

15 files changed

+147
-165
lines changed

examples/rigid/suction_cup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
def main():
7-
87
parser = argparse.ArgumentParser()
98
parser.add_argument("-v", "--vis", action="store_true", default=False)
109
parser.add_argument("-c", "--cpu", action="store_true", default=False)
@@ -96,7 +95,7 @@ def main():
9695

9796
# add suction / weld constraint
9897
rigid = scene.sim.rigid_solver
99-
link_cube = cube.get_link("box_baselink").idx
98+
link_cube = cube.base_link_idx
10099
link_franka = franka.get_link("hand").idx
101100
rigid.add_weld_constraint(link_cube, link_franka)
102101

genesis/engine/entities/drone_entity.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212

1313
@ti.data_oriented
1414
class DroneEntity(RigidEntity):
15-
def _load_scene(self, morph, surface):
16-
super()._load_scene(morph, surface)
15+
def _load_scene(self):
16+
super()._load_scene()
1717

1818
# additional drone specific attributes
19-
properties = ET.parse(os.path.join(mu.get_assets_dir(), morph.file)).getroot()[0].attrib
19+
properties = ET.parse(os.path.join(mu.get_assets_dir(), self.morph.file)).getroot()[0].attrib
2020
self._KF = float(properties["kf"])
2121
self._KM = float(properties["km"])
2222

23-
self._n_propellers = len(morph.propellers_link_name)
23+
self._n_propellers = len(self.morph.propellers_link_name)
2424

25-
propellers_link = gs.List([self.get_link(name) for name in morph.propellers_link_name])
25+
propellers_link = gs.List([self.get_link(name) for name in self.morph.propellers_link_name])
2626
self._propellers_link_idxs = torch.tensor(
2727
[link.idx for link in propellers_link], dtype=gs.tc_int, device=gs.device
2828
)
@@ -35,8 +35,8 @@ def _load_scene(self, morph, surface):
3535
gs.logger.warning("No visual geometry found for propellers. Skipping propeller animation.")
3636
self._animate_propellers = False
3737

38-
self._propellers_spin = torch.tensor(morph.propellers_spin, dtype=gs.tc_float, device=gs.device)
39-
self._model = morph.model
38+
self._propellers_spin = torch.tensor(self.morph.propellers_spin, dtype=gs.tc_float, device=gs.device)
39+
self._model = self.morph.model
4040

4141
def _build(self):
4242
super()._build()

0 commit comments

Comments
 (0)