Search code examples
omnet++inet

Is "initialMovementHeading" limited in any way or can I just pick up to 360° direction? Can it be a bug?


I'm adding a couple of hosts on a map. I'd like to move one of them in direction e.g. -30° so I tested the function with 330° but it's only moving on the upper semi-plane considering [0°, 180°] the horizon. When I set 200°, 270°, etc I see the host moving in the upper direction, different degrees. I looked into the classes and found in "inet/mobility/single/LinearMobility.cc" the method that I think handles the parameter.

https://github.com/inet-framework/inet/blob/master/src/inet/mobility/single/LinearMobility.cc

Following this tutorial: https://www.youtube.com/watch?v=9xDqjRd1DpA&list=PLaBPUIXZ8s4AwAk5EelikvvyG4EzX2hpx&index=5&t=181s

I also tried negative speed hoping to outsmart the problem but nothing. Any hint? Did I just get wrong the function?

Thanks in advance.


Solution

  • It is not limited, you can pick any direction.

    The angle is measured from the X axis clockwise (so 0 degree is to the right, 90 deg is downwards, 180 deg to the left, 270 deg upwards).

    So in this sense, movement with any angle between 180 and 360 would be in the upper plane.