-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a single communication link for several vehicles #516
Comments
In my setup, several vehicles communicate on the same network. As a test, I started two simulated drones (respectively sysid 1 and 2) on my computer, both sending messages to udp:127.0.0.1:14550. Then I created a vehicle object in dronekit:
All the Vehicle methods decorated by the |
I partially solved the problem by:
I could create a vehicle like this
And it only received messages from the drone with sysid 1, which is what we want, great! However if then I create a second vehicle object:
Then the link to the first drone is lost. This comes down to Maybe the |
Hi @jlecoeur What you're doing here is not talking to two separate drones - but talking to one drone twice from separate vehicle instances on the same port. This is possible but largely pointless since you will run into issues with synchronizing the two handles to the one vehicle. If you needed to make this work you would keep the the target system the same in both cases (since this is the ID of the drone on the mavlink network) and you "might" change your source id. What I think you actually want to do is talk to two separate drones. To do this you need to attached to a real or simulated drone on a different port. I believe this can be done by passing a value to sim_vehicle.sh when you launch SITL. The help options to that script should help you work out which. |
Hi, Indeed I want to talk to several drones. |
hey @jlecoeur can you please write a test case that proves your issue? |
Sure! Here is a testcase using 2 simulated mavric autopilots:
What it does:
After MAV2 is started, dronekit accepts the 'PARAM_VALUE' message from MAV2, and the parameter is set to 0.0 in the dronekit object, although it is still equal to 1.0 onboard MAV1. |
@hamishwillee @mrpollo any update on this? |
@jlecoeur Not as far as I know. Working on other priorities. @peterbarker , do have time in the coming weeks to look at this? |
I agree this is an issue. We should be able to speak to multiple vehicles using a single connection. It's normal for an antenna tracker and vehicle to appear to be on the same connection from dronekit's point of view. The vehicles can be distinguished by their sysid/component-id combination. |
My two bits
|
I hit this problem again today in a more common situation. I'm using dronekit on a companion computer and the vehicle.mode is switching between the vehicle's actual mode (Guided, Loiter, etc) to Stabilize. the reason is that I have Mission Planner attached as well and it's sending heartbeats which include the flight mode. Of course mission planner's flight mode is not what I want! :-) |
Very annoying. At least for things like mode setting we really need to check that the source is our connected vehicle. @peterbarker do you want me to take this issue over. I can look probably fix it early next week. |
Rough instructions for multiivehicle support in dronekit-python: https://github.com/peterbarker/dronekit-python/tree/source-system-filtering/examples/multivehicle |
So, this is a side note, but @jlecoeur if you are using the xbee network, then I think you can filter your messages for separate vehicles based on their MAC address/IP address depending on the type of xbees you are using. This should help you to alleviate any issues with the dronekit-python library and allow you to communicate with multiple vehicles at one time. |
Hi, are there any plans to merge @peterbarker 's solution into master? |
Hello, has there been any progress on this? Any plans for the merge of @peterbarker 's stuff? Thanks! |
@peterbarker, actually in your example of multivehicles, simple_go_to message is executed by every drone no matter which vehicle[i] is given |
@peterbarker , I had ran all the commands until the last command in step 5: This gave an error below. Could you provide some insight on this? I had already tried adding 'PYTHONPATH' for the pymavlink folder in addition to the dronekit-python folder. But this did not help the multi-vehicle example to work. |
On Mon, 8 Oct 2018, ajaiRevision wrote:
I had ran all the commands until the last command in step 5:
python multivehicle.py --simulation-count 3 --extra-connection udpout:localhost:9432
This gave an error below. Could you provide some insight on this?
Wrong pymavlink; try setting PYTHONPATH to point to the relevant git
repository, checked out on the correct branch.
Peter
|
It's very disappointing dronekit not having a multi-vehicle protocol. There is a lot of research that uses microdrone swarms that could use this feature. I hope you have time to add this feature soon. |
@peterbarker |
Hi, I have a very minor issue that hopefully someone will be able to solve. I'm following the instructions on the ReadMe page for the github site Peter Barker posted with his example code, https://github.com/peterbarker/dronekit-python/tree/source-system-filtering/examples/multivehicle. On step 1, I typed this line into my terminal "git checkout peterbarker/source-system-filtering" and I received an error message saying that I don't have access to this repository. Anyone know what I'm doing wrong? |
I tried the @peterbarker repo but I got errors. Is there any way to use a single commnication link for several vehicles ? |
Also having problems while following the instructions, idk if already having dronekit and pymavlink installed though pip is affecting the process |
It seems DroneKit promotes one link per vehicle and does not work well when more than one vehicle send messages on the same link.
What is the best way to proceed?
The text was updated successfully, but these errors were encountered: