mavlink / qgroundcontrol

Cross-platform ground control station for drones (Android, iOS, Mac OS, Linux, Windows)
http://qgroundcontrol.io
3.22k stars 3.55k forks source link

Joystick support overhaul #10632

Open AGSBurei opened 1 year ago

AGSBurei commented 1 year ago

Tell us a bit about the feature:

The issue is the current system is only allowing to bind joystick that handle at least 4 axis in one device. However most of current modern consumer HOTAS, (also HOSAS,etc ...) system are now using separate peripheral such as Thrustmaster warthog, etc... to handle various tasks without removing hands of controls.

If its a stick it will handle up to 3 axis and throttle up to 2 while ignoring aditional input such as ministick, button, castle switch, etc...

Due to that observation the current joystick implementation feel a bit outdated while looking at new peripheral options that are in my opinion way more efficient to use for manual handling of sensors/vehicles to me than regular radio system.

What problem does it solve?:

An overhaul of joysticks handling to map X number of peripherals inputs to fulfil X tasks or use X axis will improve vehicle manual handling. Where regular radio system will be limited, being a smaller packages.

For exemple: It will allow to fly a drone while operating a gimbal camera with a mini joystick or multi way switch, and zoom with dedicated button or axis with both hands.

Where radio emitter will force an operator to drop flights controls, degrade sticks handling, change mode to operate other controls.

It will also favorise the development of sepecifc controls setup for a vehicle.

What flight stacks must it work with? (All, PX4, ArduPilot)

This overhaul will benifit every flight stack

Relevant vehicle types? (All, multirotor, fixed-wing, VTOL, submarine, etc.)

This overhaul will benefit every vehicule

Are there other systems that have this feature?

QGC is my only GCS option, i don't really know. Software that allow the maping of virtual joysticks exist but out of the box solution is way cleaner and will always be usable depending the GCS OS

zdanek commented 1 year ago

I'm interested in this feature.

booo commented 1 year ago

Are you able to contribute such a overhaul some time soon?

The resources of our small developer community are quite limited. Don't expect to many complex feature requests to be dealt with. We are happy to give you directions if you want to tackle the problem.

AGSBurei commented 1 year ago

I have planned to dig a bit on the subject indeed,

but i need to finish my vehicle for a keynote first (school stuff). Which is quite time consuming already since i'm alone on it.

There was a plan for it in my workgroup at the beginning of my project but they were lost through QGC source code

So i was going to do it myself once i have settled my vehicle .

AGSBurei commented 1 year ago

Ok, I'm done with the school stuff. I'm going to dive into the subject, which files and folders should i give a look ? (excepted /src/Joystick)

EDIT: lets begin with the basics how the joystick tab work on the code part ? I'have already settup the tool chain (i'm digging in the meantime and also work on interfaces sketchs)

AGSBurei commented 1 year ago

I'have made a quick photoshop sketch on which kind of change i would like to make before reverse engineering the code what do you guys think about it ?

QgroundControl joytick sketch general QgroundControl joytick sketch peripheral QgroundControl joytick sketch axis button assign QgroundControl joytick sketch axis button assign 2

ghost commented 1 year ago

The photoshop sketch works well, I think that the second implementation of the second sketch is more easily understandable. Please do continue to work on this feature, I have just found this issue today, and it would be great if this came into fruition sometime in the near future. Because I only really know python, and have school to deal with, I am not really able to make a direct contribution to this. But, if of any assistance, I could help with testing and debugging of the system.

Many thanks, APS-Space

booo commented 1 year ago

I just want to let you know that we would appreciate your contribution a lot. I have no real prior experience with the joystick setup and can't help much but please commit early and often and let us know about your progress. If you have any concrete questions please post them here. Maybe someone with prior experience can help out.

I think your mock up looks good and makes sense.

AGSBurei commented 1 year ago

I just want to let you know that we would appreciate your contribution a lot. I have no real prior experience with the joystick setup and can't help much but please commit early and often and let us know about your progress. If you have any concrete questions please post them here. Maybe someone with prior experience can help out.

I think your mock up looks good and makes sense.

Well its an oportunity for me to learn new stuff and i kind of need it also

AGSBurei commented 1 year ago

Just to let you know i'm currently on my last few weeks of school project delivery which will mark my last year of study, and will continue my work.

In the meantime I had time to read the current code and i would like to know how the client side of joystick communicate with the backend on QT.

I was working on the peripheral page to get an hand of the tooling and manage to create a page and i would like to feed it an array of peripheral with JoystickManager.cc

DronecodeBot commented 1 year ago

This issue has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/joystick-support-overhaul/33505/1

AGSBurei commented 1 year ago

Currently working on the peripheral listing. I'm trying to add a new page on the joystick section, the button exist but the page doesn't show when i click on peripherals. QRC think the the file doesn't exist but it does and the file hierachy is a bit confusing since qml of qgroundcontrol\src\VehicleSetup qml's doesn't show up under \VehicleSetup tab image

AGSBurei commented 1 year ago

image Ok i'have find it i had to set an alias for the QML on qgroundcontrol.qrc to make it work