-
Notifications
You must be signed in to change notification settings - Fork 46
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
How to use MAVSDK-Java #129
Comments
Did you check the README and the examples? |
Yes, I have seen READMe but I tried it , I have downloaded libmavsdk, I'mnot understanding how to run MAVSDK server, So, please help me with this issue. After some research, I have successfully added the Mavsdk dependencies to my Maven project. I have included all the necessary dependencies, and now I would like to know how to initiate a takeoff from my code |
@JoshikaNetha, MAVSDK is divided into two parts, the MAVSDK-Server and the MAVSDK frontend, which in your case is MAVSDK-Java. Now, for your web application, you can download the MAVSDK-Server binary from the MAVSDK-Releases. You'll have to choose one according to the machine on which your web application is running. Then you can run the MAVSDK-Server like this: ./mavsdk-server-binary udp://:8240 -p 9000 The first argument is the address to which the MAVSDK-Server should listen for MAVLink packets from your drone. There are several interfaces provided by MAVSDK:
The second argument In MAVSDK-Java we do it using the System system = new System(address, port) In the above example, if the MAVSDK-Server is running on the same machine as MAVSDK-Java, the |
Thanks for response. As you said I tried to build mavsdk-server from source file and from release, but its showing some error it not building successfully. From Release , I have downloaded
From Source, I have followed steps mentioned in this:
After running below command:
Error is:
I have followed Building MAVSDK Library from Source steps also. but not working . Please help me with this issue. |
@JoshikaNetha No need to build the mavsdk-server. You can simply download the binary from the assets on the release page. For example, if you have a Windows machine, you can download |
I have downloaded mavsdk-binary file as I'm working on ubuntu I have downloaded .deb file, then I have gave execution permission.
I'm getting above error. |
Please try mavsdk_server_manylinux2010-x64. |
Thanks so much It running successfully but, I'm running make px4_sitl gazebo in same system. In my Java Code I have written as below:
I have added all the dependencies in pom.xml as below:
Here, I'm running Maven Project as Maven build , I'm getting below error: [``` [ERROR] To see the full stack trace of the errors, re-run Maven with the �[1m-e�[m switch.
|
Try running the TakeoffAndLand.java example with the correct address and port. |
Also, you only need to add the mavsdk dependency. No need to add the grpc and rxjava ones. |
I tried to run TakeOffAndLand.java code I have mentioned
`
|
Looks like a build problem. Are you not using a build system like Gradle? For big projects with several dependencies, we should try not to use If you have IntelliJ installed on your system, you can simply open this project and run the TakeoffAndLand test. |
Hi ,@divyanshupundir . madhavanenisannith@nhhydl-00271:~/Desktop/Workspace/MAVSDK-Java/examples/java-client$ ./gradlew clean build
FAILURE: Build failed with an exception.
BUILD FAILED in 397ms Previously i got an other error "cannot find tools.jar" , i resolved it , then i got this error. Can you please help? |
This is more of a problem with the project and Java setup than MAVSDK. It looks like Gradle isn't able to find that Java compiler on your machine. An easy way you can fix it is by opening the project in IntelliJ Idea and it will install all the required dependencies. You can then even run the tests directly from it. Otherwise, you can follow this StackOverflow answer. |
Hi,
"I'm new to Mavsdk-Java , and I've successfully used Mavsdk in Python. However, I'm now interested in using it in Java. Could someone kindly assist me in utilizing Mavsdk in Java?
I would like to integrate Mavsdk-Java into my Java web application. Can anyone provide suggestions on how to integrate the necessary dependencies and incorporate Mavsdk-Java within a Java web application.
Thanks in advance.
The text was updated successfully, but these errors were encountered: