Giter Club home page Giter Club logo

crazyflie-clients-python's People

Contributors

acxz avatar alekstorm avatar allynbauer avatar andreaspegelowqualisys avatar ataffanel avatar carlosrdomin avatar david-benes avatar dbenesj avatar dbrgn avatar debona avatar evoggy avatar fredg02 avatar gemenerik avatar jkotur avatar jonasdn avatar knmcguire avatar krichardsson avatar mattharrison avatar mchenryc avatar mgejke avatar mikevoyt avatar nicksonyap avatar omwdunkley avatar phiamo avatar ryankeemink avatar steveclement avatar tobbeanton avatar toverumar avatar victorhook avatar whoenig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crazyflie-clients-python's Issues

Extreme values sent after opening input-device

On Linux it's possible to do the following using the PS3:

  • Start cfclient without the PS3 controller
  • No input-device found
  • Insert the PS3 controller
  • Device found
  • The first time events are read from the device it reads the extreme negative value for all the axis, this is then sent to the copter
  • Since the PS button has not been pressed no more events are coming in from the device
  • The driver will save the last values and keep re-sending them
  • Since full negative is full thrust using the PS3, and the client keeps sending this, the Crazyflie will go...crazy.

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.


Updates to dist config.json are not copied to user config if a user config already exists

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.


Support multiple input-devices and switching between them

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.


Improve/fix plotting widget

The plotting widget needs to be fixed, cleaned up and improved.

  • The zooming needs to work (broken now)
  • The redrawing when re-sizing is broken

Also nice to have would be:

  • Support for multiple Y axis scales (so you can view raw gyro-put together with roll/pitch/yaw for example)
  • Dynamic scaling of Y axis
  • Show data-values on mouse-over or mouse-click

To easily test/implement it's possible to use the plottest.py application.


input device analog sticks sensitivity should be adjustable

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


Saved mapping profile does not load.

I edited the mapping profile for the PS3 controller and I save the profile. I restart the cfclient and I get an error.

Procedure:

  1. Open cfclient
  2. Select input device - configure device mappings
  3. Press configure
  4. Select and load any profile name
  5. Edit any changes.
  6. Press save and restart

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


Mac OSX back-end for joystick

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.


Remove QT dependency

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.


Use Python logging instead of prints

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:

  • debug: Excessive logging (most useful for file-output)
  • info: Successful events (such as "Input device 0 [PS3 controller] open for reading]")
  • warning: Unsuccessful events that might cause problems (such as "Trying to set parameter [someparam] that is not in the param TOC")
  • error: A serious error that will cause some functionality to fail (such as "No permission to open Crazyradio USB device")
  • critical: An error that makes the application unable to continue (such as "PyQt could not be imported"). After this message the application should exit.

Cloader needs to handle lost downlink preplies

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:

  • Read/write/flash firmware or configuration block (~5% reproducible)
  • The procedure will hang waiting for a reply packet

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.


Revisit the safe sending functionality

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.


Linux back-end for joystick

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.


Hover mode not possible with fix for #43 and #35

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.


After input-device configuration the device is not re-opened

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:

  • Start application with input-device connected
  • Enter input-configuration dialogue
  • Exit input-configuration dialogue
  • Input-device not working until application is restarted

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:

  1. The config we just created (if saved)
  2. The last used config
  3. The first found config

Axis/button ID has bad value in input mapping file

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"
        }
      ]
    }
  }
}

Check for latest version of client/firmware from within client

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:

  • After the file is fetched the version of the client is compared
  • After a Crazyradio is initialized the version of the firmware is compared
  • After a Crazyflie has been connected the version of the firmware is compared

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.


Not detected if input-device is added/removed after application is started

It's not detected if an input-device is added or removed after the application has started.

Step to reproduce:

  • Start application with input-device connected
  • Remove input-device
  • Start application without input-device connected
  • Insert input-device

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.


When disconnecting the joystick the last values keep being sent

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.


Roll/pitch trim not settable from UI

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.


Period for logging configuration not working as expected

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:

  • Start logging a block on the client

Expected behavior:
The packets containing the logging data should be sent from the Crazyflie at the specified interval.


Code formating on some files is non-PEP 8-conform

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:

  • PEP 8 conformity - would be easier to read for people familiar with Python
  • All the advantages that come with that - might be easier to extend, refactor, etc.

Disadvantages:

  • On files I reformat, it would be an edit just about on every line, making it harder to merge
  • In the case of conflicts, it would be kind of annoying to find and correct them

So should I do it and send the pull request, or should we leave it the way it is?


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.