-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Loss of MAVLink transmission when enabling joystick #9022
Comments
Does that happen on SITL as well? Would be way easier to debug there. |
I can confirm this issue. How can I test it on SITL? |
The PX4 Dev guide has instructions on how to setup and use PX4 SITL. |
I remember explicitly testing against SITL and not seeing the issue. I could repeat the test to make sure you're not trying to reproduce something that already got fixed. Presumably, there were some changes in USB communication. |
Hi, stumbled on something pretty similar. My research found that no matter of PX4 version (1.10.x, 1.11.x, on Pixhawk 2 Clone and Holybro Kakute F7) and QGC (stable or daily, windows or linux version - todays downloads). But when using UDP communication: |
Maybe it's related to #9484 |
Hi Everyone I have encountered too that issue with same configuration (QGC V4.1.1 Stable). I realized that it is related to new approach writeBytesThreadSafe function in LinkInterface. When Joystick connect to QGC, a new QThread starts. Then it begans to send manual control messages using SerialLink. After Joystick Thread use the QSerialPort::write function, sending mavlink messages stopped and The Link behaves like High Latency Link. I think it is about to thread safety or thread affinity somehow. Because of this, undesired behaivour is emerging. On SITL with UDP Link , there is no issue. There was no problem in old versions of QGC (for example V3.5). I changed the function with old version writeBytes function then it worked correctly. I hope it helps. |
Would you be so kind and give instructions on how to change linkinterface? |
No, it works fine with the SITL. |
1- You have to add this line to LinkInterface.h file signal section void _invokeWriteBytes(QByteArray); 2- Connect this signal to _writeBytes virtual function in LinkInterface constructor QObject::connect(this, &LinkInterface::_invokeWriteBytes, this, &LinkInterface::_writeBytes); 3- Change writeBytesThreadSafe function with this: void LinkInterface::writeBytesThreadSafe(const char *bytes, int length) It should work. Note: I do not claim that this is the best solution. I'm working on it. But I'm sure it's about SerialLink not UDPLink. It occurs when Joystick and SerialLink Threads work together. |
Has someone tested it? |
I had a similiar issue. However I should note that I am using a Custom build. @hknaio s solution solved it for me. Did not tested it extensively tough |
I am running into a similar issue with joystick and TCP connection. |
Perhaps related to PX4/PX4-Autopilot#18054 |
Running QGC 4.1.4 daily from the linux command line gives me |
The problem is this pull: #8835 doesn't work with serial and tcp links. it works fine with UDP links. The reason being that the QIODevice::write happens on the wrong thread. Now the question is whether there is away to get the improved perf while getting things on the right thread. |
New daily builds with this fix should be available for download in about an hour. Can folks verify this fix works? |
I'll reopen if someone verifies this fix didn't work |
Hello, is this feature fixed in the master branch? |
Presumably, I can't test because I can't get the daily build because of #9946 |
Expected Behavior
Gamepad style joystick when calibrated and activated provides manual control stick input to the autopilot and doesn't interfere with other functionality.
Current Behavior
When I have a Joystick (Microsoft XBox 360 controller I'm always using) connected, calibrated (tried recalibration) and activated (doesn't happen when the gamepad is connected but the checkbox is off since QGC start) that MAVLink transmission stops working. As soon as I'm once in this state no command gets sent anymore (I tried mode switch, parameter request, reboot, arm), MAVLink shell doesn't react anymore and when I start QGC in this state the "Vehicle 1 did not react to parameter request" message gets shown. Only solved by unplugging or disabling the joystick device and restarting QGC.
Steps to Reproduce:
System Information
Operating System: Verified the same behavior on Windows 10 and Manjaro Linux VM
QGC Version:
QGC build: Downloaded from https://docs.qgroundcontrol.com/master/en/releases/daily_builds.html
Flight Controller: Pixhawk 4 mini
Autopilot (with version): PX4 latest master (PX4/PX4-Autopilot@979243f)
Misc Context
I was testing calibration and noticed I have manual control lost at the end of every calibration: PX4/PX4-Autopilot#15235 (comment) and wanted to check if with a real instead of virtual joystick I'll have the same problem.
The text was updated successfully, but these errors were encountered: