feat: 先生成静物
This commit is contained in:
parent
ff69a10189
commit
2ce41b8372
@ -1,4 +1,5 @@
|
|||||||
import threading
|
import threading
|
||||||
|
import time
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
from gazebo_ctrl import GazeboROSController
|
from gazebo_ctrl import GazeboROSController
|
||||||
@ -17,8 +18,15 @@ class ModelManager:
|
|||||||
self.rlock = threading.RLock()
|
self.rlock = threading.RLock()
|
||||||
|
|
||||||
def load_models(self, pmodels: List[PreloadModel]):
|
def load_models(self, pmodels: List[PreloadModel]):
|
||||||
|
static_types = [ModelType.TABLE, ModelType.TAG]
|
||||||
with self.rlock:
|
with self.rlock:
|
||||||
|
# 性能平凡的机器上,需要先加载静物,再加载动物
|
||||||
for pmod in pmodels:
|
for pmod in pmodels:
|
||||||
|
if pmod.model.obj_type in static_types:
|
||||||
|
self.add_model(pmod.model, pmod.gen)
|
||||||
|
time.sleep(5)
|
||||||
|
for pmod in pmodels:
|
||||||
|
if pmod.model.obj_type not in static_types:
|
||||||
self.add_model(pmod.model, pmod.gen)
|
self.add_model(pmod.model, pmod.gen)
|
||||||
|
|
||||||
def add_model(self, model: Model, add_sim: bool = True):
|
def add_model(self, model: Model, add_sim: bool = True):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user