Closed Kutbip closed 3 months ago
What about using MAVSDK-Java, but running multiple instances of MavsdkServer
? Say one that listens on UDP:14540, and one that listens on UDP:14541. Then your two drones should broadcast on 14540 and 14541 respectively.
I am personally not a big fan of having all the drones connecting to the app on 14540, to be honest. IMO, on the app side, it should be "one drone, one socket", and my suggestion above does exactly that :+1:.
Thanks for the quick reply @JonasVautherin. I understood what you explained however I have to connect the drone using a system id. (project requirement) Is there any way with mavsdk java? I am ready to use C++ in android but somehow I couldn't able to build it.
Is there any way with mavsdk java?
No, there isn't. We would need to discuss how we would want to expose that. I know that not everybody has the same opinion as I do, but I would push for doing what I suggested above, and if there was the need for a discovery protocol, I would do that separately, and not by sending everything on the same UDP port on the client :see_no_evil:.
We have used the same process that u suggest with simulate environment. We have used UDP port to communicate a drone with Gazebo simulator. We have created a mission from QGC and monitoring on our android app and controlling the mission like pause, resume and terminate. But For real environment or in production, we have to connect a drone with system id to monitoring active mission. In our application, we have to register drones and we will get a system id while registration. So we have to connect using that system id. @JonasVautherin
Do you have a fixed number of drones in the real environment, or do you have "n drones" and you don't know how many at build time?
@JonasVautherin Not a fixed number of drones but we have a max of 5-6 drones. Could you please share your thought on how it will work in a real environment?
Hello @JonasVautherin, Actually, we are new to this development so bit curious about how drone communication will work in a real environment. Till now we have used the simulated environment as I mentioned using the Gazebo simulator.
Not a fixed number of drones but we have a max of 5-6 drones.
The solutions I see (none of which is straightforward):
MavsdkServer
instance for each droneMavsdkServer
instance for eachHello @JonasVautherin, Thanks for the solutions. We have considered #3. I have successfully created a C++ build (.so file) for Android to use. Could you please provide any reference that can help me to use C++ MAV SDK classes to use in Android.? Which class or functions should I use to connect drones with system id and set the actions. Appriciate your help..!!!!
Hello Everyone,
I am using MAVSDK-Java to monitoring drones. Currently, MAVSDK java only exposes to connect drones using UDP or TCP which is working perfectly. Now, to connect with multiple drones, the app requires connecting using the system id which I am not able to do.
Later I came to know that the C++ library can do the task. I have tried to build a C++ library here to use with Android, but I can't make a build due to some errors. followed as per the documentation.
So the questions are
FYR: @JonasVautherin @julianoes