-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Issues with Mavlink and GPS on Kakute f7 #13728
Comments
Hi
|
I'm guessing this is the problem. But how do I find out what the valid incoming and outgoing messages are? There is no hint to this on the messages page (https://mavlink.io/en/messages/common.html) or on the page for the kakute f7 (https://docs.px4.io/master/en/flight_controller/kakutef7.html). Are these messages then the same for all boards, or are some messages process on some FC and not on others? By adding a separate message you probably mean adding my own custom message in the Mavlink library?
Doing this returns with my current settings, with the Radio module on Telem1, the GPS module's output on Rx of Telem2 and my RC controller on pin R6:
It essentially tells me that the settings I entered were accepted. Also, the GCS is in fact able to communicate with the FC and heartbeat packets are not dropped all the time. As far as I know the connection between the two is good enough for now. This is also the confirmation that the data from the GPS module arrives on the FC and is at least readable for it. So unfortunately, I did not gain much new usable information from this. I also have a question to the Mavlink mode though. To me the description sounds like which messages are accepted and processed by the corresponding input. However, I found no documentation as to what these are exactly. How are mode "Normal" and "Onboard" different for example? |
The messages are independent from the board.
Yes.
You use it to test the connection between the stm32 and the FC.
It defines the set of outgoing messages, that are continuously streamed.
No, only one driver can run on a specific UART. See https://docs.px4.io/master/en/peripherals/serial_configuration.html. |
Ok, so today I looked at the firmware code to see where the incoming messages are being handled and which ones are accepted and which ones are ignored. What I found was under modules/mavlink/mavlink_receiver.cpp. In there I found that the following functions are being used to handle the messages: As far as I can tell, there is no message in there to give the raw GPS data in Mavlink format to the FC. Furthermore, it seems to me there is no way to configure it such that the FC either gets raw data from the sensors like it does now but in the form of Mavlink messages, which can be connected directly to Rx and Tx, OR that it gets filtered and processed data which tells it where it is exactly, also in the form of Mavlink.
In other words I have to connect it to QGC and see what messages are streamed between FC and QGC? But it does not change anything in terms of allowed incoming messages?
In conjunction with looking at the code of the GPS driver and the Mavlink receiver, it seems to me that the GPS is handled using regular GPS protocols, which would effectively mean that an external device to handle and fuse incoming sensors and gives global position values back to the FC (local positions seem to work using mocap and other messages) using the standard Mavlink library are not handled right now. In this case I can adjust what my stm32 sends to account for this. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
I'm currently trying to integrate a GPS module controlled by an stm32 onto my drone and make it communicate with the flight controller (holybro kakute f7) via Mavlink. To do this the stm32 will read and process all GPS data and send a Mavlink message, currently a GPS_RAW_INT message with message ID 24. (see discussion https://discuss.px4.io/t/what-mavlink-messages-are-used-for-the-gps-toolbar-indicator/7548)
The code to create and send a test message with baud rate 57600, 8bit message and 1 bit stop bit on the stm32 is the following:
When sniffing the serial output of the stm device baud rate 57600 I get something along the lines of the following hex output:
fd 1e 00 00 64 01 dc 18 00 00 60 c3 3f 01 00 00 00 00 64 00 00 00 64 00 00 00 ec ff ff ff 01 00 02 00 03 00 04 00 03 0a 52 fe
Decoding it shows me that it is the correct message, the serial port is also configured correctly, with the start being fd, sysid set as 1, compid at 220, and so forth. However, when attaching QGroundControl to my flight controller with the stm32 attached and sending shows no messages with ID 24 as incoming. The GPS indicator also shows no change.
The next step I took was analyzing the traffic between the flight controller and QGC. To do this I sniffed my serial in/outputs on the corresponding ports. The incoming packets (on my PC) looked like they corresponded to the Mavlink messages being sent by the flight controller to QGC, which were also the packets being shown in the Mavlink inspector widget. Analyzing the outgoing traffic showed me the following:
I haven't gotten around to deciphering that, but it only looks like a hearbeat message from the QGC to me, something which a flight controller would not NEED to operate by itself. Furthermore, when I try to manually arm the drone using QGC the command constantly gets rejected. There is no clear reason for this. The setting for disabling the requirement for GPS lock is set and I'm using a fresh battery. I will have to check each of the onboard sensors tomorrow to check if one of them is causing the issue, however to me it seems right now that the flight controller is not accepting Mavlink messages correctly right now.
Essentially I have two questions right now: Are Mavlink messages being randomly rejected by the flight controller, including command messages as well as GPS messages, and if that is not the case why does the flight controller not react to the incoming message from the stm32, giving it all the GPS information it needs. In that case, does the flight controller not listen to Mavlink messages but instead only to the NMEA protocol?
The text was updated successfully, but these errors were encountered: