Spaces:
Running
Running
Update src/clustering_robots.py
Browse files- src/clustering_robots.py +6 -2
src/clustering_robots.py
CHANGED
|
@@ -90,6 +90,9 @@ class RobotCharacteristics():
|
|
| 90 |
self.spec = mj.MjSpec()
|
| 91 |
self.spec.worldbody.add_light(pos=[0, 0, 3], dir=[0, 0, -1])
|
| 92 |
self.spec.worldbody.add_geom(type=mj.mjtGeom.mjGEOM_PLANE, size=[10, 10, 0.1], rgba=[.2, .3, .4, 1])
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
def _get_rainbow_color(self,i, n):
|
| 95 |
"""
|
|
@@ -156,8 +159,9 @@ class RobotCharacteristics():
|
|
| 156 |
name="base_link",
|
| 157 |
pos = [0.0,0.0,0.0]
|
| 158 |
)
|
| 159 |
-
self.spec.compile()
|
| 160 |
-
self.
|
|
|
|
| 161 |
if self.sorted_data is None:
|
| 162 |
raise ValueError("sorted data is None")
|
| 163 |
for group_idx, part in enumerate(self.sorted_data): # generating link & joints
|
|
|
|
| 90 |
self.spec = mj.MjSpec()
|
| 91 |
self.spec.worldbody.add_light(pos=[0, 0, 3], dir=[0, 0, -1])
|
| 92 |
self.spec.worldbody.add_geom(type=mj.mjtGeom.mjGEOM_PLANE, size=[10, 10, 0.1], rgba=[.2, .3, .4, 1])
|
| 93 |
+
self.model = self.spec.compile()
|
| 94 |
+
self.data = mj.MjData(self.model)
|
| 95 |
+
mj.mj_forward(self.model, self.data)
|
| 96 |
|
| 97 |
def _get_rainbow_color(self,i, n):
|
| 98 |
"""
|
|
|
|
| 159 |
name="base_link",
|
| 160 |
pos = [0.0,0.0,0.0]
|
| 161 |
)
|
| 162 |
+
self.model = self.spec.compile()
|
| 163 |
+
self.data = mj.MjData(self.model)
|
| 164 |
+
mj.mj_forward(self.model, self.data)
|
| 165 |
if self.sorted_data is None:
|
| 166 |
raise ValueError("sorted data is None")
|
| 167 |
for group_idx, part in enumerate(self.sorted_data): # generating link & joints
|