Hi all,

I am new here and a beginner. Currently I am trying to write a Java program which can be used to:

1. communicate with a GCS e.g. Mission Planner via UDP.

2.when data is received by this Java program, save the data as XML file.

3...

..

And I am now stuck in the first step.. :s  My idea is that:

The Java program needs to first connect with Mission Planner, see

3691056546?profile=original

when press the CONNECT button, does Mission Planner sends out UDP packages? I guess the answer is NO since I have wrote a small piece of code to receive UDP package from port 49000 (is it right?) and it just received nothing.

So, I think my next move is to let the Java program sending UDP packages to Mission Planner in order to establish the CONNECTION. The communication is based on the MAVLINK protocol, and data is normally organized as STRUCT in c/c++. However, I am a bit confused that how should I write the messages in Java? What kind of format shall I use? Can I use a class to organize all the variables and then send data in class format via UDP to Mission Planner?

To make things simple, my questions are basically:

1. how can I establish the CONNECTION between my Java program and Mission Planner via UDP?

2. how shall I organize my message (variables) based on mavlink in my Java program? (so Mission Planner can show the corresponding sensor data etc.)

(ps: no hardware involved!)

Thank you and I am very appreciated for your help!

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer

    typicly mavlink devices send data all the time. so MP expects data to be coming in on the port selected. you can send any packet to MP, but idealy to connect MP need to see heartbeat packets as well as send and receive the parameter packets.

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…