Sylwia0506 / Projekt_IoT

1 stars 0 forks source link

[Bug] NameError: name 'G' is not defined #44

Closed TheYoungBeast closed 1 year ago

TheYoungBeast commented 1 year ago

After fixing issue #43 another issue arose. Fixes #34 pr

Error dump:

taxi              | Traceback (most recent call last):
taxi              |   File "//main.py", line 132, in <module>
taxi              |     run()
taxi              |   File "//main.py", line 125, in run
taxi              | Connected to MQTT Broker!
taxi              |     publish(client)
taxi              |   File "//main.py", line 89, in publish
taxi              |     (lat, long) = road_generator.G.nodes[route[index]]["x"], G.nodes[route[index]]["y"]
taxi              |                                                              ^
taxi              | NameError: name 'G' is not defined

It seems that G is not properly declared or visible outside of its module.