-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Virtual Joystick not working #10664
Comments
I think I am seeing the same issue as this: Some more information from my testing: I have compared the operation of the above daily build to the latest stable QGC V4.2.8. In both cases, I ensured all settings were as default, then enabled the virtual joystick. |
This might be connected to issue with multivehicle joystick control problem. I mean somewhere with handling joystick, not regarding amount of vehicles. Can you also check for sim of two vehicles and try to control them with joystick? |
@zdanek I will test both those things tomorrow. I presume you are referring to #10544? Today I started bisecting where the issue arose. But I will finish bisecting tommorow and then test with a bluetooth gamepad as well as test multi vehicle. |
Yes. I was referring #10544
Thanks, I'm on my smartphone.
Thank you for your support.
Zdanek
śr., 19 lip 2023, 11:57 użytkownik James Mare ***@***.***>
napisał:
… @zdanek <https://github.com/zdanek> I will test both those things
tomorrow. I presume you are referring to #10544
<#10544>?
Today I started bisecting where the issue arose.
So far I have narrowed it down to:
1b53ed3
<1b53ed3>
bad
afc1f52
<afc1f52>
good
This means that none of the code in the joystick folder has changed since
it was last working - which suggests the issue is in the vehicle code.
But I will finish bisecting tommorow and then test with a bluetooth
gamepad as well as test multi vehicle.
—
Reply to this email directly, view it on GitHub
<#10664 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADLSJS324TOC77ZQQCLEHLXQ6VSFANCNFSM6AAAAAAXF4RQZY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I finished bisecting and found the first commit at which the virtual joystick doesn't work commit 434e76a
|
Here are the results of my investigations on this issue:
However, this enables the joystick even if there is no joystick configured or enabled which causes the following code to fail, because _joystickEnabled is now true when it should be false:
The simplest fix for this is a check in Vehicle::setJoystickEnabled to avoid enabling the Joystick if none are connected. I have tested this fix with multi vehicles and virtual joysticks, and it fixes the problem.
An interesting edge case appears to be what happens if there is a joystick connected but is uncalibrated. So we have a recursive call to setJoystickEnabled (but will only call recursively once) This affects the fix in #10544 Edit: I have not yet tested this with a real joystick, I will try and test that tomorrow, forgot to bring my joystick to work today. |
@vorobotics, no problem. I agree that the logic is confusing. Now that I've been deep in this joystick code for a couple of days, I think the following issues are adding surface area for bugs.
I would make the following suggestions, and I would be willing to put work in on either coding or testing as needed.
|
@JMare this is a great insight. I'd love to cooperate to fix those issues. My goal at first is to make joystick work with multiple vehicles through one connection. It seems that this is seriously broken. Affects both SITL sim and real connection (one physical com that handles many remote devices). This makes QGC unusable when need to control a few drones, by joystick, through single physical connection (my case). Next I'd love to engage more and make some rework of joystick code, exactly as you described. Especially, to pass virtual joystick through the same "out channel". Otherwise it can be messy. |
Sounds like a good plan - maybe once we have fixed these issues we can make a new issue to discuss reworking some things. |
Expected Behavior
On a PX4 simulation (gazebo classic) manual input is possible using virtual joystick.
Current Behavior
Even if virtual joystick is enabled in QGC and
RC_COM_IN_MODE
is set toJoystick only
, PX4 does not detect any manual control inputSteps to Reproduce:
Please provide an unambiguous set of steps to reproduce the current behavior
RC_COM_IN_MODE
is set toJoystick only
System Information
When posting bug reports, include the following information
main
branch, and PX4v1.13.3
Detailed Description
QGC v4.2.6 stable version works as expected.
Log Files and Screenshots
Virtual Joystick is present but still No manual control input.
COM_RC_IN_MODE
is set to Joystick only.The text was updated successfully, but these errors were encountered: