Bugzilla – Bug 1210
Pyviz visualizer bounds are hardcoded and may be misaligned with mobility
Last modified: 2018-06-07 14:48:53 UTC
Hi, I am trying to use PyViz with NS2 traces derived from VanetMobiSim. The generated traces are in the range of X(4000-5000m) and Y(7000-8000m). However, the following problem appears. When i load the NS2 Traces using the NS2MobilityHelper, and then run the simulation with PyViz, the simulation area bounds are from X(-3000,+3000m) and Y(-3000,+3000). Therefore, the NS2 traces are not visible. I am attaching the traces in a text file, so as to reproduce this problem. Is this a known bug?
Created attachment 1189 [details] NS2 Mobility Traces
It's true, visualizer bounds are hardcoded initially to +/-3000 m. It is only possible to change it with a Python API only at the moment. In the mean time, if you want to change the hardcoded value, look for this line: self.canvas.set_bounds(-10000, -10000, 10000, 10000) in src/visualizer/visualizer/core.py. That value is 3 times the value in meters.
Created attachment 3097 [details] Patch to automatically increase visualisation bounds when a node moves I have encountered this issue myself, with nodes mobile over a 40KM^2 area. The default bounds of the visualiser are insufficient to display all the nodes present, as nodes initially start close to each other and then move away from each other. The attached patch will increase the bounds when a node moves outside the starting area.
fixed in changeset 13629:29680b2a505e