Attached Mobility implementation

99 views
Skip to first unread message

bruno vieira

unread,
Apr 22, 2019, 1:05:53 PM4/22/19
to OMNeT++ Users
Dear all,

I'm trying to implement a AttachedMobility model on my simulation environment, the goal is to have 4 nodes(host) all moving accordingly to another one(master). Reading this mobility type documentation, I came up with this .ned lines:

**.host[*].mobilityType = "AttachedMobility"
**.host[*].mobility.subjectModule = "World.master[0].mobility"
**.host[0].mobility.offsetX = -0.5m
**.host[1].mobility.offsetX = 0.5m
**.host[2].mobility.offsetX = 0.5m
**.host[3].mobility.offsetX = -0.5m

**.host[0].mobility.offsetY = -2.0m
**.host[1].mobility.offsetY = -2.0m
**.host[2].mobility.offsetY = 2.0m
**.host[3].mobility.offsetY = 2.0m

Am I missing something? When trying to launch my simulation,I get the following error:

Mobility position is not a finite number after initialize (x=-nan,y=-nan,z=-nan) -- in module (inet::AttachedMobility) World.host[0].mobility (id=9), during network initialization


I can't seem to be able to notice what is the problem here... Can the mobility type of the "master" node be relevante for this?


Hope you can help me.

Best regards,

Bruno Vieira

Levente Mészáros

unread,
Apr 23, 2019, 4:43:00 AM4/23/19
to OMNeT++ Discussion List
You should set the mobilityModule parameter of AttachedMobility instead of the subjectModule parameter of MobilityBase. Take a look at https://inet.omnetpp.org/docs/showcases/mobility/combining/doc/index.html

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.

bruno vieira

unread,
Apr 23, 2019, 5:11:09 AM4/23/19
to OMNeT++ Users
Thank you for the help, and providing that reference! However, I updated my lines into this:

**.master[*].mobilityType = "LinearMobility"
**.master[*].mobility.updateinterval = 0.05s
**.master[0].mobility.initialX = 1.50m
**.master[0].mobility.initialY = 3.00m
**.master[0].mobility.initialZ = 1.49m
**.master[0].mobility.initFromDisplayString = false
**.master*.mobility.angle = 90deg
**.master*.mobility.initialMovementElevation = 0deg
**.master*.mobility.speed = 8mps

**.host[*].mobility.typename = "AttachedMobility"
**.host[*].mobility.mobilityModule = "^.^.master[0].mobility"

**.host[0].mobility.offsetX = -0.5m
**.host[1].mobility.offsetX = 0.5m
**.host[2].mobility.offsetX = 0.5m
**.host[3].mobility.offsetX = -0.5m

**.host[0].mobility.offsetY = -2.0m
**.host[1].mobility.offsetY = -2.0m
**.host[2].mobility.offsetY = 2.0m
**.host[3].mobility.offsetY = 2.0m

And the simulation runs as supposed, however hosts[0-3] don't move at all... while the master has the expected behaviour of the LinearMobility implemented.
Take in notice, that I'm actually using INET's 3.99.3 version, which is required for the rest of the simulation environment.

Best regards,
Bruno Vieira
To unsubscribe from this group and stop receiving emails from it, send an email to omn...@googlegroups.com.

bruno vieira

unread,
Apr 23, 2019, 5:46:14 AM4/23/19
to OMNeT++ Users
Actually, using the previous code, the simulation crashes with the error:

Mobility position is not a finite number after initialize (x=-nan,y=-nan,z=-nan) -- in module (inet::AttachedMobility) World.host[0].mobility (id=9), during network initialization


It wasn't crashing previously because I was manually inserting their initialXYZ.

P.S: I have to set the hosts mobilitytype like: **.host[*].mobilityType = "AttachedMobility". Either way, the type doesn't get properly defined, must be a change regarding my INET version in use.

Reply all
Reply to author
Forward
0 new messages