kipr / botui Goto Github PK
View Code? Open in Web Editor NEWRobot User Interface for the KIPR Controllers (Link, Wallaby, Wombat)
License: GNU General Public License v3.0
Robot User Interface for the KIPR Controllers (Link, Wallaby, Wombat)
License: GNU General Public License v3.0
Might be where it is pointing to.
Will try running code in Python IDLE for more information.
Python IDLE works fine for programs without importing wallaby.
As soon as we import wallaby I get the following error:
`
import wallaby
Traceback (most recent call last):
File "", line 1, in
File "wallaby.py", line 28, in
_wallaby = swig_import_helper()
File "wallaby.py", line 24, in swig_import_helper
_mod = imp.load_module('_wallaby', fp, pathname, description)
ImportError: dynamic module does not define init function (init_wallaby)
`
Can it be an issue with the SWIG file generation maybe?
I initialized Wombat on the same paths as that of Wallaby.
`
import sys
sys.path
['', '/home/pi', '/usr/lib', '/home/root', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-arm-linux-gnueabihf', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7']
`
By default, servos are disabled, but the UI shows they are enabled. On load, the page should call disable_servos() and start in the disabled state.
The IDE will run and compile python programs just fine, but if you then go to the Botui interface to run the program it will fail saying "kipr" was not found.
My guess before even looking at the code is that botui is trying to run it as a normal C executable, but cpython should be outputting the same form of executable anyway.
In the camera view, show the channel # and blob # for each blob. This should be a setting so the user can turn it on/off.
Clicking "Hide UI" in settings minimizes botui, but the top-left arrow disappears, so we can't switch back to botui.
I'm honestly not sure why exactly KIPR controllers do this, but the connection is pretty much never a strong, secured connection.
On almost any device it either has an error of some sort, shows a very poor connection, or show that it is in the process of connecting and never displays a true connection. Even when this happens, the user can still use everything like normal, it's just that the OS does not display the connection well.
I have two hypothesis for why this happens:
Currently it is unknown exactly what method was used to get the screen flipped.
We tried out a few different things during development but I'm not sure which one we settled on.
This probably won't be too hard to find, it's probably just a configuration file somewhere.
This is necessary to get the codebase to the point that it is build-able from scratch without an image
Even if we place the Wombat on a stable surface, the reading for Gyro range from -600 to 1700.
The values do a complete sweep in periodic regular increments and back to the lowest value.
Is it because the values are somehow adding up and not refreshing?
Currently there is only one test config, with no option to add custom configs.
Implement an option to rotate the screen either on a button press or using the accelerometer.
Add a cancel button while editing the code just so that we dont have to save the code and save the unnecessary code that we put in.
Helps while the user changes their mind midway editing the code.
Countdown timer with large graphics digits now works, but when Charles incorporated it back into the 2017 table program the graphics window hangs where the program is doing more action ... appears that something like buffer space is still too limited to accommodate both the graphics window and whatever is buffered on the UI display. Basically, Charles still has the problem where a reboot was needed to kill a hung graphics window (i.e., the desktop couldn't kill it and it did not show up under Linux ps).
After selecting a non-default config and clicking "Default," the star icon doesn't update until a new selection is made.
botui should open in fullscreen so that the X button is not shown.
STOP button was a widget before and was set to the right top corner of the menuBar.
Since the resizing of the menuBar, other bittons take up the whole space of the menuBar and the STOP button is hidden behind those buttons.
Is it possible to convert a widget into a QPushButton?
Should I look into resizing the buttons in the menuBar to make some space for the STOP button that is already there?
Just show the battery symbol with different colors for different ranges of battery
Right now I believe the only obstacle is getting botui to run on Qt5 in a stable way.
Once that is done I think we should be able to make a concise install method.
I would like to make it so that anyone can take a fresh install of linux (on a Pi) and follow a simple (copy and paste-able) set of instructions that would turn that linux install into a working Wombat with all of the software.
It would also be nice to include a shell script that does this in https://github.com/kipr/kipr-development-toolkit
This would make it so that we aren't just compounding issues with each new image file, and each image release could be done from a fresh start to ensure no snowballing has happened.
In addition or on a related note, it would be nice to dockerize (or other containerize) all of the software. It could even be a docker (or other container) package that contains all of the software. This would make the process described above even easier.
(I may create a new issue that addresses containerizing specifically)
This is the botui compilation code:
void ProgramsWidget::compile()
{
QModelIndexList currents = ui->programs->selectionModel()->selectedIndexes();
if(currents.size() != 1) return;
const QString name = m_model->name(currents[0]);
qDebug() << "compile clicked for " << name;
const QString projectPath = botui::pathToKISS + name;
const QDir includeDir(projectPath + "/include/");
const QDir srcDir(projectPath + "/src/");
QString binFilePath = projectPath + "bin/botball_user_program";
QString compileCommand = "gcc -o " + binFilePath + " -lwallaby -lpthread -lm -I " + includeDir.absolutePath() + " " + srcDir.absolutePath() + "/*.c";
qDebug() << compileCommand;
QByteArray ba = compileCommand.toLatin1();
const char *compileCommandC = ba.data();
int ret = std::system(compileCommandC);
qDebug() << "ret = " << ret;
}
The compiler is set to C directly by calling gcc.
If we wanted to switch to C++ we could just change this line:
QString compileCommand = "gcc -o " + binFilePath + " -lwallaby -lpthread -lm -I " + includeDir.absolutePath() + " " + srcDir.absolutePath() + "/*.c";
to:
QString compileCommand = "g++ -o " + binFilePath + " -lwallaby -lpthread -lm -I " + includeDir.absolutePath() + " " + srcDir.absolutePath() + "/*.cpp";
There is probably going to be other conflicts that are caused by this change, harrogate would also need to be changed to reflect this. I am not sure exactly what in Harrogate would need to be changed at this time, at some point I or whoever solves this issue will need to trace the path the code takes when you hit compile. Harrogate doesn't have any comments so it takes time to process what anything is. I am 70% sure that Harrogate feeds into pcompiler and pcompiler automatically determines the correct compiler, but I don't think g++ is setup as an option for pcompiler and it will default to gcc.
Additionally, I am unsure if KIPR as an organization will want to switch to C++, I don't know if there is some reason they decided to choose C. I view C as a primitive version of C++ and I can't think of a reason why you would choose to make a program in C over C++ other than experience level/simplicity. At very least I think we should add the option of C++.
Instead of requiring that the programs be compiled on the link itself, not with GCC, allow the user to create a new "program" based on an executable.
Other possibility would be a CLI application which creates a program.
It is difficult to read the channel name or number on the Wombat screen
Should this be QT5? It halts the install process using only QT5 otherwise.
Line 42 in be9c174
Increase the height of the spectrum bar in the channel configuration menu so that it can be more useful.
The battery logic added to support different battery types should be general to all devices, not specific to the wallaby device. All devices should support functions like supportedBatteryTypes()
and batteryType()
The fullscreen setting affects every page except the home page because we never call present() on the home page. It always exists at the bottom of the stack.
It would be handy if we make the output of the online-update and/or flash update save to a text file so we can go back and look at errors.
The console allows for scrolling but it moves you down to the bottom if a new line is printed.
Since blob numbers are zero-indexed, it may be confusing that setting "show blob labels" to 0 means no blobs are labeled,
Probably should be moved to libwallaby?
Add a note to the camera settings widget, clarifying that those settings only apply to the botui widget, not to user programs.
This may or may not be possible, I will have to pull up the schematic later.
If possible, it would be nice to be able to cut power to the screen after some timeout to save power.
If memory serves, the screen backlight is just directly powered once the controller is on.
The screen also already dims, but the backlight is still on. It's just that the pixels are faded to black.
This may be needed to be done after we update to Qt5/6.
The settings menu is now full, so if we want to add anything new it will need a design change.
I suggest making an Advanced Settings button, and then putting some of the settings a normal user wouldn't need in there.
That will simplify the settings page in the short term, and allow for growth in the long term.
In a page that is not normally accessed by the user, such as in an advanced settings menu or a "developer" menu, there should be a button that pulls all the latest (possibly unstable) software from github and installs it.
It would make pre-release testing much faster.
The "Source..." button in the camera view should go away.
We need a way to upgrade the wallaby through the UI. It should mount a USB drive and look for upgrade scripts.
The arrows of the spin box are too small to be effective on the wallaby. Either make it bigger or use a different widget, like a textedit with a numpad dialog.
I'm currently trying to compile botui on an Ubuntu 17.04 machine (I couldn't determine if Debian or Ubuntu is the main dev-target).
These are the dependencies I could figure out:
apt-get install qt5-default qt4-dev-tools build-essential cmake libssl-dev libboost-dev libpng-dev zlib1g-dev libbson-dev libbson-1.0-0 libopencv-dev doxygen python-dev swig libjpeg-dev libzbar-dev
After installing (in that order)
and copying over turn_off_wallaby.wav
from a Wallaby update I could successfully build botui.
Problem is that it segfaults immediately. On a different system (Debian 8 / armel / a Wallaby) it segfaulted after printing out realloc(): invalid pointer
followed by a random address.
A strace on the Ubuntu system revealed following details:
libwallaby.so was located:
open("/usr/lib/libwallaby.so", O_RDONLY|O_CLOEXEC) = 3
interestingly it is searched for in weird places:
open("/lib/x86_64-linux-gnu/tls/x86_64/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/x86_64/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/x86_64/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/x86_64/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/x86_64/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/tls/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/x86_64/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64/libwallaby.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/libwallaby.so", O_RDONLY|O_CLOEXEC) = 3
USB ports are read for some reason:
readlinkat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:06.0/usb2", 0x559cc750ae00, 99) = -1 EINVAL (Invalid argument)
readlinkat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:06.0/usb2/2-1", 0x559cc750ae00, 99) = -1 EINVAL (Invalid argument)
readlinkat(AT_FDCWD, "/sys/devices/pci0000:00/0000:00:0b.0/usb1", 0x559cc750aa70, 99) = -1 EINVAL (Invalid argument)
I really don't know how to continue. I have already looked at the bitbake recipes which pretty much do the same things I have described.
I would really appreciate help :)
In order to fix wait_for_light from crashing, it was remade, but the graphics were not added in the remake (to save time and simplify)
It would be nice to re-add the waiting animation, or use this opportunity to design a new one.
There could also be animations to replace the ASCII lightbulb I made, maybe with a "real" (cartoon) lightbulb.
After, the graphics version should be tested on multiple Wombats to ensure that graphics were not the cause of the crashing from before.
Pressing Turn OFF Wifi, turns off WiFi but doesn't update to Turn ON WiFi.
When the user changes the battery type through settings, confirm with them that they are actually using a battery of that type.
Users should be able to edit the HSV bounds of channels in existing configs.
The entire project should be updated to fit modern Qt standards.
I think there was a massive leap between version 4.x.x and 5.x.x so that may be a very large task.
This would make things like containerizing the code much simpler. It's also just a necessary step in maintaining software.
The DMA De-synchronized error is common enough that it is a hassle to explain to customers over the phone how to navigate to the terminal and reflash or do an entire update to fix the issue.
It would also benefit lab staff that repair them as we could just press a button to solve the issue in seconds.
Anywhere on the UI there should probably be a button that calls reflash since it isn't harmful to do so when unnecessary.
The same way we can disable the hideUI button, make it so that the WiFi shut off is hidden by default.
Users keep getting impatient with the Wifi and then going straight to that button.
When it's pressed before the Wifi is active it can make the Wifi refuse to turn on at all.
Using the servo widget is limited to one servo at a time, since it automatically disables other servos. It should be able to handle multiple servos using get_servo_enabled()
The live camera view should gracefully handle camera connections and disconnections. When a camera connects, the view should update without having to leave the page and come back. When a camera disconnects, a message should notify the user.
Upon boot, the controllers are set up and configured to be an access point. Ideally the option to connect to a network as a client, therefore having internet access would open the door to OTA updates and integrations such as Github.
This thread will be used as documentation to work backward identifying how the network is currently configured along with other relevant information. If there is a better location for this please let me know.
Chinese translations are missing for new sensors, "Shut Down" button, and language settings page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.