open-rmf / fleet_adapter_template

Apache License 2.0
13 stars 21 forks source link

Using fleet_adapter_template with nav_graph #3

Closed edcogue closed 3 years ago

edcogue commented 3 years ago

I'm trying to make a new fleet adapter using this template. I understand the use of the RobotClientAPI, but when I run the adapter template is raises the next error: operator[] call on scalar I think that may be is something wrong with my config.yaml or my nav_graph.yaml. Is it possible to get two example files of this files or any detailed information about the data inside?

Yadunund commented 3 years ago

Hi there, Could you share the entire python stack trace to help understand where the error arises? The example config.yaml file is provided here. The nav_graph.yaml is generated by building_map_generator. Typically for RMF deployments, this gets built and installed along when compiling the maps package. For example, building rmf_demos_maps will generate and install the nav_graphs to ~/rmf_demos_ws/install/rmf_demos_maps/share/rmf_demos_maps/maps/office/nav_graphs/

edcogue commented 3 years ago

Here is the trace:

Starting fleet adapter... Traceback (most recent call last): File "/home/ubuntu/ros2_ws/install/fleet_adapter_template/lib/fleet_adapter_template/fleet_adapter", line 11, in load_entry_point('fleet-adapter-template==0.0.0', 'console_scripts', 'fleet_adapter')() File "/home/ubuntu/ros2_ws/install/fleet_adapter_template/lib/python3.8/site-packages/fleet_adapter_template/fleet_adapter.py", line 239, in main adapter, fleet_handle, robots = initialize_fleet( File "/home/ubuntu/ros2_ws/install/fleet_adapter_template/lib/python3.8/site-packages/fleet_adapter_template/fleet_adapter.py", line 80, in initialize_fleet nav_graph = graph.parse_graph(nav_graph_path, vehicle_traits) RuntimeError: operator[] call on a scalar

I'm using the traffic editor to generate de nav_graph.yaml.

edcogue commented 3 years ago

It was my mistake, i was using the file .building.yaml instead of the file .yaml that comes from building map_generator. So the flow to build nav_map is the next?

  1. Generate a map using traffic-editor and generate building_map_path
  2. ros2 run rmf_building_map_tools building_map_generator nav \ ${building_map_path} ${output_nav_graphs_dir}
  3. Use the output file in the template

Is it correct?

Yadunund commented 3 years ago

Yes, that would be the right approach 👍🏼