mobility: lr-wpan: MobilityHelper causes received signals to be wrong in lr-wpan nodes
This problem has been there for a while.
In a simulation ,if nodes mobility using a mobilityHelper is set **after **the channel assignation/PropagationLossModel/DelaySetup, the received signal (strength) will be null in all the receiving nodes in a lr-wpan module. The node will still receive the packet which makes this problem even harder to spot.
An attached file demonstrates the issue. MobilityIssue.cc. A beacon is broadcasted to nearby nodes. All nodes are set with different distances, therefore receiving the beacon with different signal strengths.
At first, you might be tempted to think " well, just set the mobility before the channel and the propagation models" which yes, it would fix the problem. But setting the mobility after is an easy mistake and the order in which you set the mobility should not be an issue, in particular since the constant mobility is being set and the problem is not present if mobility is set without mobilityHelper.
I tested it with GridPositionAllocator/ConstantPositionMobility model, however, this bug is potentially present in any other mobility set by the mobilityHelper.
Believe me, when I tell you, this was the source of a lot of frustration.