Fullscreen GUI?

Preface: I know you can just hit the fullscreen button and the gui expands.

The thing I really want to do is enlarge certain elements, specifically the gimbal joystick. When I fullscreen the GUI, it just adds more blank space.

Sorry, we don’t currently support resizing thermal viewer tab, due to a lot of pixel math that is occurring. The code is open source if figure out how to support that: AVR-2022/thermal_view_control.py at main · bellflight/AVR-2022 · GitHub

I don’t believe you can change the size of objects in the GUI without getting very deep in the code. If you want to have better joystick control, i did edit the gui source code to allow for xbox control of gimbal, let me know if you’re interested.

1 Like

Hey @tyguy I’m the flight engineer for my team and I’m currently working on improving the gimbal mechanism. I’m interested in this xbox control mod you have. Could you share that with me?

Yes, I’ll try and get access to the GUI code to do this, however I think I may have deleted some of the source code off of my PC (graduated from team and clearing up space for upcoming college), but I think it is somewhere on my team’s Cloud. Sometime soon I’ll add an update with the GUI file. As some additional information, I basically added the PyGame library to the GUI code, then added references to send the mqtt data to change the gimbal position, allow the laser to shoot, and open our team’s claw (disregard this part as it’s likely specific to our drone). Have you compiled your own GUI on your computer before? it requires a lot of setup so if not i’ll try to send a completed .exe file instead of just the changed file.

Here’s a link to a google drive with the .exe file. It also includes a control layout scheme, some of which is likely not applicable to your team. I’ll try and fine the actual source code I changed and upload that to the google drive along with possibly an update here on the forum. AVR-GUI - Google Drive

Thank you so much Tyler! Honestly I was worried I was too late and it had all been deleted, so thank you for getting back to me quickly!
I’ll see what I can do with this once I get access to the drone this month when school starts back up, if I have any questions I’ll just @ you.

To answer your question, no I haven’t compiled a GUI before, I have some experience in coding, but we were too rushed with our build to spend time modifying things last season. Hopefully we can get it down to a science this time around.

@tyguy I’m running into a little bit of a problem executing the custom GUI. This is the Command Prompt readback:

Full disclosure, I’m a Linux guy and we mostly stuck with Linux last year, so while I am comfortable working the black screen, I’m very inexperienced with Windows.
Any tips? Does it just want a controller plugged in?

That’s awesome!

I’d love to see how you did it.

I managed to send data from an Arduino joystick to AVRGUI to run the gimbal, but it was really really janky. Cross referencing with other people’s methods has been super helpful to me in the past, and it sounds like you’ve done something pretty impressive to look up to.

I’m currently re-installing some of the libraries and stuff required for the GUI. One possible issues is that for some reason, it is giving my user file path (twayn), and since that is not on your computer, it isn’t working. Additionally, it likely does indeed require a controller plugged in. I’ll try and bug fix and gain more knowledge for now.

The method I have used is actually surprisingly stable, and highly effective, as it really did help our team’s speed and accuracy. However, the methods used are janky, for a few reasons. First off, in my state, the competition was actually cancelled the night after I got the first prototype code to work, and as a result, was just using some janky proof-of-concept code (it literally works by having the laser button activate a while loop that reads the joystick and sends the mqtt message, and then sleeps for 5 ms to avoid sending too much to the drone) So it’s very janky, as I never fixed it, but it does work.

1 Like

After conducting some testing, I simply plugged in a controller and the GUI loads, and without plugging in the controller, it crashes with the same result you have shown, so that was likely the issue. I also installed the github onto my github desktop, which could be another source that you must have.

that’s actually amazing

I tried using while loops and it kept blocking all of the other functions, but I guess the laser runs in another thread.

For me, it kept blocking everything (on startup), so what I did was have the while loop only be activated by the first press of the laser activate button. This allowed the program to run and boot up, then, inside of the thermal_view.py code, the while loop activates and the controller is used for the inputs. The GUI still works completely normally if done this way, from what I have found, it just needs to have the while loop be activated by something else rather than on startup. I also tried using a runnable or whatever the python equivalent of that is, but this didn’t work properly.

Do you have a variable making sure that the loop only fires once?

I can just imagine spamming the laser button and just crashing everything

Okay got it, I can get a controller and try it out.

I’m not sure I understand what you mean about installing the github? Is there something on the AVR Github I need?

I was suggesting that you may need to install the avr-2022 from github if, after plugging in a controller, it still crashes on startup. other than that, it won’t be necessary unless you want to make changes to the source code itself for your team’s specific needs.

Ahhh, I see, thank you!

@tyguy After connecting the controller, I got your custom compilation to fire up and connect to the drone, and everything worked EXCEPT the controller interface. I verified that Windows was recognizing the Xbox controller that I connected to the laptop via wire, however there was no response when making controller inputs, and there was no onscreen joystick displayed.

I feel like I’m really close to making it work, I feel like I’m just missing a dependency or something. You said there was an elaborate setup, could you elaborate? Is there some package or library I need to have installed?
Thank you in advance!

When you were on the GUI screen, did any part of the GUI screen work/was it normally functional except for the lack of on-screen joystick? To initialize the controller-activated code, you have to press the “laser on” button or something close to that (i forget exactly what it says and I can’t check without a drone). I found the source code, so I can upload that onto the google drive that had the .exe file. I would read the avr guide to find out how to compile your own GUI. In short, you have to download Docker, the AVR-2022 repository from github, and all of the required dependencies. I would then try to create the .exe file by running the .py file that does this, without any changed files, just to make sure everything works. Once this has been done, replace the original thermal_view_control .py file with the one on the google drive, then the new .exe file should work. For reference, this was how to make your own .exe, not anything to do with mine, as your team will likely eventually have to make your own custom GUI for your own drone’s requirements.

1 Like