diff --git a/unilabos/app/backend.py b/unilabos/app/backend.py index 8acc8251..5bc4ad39 100644 --- a/unilabos/app/backend.py +++ b/unilabos/app/backend.py @@ -7,7 +7,7 @@ from unilabos.utils import logger def start_backend( backend: str, devices_config: dict = {}, - resources_config: dict = {}, + resources_config: list = [], graph=None, controllers_config: dict = {}, bridges=[], diff --git a/unilabos/device_mesh/resource_visalization.py b/unilabos/device_mesh/resource_visalization.py index 2ec28b01..0190ba2e 100644 --- a/unilabos/device_mesh/resource_visalization.py +++ b/unilabos/device_mesh/resource_visalization.py @@ -10,7 +10,7 @@ from unilabos.registry.registry import lab_registry class ResourceVisualization: - def __init__(self, device: dict, resource: dict, enable_rviz: bool = True): + def __init__(self, device: dict, resource: list, enable_rviz: bool = True): """初始化资源可视化类 该类用于将设备和资源的3D模型可视化展示。通过解析设备和资源的配置信息, @@ -18,13 +18,13 @@ class ResourceVisualization: Args: device (dict): 设备配置字典,包含设备的类型、位置等信息 - resource (dict): 资源配置字典,包含资源的类型、位置等信息 + resource (list): 资源配置列表,包含资源的类型、位置等信息 registry (dict): 注册表字典,包含设备和资源类型的注册信息 enable_rviz (bool, optional): 是否启用RViz可视化. Defaults to True. """ self.launch_service = LaunchService() self.launch_description = LaunchDescription() - self.resource_dict = resource + self.resource_list = resource self.resource_model = {} self.resource_type = ['deck', 'plate', 'container'] self.mesh_path = Path(__file__).parent.absolute() diff --git a/unilabos/ros/main_slave_run.py b/unilabos/ros/main_slave_run.py index 2e8b2fbf..fb8598c9 100644 --- a/unilabos/ros/main_slave_run.py +++ b/unilabos/ros/main_slave_run.py @@ -44,7 +44,7 @@ def exit() -> None: def main( devices_config: Dict[str, Any] = {}, - resources_config={}, + resources_config: list=[], graph: Optional[Dict[str, Any]] = None, controllers_config: Dict[str, Any] = {}, bridges: List[Any] = [], @@ -68,7 +68,7 @@ def main( discovery_interval, ) - if visual != "None": + if visual != "disable": resource_mesh_manager = ResourceMeshManager( resources_mesh_config, resources_config, diff --git a/unilabos/ros/nodes/presets/host_node.py b/unilabos/ros/nodes/presets/host_node.py index 4209ddff..f19e055f 100644 --- a/unilabos/ros/nodes/presets/host_node.py +++ b/unilabos/ros/nodes/presets/host_node.py @@ -50,7 +50,7 @@ class HostNode(BaseROS2DeviceNode): self, device_id: str, devices_config: Dict[str, Any], - resources_config: Any, + resources_config: list, physical_setup_graph: Optional[Dict[str, Any]] = None, controllers_config: Optional[Dict[str, Any]] = None, bridges: Optional[List[Any]] = None,