AnimationInterface WARNING:Node:0 Does not have a mobility model. Use SetConstantPosition if it is stationary ; while adding NetAnim to rip-simple-network.cc

2,195 views
Skip to first unread message

h201...@pilani.bits-pilani.ac.in

unread,
Sep 21, 2017, 1:34:29 PM9/21/17
to ns-3-users
I intended to generate animation file for an example given in NS3 routing module (rip-simple-network.cc). I have added following snippet to the code just before the Simulator::Run() statement:

AnimationInterface anim(animationFile);
anim.SetConstantPosition(src, 0 , 0);
anim.SetConstantPosition(a, 1 , 1);
anim.SetConstantPosition(b, 1 , 3);
anim.SetConstantPosition(c, 2 , 2);
anim.SetConstantPosition(d, 3 , 3);
anim.SetConstantPosition(dst, 3 , 4);

**included the netanim-module.h

Now while running this simulation following warnings are generated:

AnimationInterface WARNING:Node:0 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:1 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:2 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:3 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:4 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:5 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:0 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:1 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:2 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:3 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:4 Does not have a mobility model. Use SetConstantPosition if it is stationary
AnimationInterface WARNING:Node:5 Does not have a mobility model. Use SetConstantPosition if it is stationary


loading animation file on netanim shows crazy things, only two nodes and no links etc.

can somebody please help on this topic?

PS: I am new to NS3

 

Konstantinos

unread,
Sep 22, 2017, 4:10:29 AM9/22/17
to ns-3-users
Hi,

It looks liek you have NOT installed a mobility model on the nodes. Setting the positiong of a node using NetAnim API is NOT the same as installing a mobility model. 
Please have a look at the tutorials and documentatiion on how to use a MobilityModel.

Regards
K

h201...@pilani.bits-pilani.ac.in

unread,
Sep 22, 2017, 5:48:48 AM9/22/17
to ns-3-users
Hi konstantinos,

Thanks for the reply. I have taken the attached file as a reference for adding netanim code tcp-net.cc. Could you please take a glance and suggest where the mobility model is set in this file? This script is working fine and generating animation .xml file.

Also attaching problematic script which i modified from examples (rip-simple-network.cc).

Before posting the query I have already tried adding mobility model to each node in rip-simple-network.cc using mobility-helper.


regards

Rachit Phartiyal
rip-simple-network.cc
tcp-net.cc

Konstantinos

unread,
Sep 22, 2017, 7:05:53 AM9/22/17
to ns-3-users
As I said, the recommended method of installing a mobility model is with a mobility helper where you specify the PositionAllocator, ie the initial positions, and the MobilityModel, ie how the nodes move or don't move. 

There is no mobility installed in the tcp-net.cc and it should also generate a Warning as in the first message. But in any case, both are simple warnings, the XML file should be generated.
Reply all
Reply to author
Forward
0 new messages