Added custom network port specification #96
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This follows up on: #56 (comment)
Note: this patch does NOT affect the default behavior of ardrone_driver; optional command-line arguments must be supplied to introduce the described behavior.
I've incorporated a solution for running multiple instances of ardrone_driver on a single computer. It is based on manually specifying custom ports for each instance of the ardrone_driver node and using iptables (root privileges required) to remap UDP packets en route to the standard ports on each quad. The options follow from the port names, e.g., -navdata-port, -video-port, and -at-port. As far as I can tell, these are the only three that need to be customized, but the other port numbers are also made into options for completeness.
To test: first, join the quads into a common network. Supposing two quads, q1 at 192.168.0.101 and q2 at 192.168.0.102, we choose to remap ports as follows:
q1: 5554 (quad) <-> 1554 (ardrone_driver), 5555 <-> 1555, 5556 <-> 1556
q2: 5554 (quad) <-> 2554 (ardrone_driver), 5555 <-> 2555, 5556 <-> 2556
The corresponding iptables commands would be:
q1:
q2:
Now, when running instances of ardrone_driver, add the following args strings:
q1:
q2:
More information as well as tools for automating wireless reconfiguration and port remapping are available here:
http://hacked10bits.blogspot.com/2014/02/multiple-ardrones-from-single-computer.html