how to make a node move in a constant speed

9 views
Skip to first unread message

Xiaofei Ma

unread,
Mar 24, 2012, 5:22:25 PM3/24/12
to eel65...@googlegroups.com
Hi:

In my project, I need to make a base station travel in a constant speed across a wifi network. For a stationary node, we can use MobilityHelper Class to define a helper and then install on the node. But which class should I use to define a moving node? There is a class called ConstantVelocityHelper, but it seems there is even no install method in this class, so how can I use this class?

Thank you.
Xiaofei

Gokul Bhat

unread,
Mar 24, 2012, 5:28:00 PM3/24/12
to eel65...@googlegroups.com
Form a different node container for the base station and use the mobility helper. While instantiating the mobility helper, pass constant velocity helper as the type of mobility model to be used and then install it on the node. It should work.

shivani agrawal

unread,
Apr 11, 2012, 2:06:40 AM4/11/12
to EEL 6591
Hi,

I have a similar case, but along with constant velocity, i need to
define the trajectory of my node.. ie it has to move circularly...
But i failed to find any class where i can define the path i want my
node to follow...
How can i do this?

Thanks
Shivani Agrawal

shivani agrawal

unread,
Apr 11, 2012, 4:28:31 AM4/11/12
to EEL 6591
I see that using Config::Connect ("/NodeList/*/$ns3::MobilityModel/
CourseChange", MakeCallback (&CourseChange)); can help, but in all the
examples i have seen, the function CourseChange is printing the course
values and is not defining the course/trajectory...
would anyone be able to help me out here, also tell the control flow
for hw it works....

Gokul Bhat

unread,
Apr 11, 2012, 11:07:56 AM4/11/12
to eel65...@googlegroups.com
Course change is only used as a read-only function. You can not use to change the way the node moves. It is used as one of the parameters for tracing. Moving the nodes in a circular manner is an interesting problem to deal with. You will need to design a mobility model that moves the nodes along a circle. If you are really interested, check the tutorials folder in examples. There is an implementation of moving nodes every instant to a custom position based on the present  coordinates passed in one of the files, I don't remember which one, though!
What control flow are you talking about here?
Reply all
Reply to author
Forward
0 new messages