Giter Club home page Giter Club logo

Comments (4)

bitcraze-issue-importer avatar bitcraze-issue-importer commented on August 22, 2024

Changed timing for automatic input device discovery. Closes #41.

→ <>


Original Comment By: Marcus Eliasson

from crazyflie-clients-python.

bitcraze-issue-importer avatar bitcraze-issue-importer commented on August 22, 2024

I did the change you suggested. It lowered CPU usage for me from ~95% to ~20%.


Original Comment By: Allyn Bauer

from crazyflie-clients-python.

bitcraze-issue-importer avatar bitcraze-issue-importer commented on August 22, 2024

I can't see this issue on Linux. The _do_device_discovery is called each 10ms by _self.discovery_timer. But this call will result in the pygame.joystick sub-system being de-initialized and initialized again to detect if an input-device has been inserted or not (see #3).

The 10ms interval is a bit unnecessarily aggressive, it would be enough with 1000ms. Would it be possible for you to test if this "fixes" the problem on OSX? Just change line 139 in input.py from 10 to 1000.


Original Comment By: Marcus Eliasson

from crazyflie-clients-python.

bitcraze-issue-importer avatar bitcraze-issue-importer commented on August 22, 2024

This seems to occur because _do_device_discovery is run continuously until a pygame Joystick is discovered. I see no path to fixing this problem without changing the paradigm of input device discovery. Requiring the user to tell the client to poll for input devices might make sense.

Does this not occur on windows or linux? It would seem that it must, unless I have misinterpreted the results of my profiling.


Original Comment By: Allyn Bauer

from crazyflie-clients-python.

Related Issues (20)

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.