bitcraze / crazyflie-clients-python Goto Github PK
View Code? Open in Web Editor NEWHost applications and library for Crazyflie written in Python.
License: Other
Host applications and library for Crazyflie written in Python.
License: Other
Running on OS X natively. Seems to be a client side bug. The problem persists even after plugging the device back in and reconnecting the copter. Only fix is client restart.
On Linux it's possible to do the following using the PS3:
This has only been seen on Linux and with the PS3 controller.
To fix this throw away all the events read the first time from the device.
The client uses 100% CPU when the joystick is not connected. This issue seems to go away once the joystick is connected.
This was reported in the forum here
If we add new parameters to the writable part of the dist config.json without erasing the old user config.json these parameters are not copied and will cause an exception since they will not be in the config.
Currently it's possible to remove the user config.json and restart the application to fix this.
To avoid bugs and make the Python code better a static code checking tool should be used. Currently the top candidate is flake8: https://pypi.python.org/pypi/flake8
This issue is for choosing the tool and removing all the errors.
Currently we just open the first input-device found and after that it's not possible to change (related to issue #3). It should be possible to switch between multiple input-devices.
The proposed solution is to add a drop-down box in the main user interface (next to the input config) where it's possible to select which input-device to use.
I think it would be a nice little improvement if the CF Client showed what state the killswitch was currently in. I was trying to figure out why pitch and roll appeared to be working in the client, but thrust remain 0. I finally remembered the killswitch is a toggle.
The plotting widget needs to be fixed, cleaned up and improved.
Also nice to have would be:
To easily test/implement it's possible to use the plottest.py application.
In my opinion the input sensitivity in general is to sensitive. For example if you push the throttle stick, most of the time i unintentionally push the yaw (left/right) direction a little bit, too.
Maybe depending on input device, but it should be adjustable in the Client. Something like a axis dead zone, but with re-seized values after the deadzone.
Forum
The configuration dialog and writing should be improved to support the slit axis support added in the changeset 8f4111f
Maybe by adding an option to slit the axis in the UI?
Currently, it appears one cannot map any functions to the shoulder buttons of an Xbox controller. It would be great if one could, say map the shoulder buttons to control yaw. I can successfully map trigger buttons to thrust, however.
I edited the mapping profile for the PS3 controller and I save the profile. I restart the cfclient and I get an error.
Procedure:
When I did this procedure, either I get an error, or the profile does not show in the list if I don't select the profile.
I attached a picture of the error.
I got the default settings back when I replaced the whole application folder.
-hako
The architecture of the cfclient supports adding other input-device readers than PyGame. This was done so that in the future it would be possible to remove the PyGame dependency and use os-specific functionality instead.
The PyGame device reader should be kept as a fallback for other platforms.
The architecture of the cfclient supports adding other input-device readers than PyGame. This was done so that in the future it would be possible to remove the PyGame dependency and use os-specific functionality instead.
In the case of Mac OSX there seems to be only 64-bit versions of PyQt and 32-bit versions of PyGame which makes them incompatible.
The PyGame device reader should be kept as a fallback for other platforms.
When starting an input mapping configuration for an input device the default name of the mapping should be the same name as read from the device.
The stabilizer log config is misspelled, it's named stabalizer.json and the variables inside are all named stabalizer.*
Everything should be renamed from stabalizer to stabilizer and this will fix the issue.
This only affects the plot tab.
Currently the headless client is dependent on QT and is run as a QT console application. This dependency comes from the usage of the files in lib/cfclient/utils to easily have access to the config/input-device/input-mapping/input-reading functionality.
The plan is to remove the QT dependencies from all the files in lib/cfclient/utils and move them to another directory. This would make it possible to make use of these in other apps (like the headless client or a client using another framework than QT) without depending on QT.
It's possible to program the config block without filling in all the fields which will cause an exception.
Support for updating the Crazyradio firmware should be added to the GUI and to the library. Currently this can only be done using the command-line.
Switch from using printouts to using the Python logging utility instead since it's a lot easier to filter messages and to redirect the output to a file (that can be attached to issues etc.)
The levels for the logging should correspond to:
We need to start using the hash functionality for the log/param TOC to shorten the connection time. It's implemented in the crazyflie so it's just the client implementation that is missing.
When replies are lost in the download this is not detected in Cloader which will cause a hanging since we are waiting for the reply.
Step to reproduce:
Expected behavior:
A reply should be received.
Fix:
After a timeout (a couple of seconds?) the command should be re-sent. Even for the flashing this is ok, though it will trigger a new flashing of the buffer.
Currently the "safe-sending" functionality is working but it seems to have problems. The warning "ExpectAnswer: ERROR! Older timer was running while scheduling new one on [%d]" is printed a lot during the connection procedure and this should not be the case.
This problem will probably cause the connection time to be longer than needed. This is mitigated with the toc-cache but should still be fixed.
Currently only digital buttons are supported when setting the roll/pitch trim, app exit and emergency stop. Some controllers (like XBox 360) have analog axis on the "digital" pad. This means that they cannot be used for pitch/roll trim.
The architecture of the cfclient supports adding other input-device readers than PyGame. This was done so that in the future it would be possible to remove the PyGame dependency and use os-specific functionality instead.
In this case we should use /dev/js* to read the joystick.
The PyGame device reader should be kept as a fallback for other platforms.
The default Xbox 360 mapping is wrong (at least in Linux). The thrust/yaw in switched.
The fix for #43 and #35 will make it impossible to implement hover mode since no events will be coming in. This fix needs to be improved either by testing to re-initialize the joystick subsystem after the timeout to check if a device has been removed or to inhibit this behavior through the Input API.
Currently it's mandatory to set up roll/pitch trim, app exit and emergency stop to be able to save the configuration. These shouldn't be required, only roll/pitch/yaw/thrust is needed to fly and the trim can be set up in the UI.
The bootloader is working without any problems if the cfclient is just started and the Crazyflie bootloaded. But if you first connect to the Crazyflie normally, disconnect and then connect in bootloader mode it's not working anymore.
When trying to initiate the bootloader without having the radio plugged in there should be an error message in the UI.
Catch the exception and add this message.
When loading a previous configuration and changing it all the values needed are not written to the file since they are probably not loaded correctly. This will cause an exception next time the configuration is loaded and the input will not work.
After entering the input-config dialogue and opening the input-device for "raw reading" the device is not re-opened after exiting the dialogue.
Step to reproduce:
Expected behavior:
When the input-configuration dialogue is exited the input-device should be re-opened if a valid configuration file is found. The config should be selected by:
This was found by @hsanjuan in pull request #9.
The axis id should only be integers as represented by PyGame. Looking at this config file it looks like the wrong thing is written into the ID field (looks like the internal ID for the JoystickReader...).
The input device used was: Saitek PLC SP550 Pad and Joystick Combo
The procedure to reproduce (according to report):
I was using latest trunk in Linux. I copied one of the input config files with a new name, went to configure device mapping, selected joystick, clicked on configured, selected the new file, clicked on load so the save button would enable, configure the stuff, click on save.
#!
{
"inputconfig": {
"inputdevice": {
"updateperiod": 10,
"name": "saitek",
"axis": [
{
"scale": -1.0,
"type": "Input.AXIS",
"name": "thrust",
"key": "thrust",
"id": 2
},
{
"scale": 1.0,
"type": "Input.AXIS",
"name": "yaw",
"key": "yaw",
"id": "Input.AXIS-0"
},
{
"scale": 1.0,
"type": "Input.AXIS",
"name": "roll",
"key": "roll",
"id": 0
},
{
"scale": -1.0,
"type": "Input.AXIS",
"name": "pitch",
"key": "pitch",
"id": 1
},
{
"scale": -1.0,
"type": "Input.BUTTON",
"id": 2,
"key": "pitchcal",
"name": "pitchNeg"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 3,
"key": "pitchcal",
"name": "pitchPos"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": "Input.BUTTON-Input.BUTTON-14",
"key": "estop",
"name": "killswitch"
},
{
"scale": -1.0,
"type": "Input.BUTTON",
"id": 7,
"key": "rollcal",
"name": "rollNeg"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": 4,
"key": "rollcal",
"name": "rollPos"
},
{
"scale": 1.0,
"type": "Input.BUTTON",
"id": "Input.BUTTON-Input.BUTTON-12",
"key": "exit",
"name": "exitapp"
}
]
}
}
}
http://forum.bitcraze.se/viewtopic.php?f=5&t=168&p=919#p919
It would be nice to be able to check for the latest stable version of the client and the Crazyflie/Crazyradio firmware. Here's the plan so far:
On our server we serve a textfile with the latest versions of these components, like http:///www.bitcraze.se/versions/latest.
One option would be to be notified automatically:
If there are any newer version the user would be notified using a pop-up with the options Download now, Ignore or Never show again.
To be less intrusive this could also be triggered when opening the About box or when the user selects File->Check for new software/firmware.
The masterplan would of course be to be able to download and update directly without going through a browser for downloading a file.
Currently roll/pitch trim is only saved in advanced flight mode. This should be saved in all flight modes.
When disconnecting and reconnecting multiple times it has been observed that some port callbacks that are registered on connect are not unregistered on disconnect. This should be fixed.
It's not detected if an input-device is added or removed after the application has started.
Step to reproduce:
Expected behavior:
When an input-device is inserted it should be opened for reading using the last used config file. When an input-device is removed the reading of it should be stopped and the user interface should show that it's not being read anymore (gray-out config selector and clear target values). It should be possible to do this over and over.
The config values for the input device (like max_rp, max_yaw, etc..) is not passed to the input layer until the FlightControlTab is showed. The config values should be loaded when Input is created.
When closed the client doesn't exit, it continues to do re-sends in Crazyflie.py.
As noted in #3 its not possible to detect when a input-device is disconnected. This in combination with the driver remembering the latest values is bad since they will keep being sent even after the device is disconnected.
The values still has to be remembered in the driver since you will not get all the events all the time, but we should insert a timestamp at this level where events are only valid a specific time.
The roll/pitch trim is not settable from the UI, only from the input device. It should also be possible to set the trim from the UI and this should sync with the input layer.
Also the signal for trim setting from the input layer should only be sent when the trim changes, not every time the input device is read.
The newly created log configurations are not listed in the plot tab combobox until the application has been restarted. They should be available from the combobox directly after they have been created.
The specified period for logging configurations is not working as expected, data is sent at a shorter interval. This could be a problem in the firmware as well as in the client so it needs more investigation.
Step to reproduce:
Expected behavior:
The packets containing the logging data should be sent from the Crazyflie at the specified interval.
It's possible to select an input configuration even when no joystick is attached. Doing this the app will try to open an input device with selected config and an exception will the raised.
Not all, but some of the source files are not PEP 8 conform - e.g. lib/cfclient/cfclient.py. Fixing them wouldn't be hard. I've forked the repository and would be willing to reformat the "offending" code and pass it back as a pull request. However, if I bother doing it, I wouldn't want it to be an annoyance for anyone or never get pulled, so the question is is this wanted?
Advantages:
Disadvantages:
So should I do it and send the pull request, or should we leave it the way it is?
When trying to open the Crazyradio for scanning or connection we should make sure that there's an error message shown in the UI if there are any exceptions. This might be the case in Linux if the user doesn't have permission to open the device.
The filtering in the current implementation of the radio link-quality reporting should be improved so the indicator in the UI will looks a bit smoother.
Following the pull request #2 we should define the encoding format in all python files.
UTF-8 would seems to be a good choice so we should add something like:
#!python
# -*- coding: utf-8 -*-
in either first or second line (after shebang) of every python files.
Add support for more languages and language switching in the QT client.
Figure out how to do this in a QT/Python way and implement it for at least English. The language should be settable in the client and saved in the config.
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.