diff --git a/rmf_building_map_tools/building_map/level.py b/rmf_building_map_tools/building_map/level.py index 3e45bcc6a..66b036aea 100644 --- a/rmf_building_map_tools/building_map/level.py +++ b/rmf_building_map_tools/building_map/level.py @@ -211,6 +211,10 @@ def add_edge_from_coords(self, edge_type, p1, p2, props): ParamValue.DOUBLE, props.get('speed_limit', 0.0) ]) + edge.params['mutex'] = ParamValue([ + ParamValue.STRING, + props.get('mutex', "") + ]) self.lanes.append(edge) else: raise ValueError('unknown edge type!') @@ -486,6 +490,10 @@ def generate_nav_graph(self, graph_idx, always_unidirectional=True): l.params['speed_limit'].value > 0.0: p['speed_limit'] = l.params['speed_limit'].value + if 'mutex' in l.params and \ + l.params['mutex'].value: + p['mutex'] = l.params['mutex'].value + if 'demo_mock_floor_name' in l.params and \ l.params['demo_mock_floor_name'].value: p['demo_mock_floor_name'] = \ @@ -503,9 +511,6 @@ def generate_nav_graph(self, graph_idx, always_unidirectional=True): if 'dock_name' in v1.params: # lane segment begins at dock beginning_dock = v1.params['dock_name'].value - if 'speed_limit' in l.params: - p['speed_limit'] = l.params['speed_limit'].value - if always_unidirectional and l.is_bidirectional(): # now flip things around and make the second link forward_params = copy.deepcopy(p) diff --git a/rmf_traffic_editor/gui/edge.cpp b/rmf_traffic_editor/gui/edge.cpp index dc09bcde3..aa208d611 100644 --- a/rmf_traffic_editor/gui/edge.cpp +++ b/rmf_traffic_editor/gui/edge.cpp @@ -132,6 +132,7 @@ void Edge::create_required_parameters() std::string()); create_param_if_needed("demo_mock_lift_name", Param::STRING, std::string()); create_param_if_needed("speed_limit", Param::DOUBLE, 0.0); + create_param_if_needed("mutex", Param::STRING, std::string()); } else if (type == DOOR) {