Hi all,
I am attempting to achieve indoor autonomous flight using only MAVLink messages (sent over 3DR Radio Telemetry) from a ground control station on my laptop that is written in JAVA.
I am a newby to MAVLink messages and so am stuck on the very basics of forming the MAVLink message. (I have read the MAVLink dummies guide and am still stuck.)
I have been using the MAVLink implementation classes from this repository on Github: https://github.com/jdye64/MAVLink-Java, but can't get the commands i am sending to the Pixhawk to be recognized.
For example; in attempting to send the ARM command (MAV CMD #400) with the COMMAND_LONG message (#76) this is my byte array (in integers) i am attempting to send to the com port:
254 33 0 255 190 76 0 0 128 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 144 1 100 1 0 138 253
Is there anything obviously wrong with this message?
I am not sure the sys IDs and component IDs for the sending and target either? How does one identify the correct sys ID, comp ID (of the SENDING SYSTEM).. and for the command_long messages the target system, and target component (of the TARGET)?
Any help with MAVLink message forming (or simple testing hints to make sure our pixhawk is receiving the MAVLink commands we are sending) would be great!
Thanks, Baden
Replies
Sending a message from the GCS to the pixhawk:
I have set the sys ID = 255, comp ID = 190, target ID = 1, and target comp = 0.
I believe this should work for a command_long message with the ARM command.
This leaves me assuming something is wrong with the actual message format (use of MAVLink protocol - which is formed by the MAVLink implementation classes that i found on Github - given above), OR incorrectly sending the message buffer over serial byte by byte (I am using a serial repository also downloaded from gitub: https://github.com/scream3r/java-simple-serial-connector.)
I am noticing the message is being sent as the telemetry flashes when i run the code.
Has anyone got any tips to try and solve my issue with the Pixhawk not responding?
Thanks again!
Hey Baden, have you made any headway on this? I am also struggling to send messages to my Pixhawk (running ardupilot software). I outlined what I am doing in this post if you want to take a look: http://diydrones.com/forum/topics/custom-hil-program-with-ros-gazeb....
Let me know if you figure anything out and I will do the same. I am really beating my head against the wall trying to get my solution to work...