Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mutex to lane parameters #477

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions rmf_traffic_editor/gui/vertex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const vector<pair<string, Param::Type>> Vertex::allowed_params
{ "is_holding_point", Param::Type::BOOL },
{ "is_passthrough_point", Param::Type::BOOL },
{ "human_goal_set_name", Param::Type::STRING },
{ "mutex", Param::Type::STRING },
};


Expand Down
Loading