{"id":16906168,"url":"https://github.com/timkam/crazyflie-on-voice","last_synced_at":"2025-03-20T16:24:24.194Z","repository":{"id":77453208,"uuid":"133573772","full_name":"TimKam/crazyflie-on-voice","owner":"TimKam","description":"Voice control Crazyflie 2.0","archived":false,"fork":false,"pushed_at":"2018-05-29T09:21:09.000Z","size":126,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-25T15:24:53.241Z","etag":null,"topics":["crazyflie","drone"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimKam.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-15T21:10:26.000Z","updated_at":"2021-02-27T14:15:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"6c009166-f288-4aab-905d-beed1197ca24","html_url":"https://github.com/TimKam/crazyflie-on-voice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimKam%2Fcrazyflie-on-voice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimKam%2Fcrazyflie-on-voice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimKam%2Fcrazyflie-on-voice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimKam%2Fcrazyflie-on-voice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimKam","download_url":"https://codeload.github.com/TimKam/crazyflie-on-voice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244648037,"owners_count":20487192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crazyflie","drone"],"created_at":"2024-10-13T18:41:32.352Z","updated_at":"2025-03-20T16:24:24.174Z","avatar_url":"https://github.com/TimKam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"crazyflie-on-voice\n==================\n\n.. image:: https://travis-ci.org/TimKam/crazyflie-on-voice.svg?branch=master\n        :target: https://travis-ci.org/TimKam/crazyflie-on-voice\n    \n.. **Important: this project is experimental.**\n\n*crazyflie-on-voice* provides a generic HTTP control server that allows integrating the crazyflie with custom programs, as well as with a wide range of third-party systems.\nIn addition, *crazyflie-on-voice* provides a client that allows you to voice control Crazyflie 2.0 drones.\n\nHardware requirements\n---------------------\nTo use *crazyflie-on-voice*, you need a `Crazyflie 2.0 \u003chttps://www.bitcraze.io/crazyflie-2/\u003e`__ and a `Loco Positioning System \u003chttps://www.bitcraze.io/loco-pos-system/\u003e`__ (LPS).\nFollow the instructions in the `LPS documentation \u003chttps://www.bitcraze.io/getting-started-with-the-loco-positioning-system/\u003e`__ to set up your Crazyflie to work with the LPS.\n\nInstallation and setup\n----------------------\n*crazyflie-on-voice* requires Python 3.6 or higher.\nTo get started, proceed as follows:\n\n* First install the dependency ``catkin_pkg`` manually, by running ``pip install catkin_pkg``.\n\n* If you want to use the voice controller, also install the following dependencies (you only need ``pocketsphinx`` if you want to use it instead of Google's speech-to-text API)::\n\n    pocketsphinx\n    pyaudio\n    python-Levenshtein\n    SpeechRecognition\n    word2number\n\n  Installing ``pocketsphinx`` and ``pyaudio`` can require some effort (use the search engine of your choice).\n\n* To install *crazyflie-on-voice*, run ``pip install git+https://github.com/TimKam/crazyflie-on-voice``.\n\n* To start the crazyflie controller, run ``crazyflie-on-voice --uri=\u003cyour_crazyflie_uri\u003e``.\n  (Replace ``\u003cyour_crazyflie_uri\u003e`` with the URI of your Crazyflie, e.g. ``radio://0/80/250K``.)\n\n* Start the voice control client by running ``crazyflie-on-voice --voice-only``.\n\nOptions\n-------\nThe following command line options are available:\n\n* ``--uri``, ``-u``: URI of the crazyflie. Defaults to ``radio://0/110/2M``\n\n* ``--control-port``, ``-cp``: Port for the control server. Defaults to ``8000``.\n\n* ``--planing-port``, ``-pp``: Port for the planning server. Defaults to ``8001``.\n\n* ``--room-spec``, ``-rs``: Path to the room specification file. (see *Path planning* below). Defaults to ``./examples/room_spec_1.yaml``.\n\n* ``--voice``, ``-v``: Add, if you *also* want to start the voice control client. (The voice control client does not start by default.)\n\n* ``--voice-only``, ``-vo``:  Add, if you *only* want to start the voice control client.\n\n* ``--voice-api``, ``-va``: Speech-to-text API the voice control client users. Either ``google`` (software-as-a-service) or ``pocketsphinx`` (free software, local installation). Defaults to ``google``.\n\n* ``--control-url``, ``-cu``: URL of the control server (without port). Only relevant for the voice client (in case you want to connect to a control server on a different machine). Defaults to ``http://localhost``.\n\nVoice control\n-------------\nTo control your Crazyflie by voice, use the word sequence ``Crazy + \u003cdirection\u003e + \u003cdistrance\u003e``, where\n\n* ``\u003cdirection\u003e``: *up*, *down*, *left*, *right*, *ahead*, *back*, *start*, or *stop*;\n\n* ``\u003cdistrance\u003e``: the relative distance in centimeters, **rounded to decimeters** (e.g. *10* or *230*).\n\nNote that the direction is absolute, considering the x,y, and z coordinates of the LPS (and not considering the yaw angle of the crazyflie).\n\nTo stop your Crazyflie, use ``Crazy stop``.\n\nPathfinding capabilities\n------------------------\nThe Crazyflie can autonomously circumvent obstacles using a custom implementation of a an `A* search \u003chttps://en.wikipedia.org/wiki/A*_search_algorithm\u003e`__-based pathfinding algorithm.\nThe bounds of the environment as well as the obstacles within the environment must be described and are assumed to be static.\nCurrently, obstacles are described as unit cubes which are then scaled and translated so they represent objects of the correct size and position in the environment.\n(Rotation of objects is currently not possible but could be added easily.)\nFor path planning, the scene is discretised as a cartesian grid with cell size 0.1m x 0.1m x 0.1m.\nThere is no benefit in using smaller cells since the accuracy of the positioning system is limited.\nFor each grid cell, all obstacles are sampled to determine whether they are occupied.\nThe grid is then used to find the shortest path that avoids obstacles between two points using A*.\n\nYou can model your environment as a `YAML \u003chttps://en.wikipedia.org/wiki/YAML\u003e`__ file.\nFor example, an obstacle of size 1.6m x 0.8m x 2.2m that has its \"origin\" at position 1.25m x 1.7m on the floor can be modelled like this::\n\n    - obstacle:\n        - [1.60, 0.8, 2.20]\n        - [1.25, 1.70, 0.00]\n\n\nYou should also provide the measures of the room in which you are flying (as the first entry in your YAML file).\nHere is an example of a full specification::\n\n    - room:\n      - [4.0, 5.0, 2.5]\n\n    - table1:\n      - [1.30, 0.65, 0.75]\n      - [1.35, 0.68, 0.00]\n\n    - table2:\n      - [1.30, 0.65, 0.75]\n      - [1.35, 2.68, 0.00]\n\n    - obstacle:\n      - [1.60, 0.8, 2.20]\n      - [1.25, 1.70, 0.00]\n\nThe first item **has to be** the room measures specification.\nNote that for each obstacle, the first array specifies the measures ``[x, y, z]`` in meters;\nthe second array specifies the coordinates of the corner that is closest to ``[0, 0, 0]``.\n\nThen, run *crazyflie-on-voice* as follows:\n\n``crazyflie-on-voice \"\u003cyour_crazyflie_uri\u003e\" --room-spec=\"\u003cpath-to-yaml-file\u003e\"``\n\nGeneric HTTP interface\n----------------------\n*crazyflie on voice* consists of two main components: a voice control client and a generic HTTP server.\nTo only run the HTTP server, exectue ``crazyflie-on-voice --server --port=\u003cport\u003e``.\nReplace ``\u003cport\u003e`` with the port on which you want your server to run.\n\nThe server accepts ``POST`` requests to its base URL. The requests have to have the following structure:\n\n* either::\n\n    {\"command\": \"\u003ccommand\u003e\"},\n\n   , where command is either ``stop``, ``start``, or ``land``.\n\n* or::\n\n    {\"distance\": [\"\u003cx\u003e, \u003cy\u003e, \u003cz\u003e]}\n\n  , where ``\u003cx\u003e``, ``\u003cy\u003e``, ``\u003cz\u003e`` is the **change** in x, y, and z coordinates you want to achieve.\n\n  For example::\n\n    {\"distance\": [0, 0, 0.5]}}\n\n\nTroubleshooting voice control\n-----------------------------\n*crazyflie-on-voice* makes use of the *SpeechRecognition* library.\nIn case you want to use *crazyflie-on-voice* with *PocketSphinx* and you have problems installing the package or with voice processing, read the instructions on the `SpeechRecognition documentation page \u003chttps://pypi.org/project/SpeechRecognition/\u003e`__ to and make sure *SpeechRecognition* works on your machine with *PocketSphinx* and *PyAudio*.\n\nAcknowledgements\n----------------\nThis work was partially supported by the Wallenberg AI, Autonomous Systems and Software Program (WASP) funded by the Knut and Alice Wallenberg Foundation.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkam%2Fcrazyflie-on-voice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimkam%2Fcrazyflie-on-voice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkam%2Fcrazyflie-on-voice/lists"}