webots icon indicating copy to clipboard operation
webots copied to clipboard

JOSM Edited map of OSM showing nothing in webots.

Open nnuk opened this issue 7 years ago • 7 comments

Hi,

I have edited a OSM map in JOSM but the problem is when i convert that osm to .wbt it is do not opens in the webots application.

I am using Webots 2019b which is the latest version.

Following are the lines which appear in command line while creating .wbt file.

Traceback (most recent call last): File "/Volumes/Intenso/Webots Application/WebotsB/Webots.app/resources/osm_importer/importer.py", line 156, in parser.parse_file(options.inFile, options.disableMultipolygonBuildings) File "/Volumes/Intenso/Webots Application/WebotsB/Webots.app/resources/osm_importer/parser_objects.py", line 52, in parse_file self.parse_way(way) File "/Volumes/Intenso/Webots Application/WebotsB/Webots.app/resources/osm_importer/parser_objects.py", line 110, in parse_way Road.add_to_list(osmId, tags, refs) File "/Volumes/Intenso/Webots Application/WebotsB/Webots.app/resources/osm_importer/webots_objects/road.py", line 317, in add_to_list if road.parse_tags(): File "/Volumes/Intenso/Webots Application/WebotsB/Webots.app/resources/osm_importer/webots_objects/road.py", line 117, in parse_tags self.forwardLanes = int(self.tags['lanes:forward']) ValueError: invalid literal for int() with base 10: 'Street'.

Thanks.

nnuk avatar Jul 25 '19 13:07 nnuk

Sometimes, OSM data contains weird information. Normally a lanes:forward should contain only integers, but here, someone introduced a String containing "Street" instead :-) which is certainly a rare mistake.

I just created this patch to support dummy values for lanes:forward: https://github.com/omichel/webots/pull/759

Could you give a try? (Simply replacing WEBOTS_HOME/resources/osm_importer/webots_objects/road.py by this file)

fabienrohrer avatar Jul 25 '19 14:07 fabienrohrer

@fabienrohrer Thanks alot for your help now I am getting the map in Webots. But In the command line I am getting these lines :

Invalid "turn:lanes:backward" tag for "" Invalid "turn:lanes:forward" tag for "" Invalid "turn:lanes:backward" tag for "" Invalid "turn:lanes:forward" tag for "" Invalid "turn:lanes:forward" tag for "" Invalid "turn:lanes:forward" tag for "" Invalid "turn:lanes:backward" tag for "" Invalid "turn:lanes:forward" tag for "" Invalid "turn:lanes:backward" tag for "" Invalid "turn:lanes:forward" tag for "" Invalid "turn:lanes:backward" tag for "" Invalid "turn:lanes:backward" tag for ""

Traceback (most recent call last): File "/Volumes/Intenso/Webots Application/WebotsB/Webots.app/resources/osm_importer/importer.py", line 188, in Area.export(outputFile, options.noParkings) File "/Volumes/Intenso/Webots Application/WebotsB/Webots.app/resources/osm_importer/webots_objects/area.py", line 203, in export treesFile = area.generate_tree_file(os.path.dirname(os.path.abspath(file.name))) File "/Volumes/Intenso/Webots Application/WebotsB/Webots.app/resources/osm_importer/webots_objects/area.py", line 255, in generate_tree_file os.remove('forest/' + str(self.OSMID) + '.forest') OSError: [Errno 2] No such file or directory: 'forest/100355349.forest'

Can you kindly guide me through it.?

Thanks.

nnuk avatar Jul 25 '19 15:07 nnuk

I just updated https://github.com/omichel/webots/pull/759 with a patch which should hopefully solve your issue. This time, it involves another file: area.py to be copied at the right location... Is it working better with it?

fabienrohrer avatar Jul 25 '19 15:07 fabienrohrer

(The warning about "invalid "turn:lanes:backward" tag" could certainly be ignored. There are other weirdness in your OSM files about lane tags.)

fabienrohrer avatar Jul 25 '19 15:07 fabienrohrer

@fabienrohrer Thankyou very much for your help. It worked.

nnuk avatar Jul 25 '19 16:07 nnuk

Thank you. The patch will be released in the next Webots version.

fabienrohrer avatar Jul 25 '19 17:07 fabienrohrer

It is indeed already released in the latest nightly build.

omichel avatar Jul 27 '19 11:07 omichel