Bug 1210

Summary: Pyviz visualizer bounds are hardcoded and may be misaligned with mobility
Product: ns-3 Reporter: Nicholas Loulloudes <loulloudes.n>
Component: visualizerAssignee: Gustavo J. A. M. Carneiro <gjcarneiro>
Status: RESOLVED FIXED    
Severity: normal CC: matt-bradbury, ns-bugs, tomh
Priority: P5    
Version: ns-3.11   
Hardware: All   
OS: Linux   
Attachments: NS2 Mobility Traces
Patch to automatically increase visualisation bounds when a node moves

Description Nicholas Loulloudes 2011-07-06 09:58:01 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?
Comment 1 Nicholas Loulloudes 2011-07-06 10:16:53 UTC
Created attachment 1189 [details]
NS2 Mobility Traces
Comment 2 Gustavo J. A. M. Carneiro 2011-09-25 11:37:07 UTC
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.
Comment 3 Matthew Bradbury 2018-05-23 10:58:17 UTC
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.
Comment 4 Tom Henderson 2018-06-07 14:48:53 UTC
fixed in changeset 13629:29680b2a505e