Skip to content

Commit

Permalink
Add mutex to lane parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Della Vedova <[email protected]>
  • Loading branch information
luca-della-vedova committed Oct 9, 2023
1 parent a7a4e43 commit 4f6ed12
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rmf_building_map_tools/building_map/level.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!')
Expand Down Expand Up @@ -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'] = \
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions rmf_traffic_editor/gui/edge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 4f6ed12

Please sign in to comment.