Hello all,
I have the latest Omnet++ (v5.3) with the latest inet (v3.99.3-72fe86e). I am trying to simulate combined mobility models using Tractor mobility and Attached mobility. I want to simulate it for agricultural research.
The network that I have created is pretty minimal, taken from the inet mobility examples. It is as this:
import inet.visualizer.integrated.IntegratedCanvasVisualizer;
import inet.examples.mobility.MobileHost;
network adhocTractorAttachedNetwork
{
parameters:
int numHosts;
bool hasVisualizer = default(false);
@display("bgb=600,400");
submodules:
visualizer: IntegratedCanvasVisualizer if hasVisualizer {
parameters:
@display("p=50,50");
}
host[numHosts]: MobileHost {
parameters:
@display("p=300,300");
}
}And then my initialization file looks like this:
[General]
network = adhocTractorAttachedNetwork
sim-time-limit = 1 day
tkenv-plugin-path = ../inet/etc/plugins
*.numHosts = 4
**.constraintAreaMinX = 0m
**.constraintAreaMinY = 0m
**.constraintAreaMinZ = 0m
**.constraintAreaMaxX = 6000m
**.constraintAreaMaxY = 4000m
**.constraintAreaMaxZ = 0m
**.updateInterval = 0.1s
**.mobility.initFromDisplayString = false
# mobility
*.hasVisualizer = true
*.visualizer.mobilityVisualizer.moduleFilter = "**.mobility"
*.visualizer.mobilityVisualizer.displayMovementTrails = true
*.visualizer.mobilityVisualizer.displayOrientations = true
*.visualizer.mobilityVisualizer.displayVelocities = true
**.host[0].mobilityType = "TractorMobility"
**.host[0].mobility.x1 = 100m
**.host[0].mobility.y1 = 100m
**.host[0].mobility.x2 = 500m
**.host[0].mobility.y2 = 300m
**.host[0].mobility.rowCount = 4
**.host[0].mobility.speed = 25mps
#**.host[0].mobilityType = "LinearMobility"
#**.host[0].mobility.speed = 25mps
#**.host[0].mobilityType = "CircleMobility"
#**.host[0].mobility.cx = 300m
#**.host[0].mobility.cy = 200m
#**.host[0].mobility.r = 150m
#**.host[0].mobility.speed = 40mps
#**.host[0].mobilityType = "RandomWaypointMobility"
#**.host[0].mobility.speed = 40mps
**.host[1..3].mobilityType = "AttachedMobility"
**.host[1..3].mobility.mobilityModule = "^.^.host[0].mobility"
**.host[1].mobility.offsetHeading = 90deg
**.host[2].mobility.offsetHeading = -90deg
**.host[3].mobility.offsetHeading = 180deg
**.host[1..3].mobility.offsetX = 10m
**.host[1..3].mobility.offsetY = 0mAs you can see from ini file that I have tried Tractor, Linear and RandomWPMobility models but none of them work when I give some offset in X or Y direction to the attached nodes. If I assign offsetX = 0 and offsetY = 0, then all models work. Offset in Heading also runs without any errors. Only problem is that X, Y (Cartesian) offset gives error, in the visualizer module, when starting a simulation.
The error is this: `
<!> Invalid operation -- in module (inet::visualizer::MobilityCanvasVisualizer) adhocTractorAttachedNetwork.visualizer.mobilityVisualizer (id=11), at t=0s, event #0`
This error occurs after stage 13 initialization.
I have also gone through MobilityCanvassVisualizer class. It seems like the error occurs in refreshDisplay() function when the class tries to get the velocity values, more specifically at Line no 62 which is as following:
auto velocity = canvasProjection->computeCanvasPoint(mobility->getCurrentVelocity());
Another thing to note is that the first node which is following Tractor Mobility is initialized without any error. The problem occurs only when the first node with Attached Mobility is being initialized with X or Y offset.
If anybody knows how this can be solved or if I am doing something wrong then please tell me.
Thanks.