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
Sending commands to vehicle with specific mav_sys_id #226
Comments
Thanks for the question. I hope we can get back to you soon. |
Yes, that's exactly what the code should be doing. You do: await drone1.action.arm()
await drone1.action.takeoff()
await asyncio.sleep(5)
await drone1.action.land() Which is asking drone1 to arm, takeoff and land 5 seconds later. If you want both drones to do that, you should do something like: await drone1.action.arm()
await drone2.action.arm()
await drone1.action.takeoff()
await drone2.action.takeoff()
await asyncio.sleep(5)
await drone1.action.land()
await drone2.action.land() Does that make sense? |
Hey, firstly, thank you for your responses. I am sorry, I just notice that I sent screenshot with missing part. Below this piece of code, I already did same commands for drone2. Problem in here as i said, UUID's of both device seen same and even though I am giving commands to drone2, system sends it to the drone1. Because it thinks that they are same device in my opinion.
As I stated here, I am using docker image that pushed to github by you -which really helped me to run SITL on my device- and when I am running twice this docker image in 2 terminals, they are having same UUID and this leads to misunderstanding from mavlink side as I understand. I don't know if I could express my problem but I hope I did. Thank you for your answer again, have a nice day. |
The UUID is an issue if both run on the same UDP connection. But that's not your case here: because you run two instances of
Then, in the python code, you need to connect the two drone1 = System(mavsdk_server_address="localhost", port=50050)
await drone1.connect()
drone2 = System(mavsdk_server_address="localhost", port=50051)
await drone2.connect() Finally, you need your two SITL instances to broadcast on a different port. One on 14540 (drone1), and the other one on 14541 (drone2). My |
Hi,
I am trying to control multiple vehicles which works in SITL (with docker on MacOS) that stated in with . After I am starting 2 vehicles in SITL, I am changing MAV_SYS_ID parameter and output port of one of them. I know that MAVSDK-Python works with MAVLINK protocol but is there any chance to control vehicle with specific MAV_SYS_ID? I am asking this because, both of my vehicles have same UUID. You can see my code example attached and it is slightly different from example file named "takeoff_and_land.py"
.
In this example of code, when I run it, both devices seen connected but arm and takeoff commands only given for first written device. I searched for answer in this Issues section but i couldn't find anything related. I examine source files but I couldn't find the place where I should change. Only there is an issue #102 but it is not done yet as I understood.
If any other suggestions to work this system, I am open for that either.
Thank you for your answer, have a nice day.
The text was updated successfully, but these errors were encountered: