Error in IntegrationCanvassVisualizer when using Attached Mobility with Tractor/Linear/RWP Mobility

30 views
Skip to first unread message

anas muslim

unread,
Jun 4, 2018, 9:47:25 AM6/4/18
to OMNeT++ Users
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 = 0m


As 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.

Levente Mészáros

unread,
Jun 4, 2018, 10:10:16 AM6/4/18
to omn...@googlegroups.com
I think this has been fixed since the last 3.99-3 in the INET integration branch. This error occurs because the visualizer wants display the velocity as a vector. For an AttachedMobility model which has both offsetX and offsetHeading the angular velocity of the referred model is also needed. This was not implemented in the last released version.

Could you try the latest integration branch and report back if the problem still persists?

Regards,
levy

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at https://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

anas muslim

unread,
Jun 4, 2018, 10:46:45 AM6/4/18
to OMNeT++ Users
Thank you Levy for replying and for the help.

You are right. I have checked the latest integration branch and the problem is now resolved.

Thanks alot.

--
Regards,
Anas
Reply all
Reply to author
Forward
0 new messages