Skip to content

Commit

Permalink
Use same logic for pit-crew downloading / namespacing
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 Dec 30, 2024
1 parent cfcf856 commit cb4378e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions rmf_building_map_tools/building_map/level.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ def generate_robot_at_vertex_idx(self, vertex_idx, world_ele):
robot_name = vertex.params['spawn_robot_name'].value
print(f'spawning robot name {robot_name} of type {robot_type}')

# remove namespace, if present
if "/" in robot_type:
robot_type = "/".join(robot_type.split("/")[1:])

yaw = 0
# find the first vertex connected by a lane to this vertex
for lane in self.lanes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,23 @@ def download_models(
actors = get_crowdsim_models(input_yaml)
model_set.update(actors)

def add_model(full_model_name):
if "/" in full_model_name:
model_name = "".join(full_model_name.split("/")[1:])
author_name = full_model_name.split("/")[0]

model_set.add((model_name, author_name))
stringent_dict[model_name.lower()] = \
author_name.lower()
else:
model_set.add(full_model_name)

for _, level in building.levels.items():
for model in level.models:
if "/" in model.model_name:
model_name = "".join(model.model_name.split("/")[1:])
author_name = model.model_name.split("/")[0]

model_set.add((model_name, author_name))
stringent_dict[model_name.lower()] = \
author_name.lower()
else:
model_set.add(model.model_name)
add_model(model.model_name)
for vertex in level.vertices:
if 'spawn_robot_type' in vertex.params:
model_set.add((vertex.params['spawn_robot_type'].value,
'Open-RMF'))
stringent_dict[model_name.lower()] = \
author_name.lower()
add_model(vertex.params['spawn_robot_type'].value)

if fuel_tools:
missing_models = pit_crew.get_missing_models(
Expand Down

0 comments on commit cb4378e

Please sign in to comment.