Giter VIP home page Giter VIP logo

botui's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botui's Issues

Python not compiling

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']
`

Servo widget shows servos enabled

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.

Python does not work if ran from Botui

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.

Show blob number in camera view

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.

Fix the poor connection issue

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:

  1. The error is showing "connected but no internet". Some devices just say this, which is why I think this to be so. On the devices that appear to be still trying to connect, I bet that it's just trying to ping a server such as google to make sure that there is an internet connection, but it never happens.
  2. The WPA protocol is outdated and we need to update to WPA2 or a newer version of WPA2. I am doubtful that this is the cause.

Find exact mechanism that flips screen

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

Gyro not measuring correctly.

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?

Screen Rotate

Implement an option to rotate the screen either on a button press or using the accelerometer.

Cancel button while editing the code

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.

Kill the hung graphics window without rebooting

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).

Program STOP button

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?

Get all of the software to update from a clean version of linux

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)

Adding C++ functionality or switching to C++ instead of C

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++.

Allow Creation of a Program from an executable

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.

Battery logic for all devices

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()

Save output of update to a file

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.

Screen Dimming for Power Saving

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.

Advanced Settings/Better UI

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.

Add a "developer update" or "beta mode"

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.

Upgrade utility

We need a way to upgrade the wallaby through the UI. It should mount a USB drive and look for upgrade scripts.

Blob label spin box is hard to adjust

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.

Building botui on "non-Wallaby" hardware

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)

  1. libkar
  2. pcompiler
  3. bsonbind
  4. daylite
  5. libaurora
  6. libwallaby
  7. libbotball

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 :)

Re-design or Re-add graphics to wait_for_light

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.

A,B,C Buttons off screen

From Charles - The ABC buttons for a running program are too low on the screen to fully display

This doesn't seem to be an issue on our end. Attaching images showing what we see from the controller. Awaiting additional feedback from Charles.

These images are from 24.8:
IMG_9501
IMG_1278

Confirm battery type change

When the user changes the battery type through settings, confirm with them that they are actually using a battery of that type.

Update to Modern Qt

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.

Add "Reflash Button"

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.

Add a checkmark to enable and disable the WiFi on/off button

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.

Control multiple servos using ServoWidget

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()

Handle camera connections/disconnections

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.

Select AP or Client Mode

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.