User Tools

Site Tools


doc:crazyflie:client:pycfclient:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:crazyflie:client:pycfclient:index [2017-01-26 13:52]
kristoffer Added Loco Positioning tab
doc:crazyflie:client:pycfclient:index [2020-05-12 14:27] (current)
kimberly
Line 1: Line 1:
 +<WRAP center round important 60%>
 +This page has deprecated and moved to the new documentation framework of the main Bitcraze website. Please go to [[https://www.bitcraze.io/documentation/system/]]
 +</WRAP>
 +
 ====== Overview ====== ====== Overview ======
 This page is intended to give an overview on how to use the Crazyflie client, not for installing it. For install instructions go [[https://github.com/bitcraze/crazyflie-clients-python/blob/develop/README.md|here]]. This page is intended to give an overview on how to use the Crazyflie client, not for installing it. For install instructions go [[https://github.com/bitcraze/crazyflie-clients-python/blob/develop/README.md|here]].
Line 9: Line 13:
   * Start up the application   * Start up the application
   * Insert the joystick and Crazyradio (PA)   * Insert the joystick and Crazyradio (PA)
-  * Before you press connect make sure that the joystick is working as expected and that the **thrust is zero**. The joystick values should be visible in the flight data box under target. +  * Before you connect to the Crazyflie make sure that the joystick is working as expected and that the **thrust is zero**. The joystick values should be visible in the flight data box under target. 
-  * Press //Connect//+  * Press //Scan//
   * Wait for the scanning to complete   * Wait for the scanning to complete
-  * Double-click the Crazyflie you want to connect to. There's one debug URI for UI testing so you should connect to the URI that begins with %%radio://80/XX/XX%%.  The +  * In the drop-down menu to the left of the Connect button select the Crazyflie you want to connect to. Connect to the URI e.g. %%radio://0/80/250k%%.
   * The client will now connect to the Crazyflie and handshake   * The client will now connect to the Crazyflie and handshake
-  * One the handshake is done you can start flying the Crazyflie. Remember the most tricky part is the thrust so start out easy..+  * When the handshake is done you can start flying the Crazyflie. Remember the most tricky part is the thrust so start out easy...
- +
-Once you have connected to the Crazyflie you can just use the //Quick connect// button next time you start the application.+
  
 For more info on LED indicators etc. have a look at the [[projects:crazyflie:userguide:index#the_crazyflie|Crazyflie]] or [[projects:crazyflie2:userguide:index|Crazyflie 2.0]] user guide. For more info on LED indicators etc. have a look at the [[projects:crazyflie:userguide:index#the_crazyflie|Crazyflie]] or [[projects:crazyflie2:userguide:index|Crazyflie 2.0]] user guide.
 ====== Main UI ====== ====== Main UI ======
-{{ :doc:crazyflie:client:pycfclient:cfclient_main_ui.png?700 |}}+{{:doc:crazyflie:client:pycfclient:cf_client_1.png|}}
   - The window title will show the connection status   - The window title will show the connection status
-  - Connect/disconnect and quick connect buttons as well as automatic connection +  - Connect/disconnect, scan and the drop-down connection list as well as Address and auto reconnect. 
-     * //Connect:// Will bring up a list of available Crazyflies to connect to+     * //Scan:// Will scan for availible Crazyflies within the chosen address. 
 +     * //Connect:// Will connect to the selected URI in the connection list
      * //Disconnect:// Will disconnect the current Crazyflie      * //Disconnect:// Will disconnect the current Crazyflie
-     * //Quick connect:// Will connect to the latest (successfully) connected Crazyflie   +     * //Address:// The address to scan for. If you didn't change this [[doc:crazyflie:client:pycfclient:index#firmware_configuration|in the configuration]], then leave the default of 0xE7E7E7E7E7 
-     * //Auto-reconnect:// If enabled the client will connect again if the connection is lost+     * //Auto Reconnect:// Try to automatically reconnect when connection is lost.
   - Battery and link quality (from 0% to 100%)   - Battery and link quality (from 0% to 100%)
   - Tabs with specific functionality ([[doc:crazyflie:client:pycfclient:index#tabs|see below for details]])   - Tabs with specific functionality ([[doc:crazyflie:client:pycfclient:index#tabs|see below for details]])
 +  - The selected and used input interface
  
 ====== Functionality ====== ====== Functionality ======
 Below are a few guides on how to accomplish specific tasks with the client. Below are a few guides on how to accomplish specific tasks with the client.
- 
-===== Connecting ===== 
-There's two ways to connect to a Crazyflie, either by searching for Crazyflies and selecting one or by directly connecting to the previously connected one. Either two options are available from the menus (//Crazyflie->Connect to Crazyflie// or //Crazyflie->Quick connect//) or directly from the toolbar ([[doc:crazyflie:client:pycfclient:index#main_ui|details]]). For more information on the Crazyflie URIs show in the list have a look [[doc:crazyflie:api:python:index?#uniform_resource_identifier_uri|here]]. 
- 
-If you search for Crazyflies the following dialog will be shown: 
-<WRAP group> 
-<WRAP half column> 
-{{ :doc:crazyflie:client:pycfclient:cfclient_connect_dialog.png?500| }} 
-</WRAP> 
-<WRAP half column> 
-  * //List of Crazyflies:// To connect either double-click, or select and then press //Connect//  
-  * //Address:// The shock burst address to scan for. If you didn't change this [[doc:crazyflie:client:pycfclient:index#firmware_configuration|in the configuration]], then leave the default of 0xE7E7E7E7 
-  * //Scan:// Re-scan for Crazyflies (not you're Crazyflie must be powered on to show up in the list) 
-  * //Connect:// Connect to the selected Crazyflie 
-  * //Cancel:// Go back 
-</WRAP> 
-</WRAP> 
-\\  
  
 ===== Firmware upgrade ===== ===== Firmware upgrade =====
Line 59: Line 45:
   * Make sure that the Crazyflie is disconnected from the client and powered off   * Make sure that the Crazyflie is disconnected from the client and powered off
   * Go to the menu //Crazyflie->Bootloader//   * Go to the menu //Crazyflie->Bootloader//
-  * For Crazyflie 2.0 hold the button for about 3 seconds when turning it on until the blue LED M2 starts to blink to get into bootloader mode.+  * For Crazyflie 2.0 hold the button for about 3 seconds when turning it on until the blue LED M2 starts to blink to get into bootloader mode. If a wrong nRF51 firmware has been flashed you might have to start from an un-powered state. Then hold the button and connect power.
   * Click "Initiate bootloader cold boot"   * Click "Initiate bootloader cold boot"
   * For Crazyflie 1.0 now power it on **within 5 seconds** using the battery (not USB), the booloader should now connect   * For Crazyflie 1.0 now power it on **within 5 seconds** using the battery (not USB), the booloader should now connect
-  * Press "Browse" and select the binary you want to download //(e.g. cflie.bin)//For Crazyflie 2.a [[doc:crazyflie:bootloader:index|zip]] file containing firmware for both nRF51 and STM32F405 is possible to use.+  * Press "Browse" and select the binary you want to download //(e.g. cflie.bin)//**Note:** A *.bin file will be flashed to the STM32xxx only. Or select a [[doc:crazyflie:bootloader:index|zip]] file containing firmware for both nRF51 and STM32F405 for Crazyflie 2.0 as well as firmware for the STM32F103 for the Crazyflie 1.0.
   * Press "Program" and wait   * Press "Program" and wait
   * Press "Restart in firmware mode"   * Press "Restart in firmware mode"
Line 74: Line 60:
   * **Pitch trim** Can be programmed permanently with the trim values found to work good in the flight tab.   * **Pitch trim** Can be programmed permanently with the trim values found to work good in the flight tab.
   * **Roll trim** Can be programmed permanently with the trim values found to work good in the flight tab.   * **Roll trim** Can be programmed permanently with the trim values found to work good in the flight tab.
-  * **Radio channel** Can be set to anything between 0 and 125, correspond to a frequency from 2400MHz to 2525MHz. In most countries channel 0 to 80 is OK to use but this should be checked with you local regulations. If using 2M datarate, the copter channels should be 2MHz apart.+  * **Radio channel** Can be set to anything between 0 and 125, correspond to a frequency from 2400MHz to 2525MHz. In most countries channel 0 to 80 is OK to use but this should be checked with you local regulations. If using 2M datarate, the copter channels should be apart (2MHz).
   * **Radio bandwidth** This can set the radio bandwidth to 250k, 1M or 2M. A lower bandwidth has longer range but has higher chance of collision. When used inside sometimes it is better to use 1M or 2M as it decreases the risk of collision with WiFi.   * **Radio bandwidth** This can set the radio bandwidth to 250k, 1M or 2M. A lower bandwidth has longer range but has higher chance of collision. When used inside sometimes it is better to use 1M or 2M as it decreases the risk of collision with WiFi.
   * **Radio address** (advanced) will set the shock burst address used for communicating. Note that if you change this then you will have to set the address correctly in the connect dialog.   * **Radio address** (advanced) will set the shock burst address used for communicating. Note that if you change this then you will have to set the address correctly in the connect dialog.
Line 86: Line 72:
  
 ===== Logging ===== ===== Logging =====
-TODO+ 
 +The Crazyflie logging framework allows to log the state of Crazyflie variables in real-time. This subsystem is used by the client to show information like pose or battery level. 
 + 
 +The list of log variable can be seen in the "log TOC" tab in the client. 
 + 
 +Variables are logged in block: one log block is a list of variable that are logged at the same time. You can setup custom log blocks that can be plotted in the plotter and saved to file in the log block tab. 
 + 
 +To setup a new log block click on the menu "settings/logging configuration", You then see the following toolbox: 
 + 
 +{{ :doc:crazyflie:client:pycfclient:client_log-configuration_anotated.png |}} 
 + 
 +  - List of log variable in the Crazyflie 
 +  - Log variables in the current log block 
 +  - Add the selected Crazyflie log variable in the log block 
 +  - Remove the selected log block variable from the log block 
 +  - Period at which the variables are sampled and the block is send by the Crazyflie to the client. The minimum possible period is 10ms (100Hz) and it can be set by step of 10ms up to 2550ms. 
 +  - Space taken by the variables in the log block. 
 +  - Name of the new or existing log blocks. You can choose an existing block from the list or type the name of a new one 
 +  - Load existing log block configuration 
 +  - Save log block configuration
  
 ===== Flight settings ===== ===== Flight settings =====
Line 108: Line 113:
 {{ :doc:crazyflie:client:pycfclient:cfclient_devconfig_dialog.png?300 |}} {{ :doc:crazyflie:client:pycfclient:cfclient_devconfig_dialog.png?300 |}}
  
-Follow the instructions to detect the axis or button that you would like to map to the functionality. If you would like to map the functionality to two axis (like right/left solder-button) then select //Combined axis detection// and follow the instructions.+Follow the instructions to detect the axis or button that you would like to map to the functionality. If you would like to map the functionality to two axis (like right/left sholder-button) then select //Combined axis detection// and follow the instructions.
  
 Go though all the functionality you would like to map by pressing the //Detect// button for each. To be able to save the mapping you will at least have to map roll, pitch, yaw and thrust. Go though all the functionality you would like to map by pressing the //Detect// button for each. To be able to save the mapping you will at least have to map roll, pitch, yaw and thrust.
Line 150: Line 155:
 ===== Flightcontrol===== ===== Flightcontrol=====
 The normal view used when flying is the one seen below. The normal view used when flying is the one seen below.
-{{ :doc:crazyflie:client:pycfclient:cfclient_flightab.png?700 |}}+{{ :doc:crazyflie:client:pycfclient:cfclient_flightab.png |}}
   - Flight mode selector (Normal and Advanced)   - Flight mode selector (Normal and Advanced)
      * //Normal:// Recommended for beginners      * //Normal:// Recommended for beginners
-     * //Advanced:// Will unlock flight settings in 3 +     * //Advanced:// Will unlock flight settings in 3 
 +  - Assisted mode selection. The assisted mode is enabled when the assisted mode button is pressed on the Gamepad. 
 +     * //Altitude hold//: Keeps the Crazyflie at its current altitude automatically. Thrust control becomes height velocity control. 
 +     * //Position hold//: Keeps the Crazyflie at its current 3D position. Pitch/Roll/Thrust control becomes X/Y/Z velocity control. 
 +     * //Height hold//: When activated, keeps the Crazyflie at 40cm above the ground. Thrust control becomes height velocity control. Requires a height sensor like the [[projects:crazyflie2:expansionboards:zranger|Z-Ranger deck]].
   - Roll/pitch trim can be set either in the UI or using the controller (if the correct buttons are mapped). This will offset the input to the Crazyflie for correcting imbalance and reducing drift.   - Roll/pitch trim can be set either in the UI or using the controller (if the correct buttons are mapped). This will offset the input to the Crazyflie for correcting imbalance and reducing drift.
   - Advanced flight control settings are available if Advanced mode has been selected (settings are in %):   - Advanced flight control settings are available if Advanced mode has been selected (settings are in %):
Line 232: Line 241:
  
 The tab can be used in two modes that is selected with the radio buttons to the right The tab can be used in two modes that is selected with the radio buttons to the right
 +
 +To setup the LPS anchor system mode (TWR or TDoA), see the [[doc:lps:configure-mode|Configure LPS positioning mode wirelessly]] documentation.
  
 ==== Position estimate mode ==== ==== Position estimate mode ====
-displays the configured anchor positions and the estimated position of the Crazyflie. Can be used to make sure the system is set up correctly and that the estimated position is reasonable.+Displays the configured anchor positions and the estimated position of the Crazyflie. Can be used to make sure the system is set up correctly and that the estimated position is reasonable. 
 {{ :doc:crazyflie:client:pycfclient:cfclient_position_estimate.png?700 |}} {{ :doc:crazyflie:client:pycfclient:cfclient_position_estimate.png?700 |}}
 +
 +  - Plot for X/Y (top view) showing anchors and Crazyflie
 +  - Plot for X/Z showing anchors and Crazyflie
 +  - Plot for Y/Z showing anchors and Crazyflie
 +  - Sets the graph mode
 +    * //Position estimate// - Normal viewing mode
 +    * //Anchor identification// - Enhanced mode where anchor id and marker becomes larger when Crazyflie is closer
 +  - Indicates if anchors are communicating with Crazyflie (i.e anchors are up and running)
 +  - Fit and center all data in graphs
 +  - Used to set anchor positions (see below)
 +
 +When setting the anchor position there's three colors to indicate the status:
 +  * //White// - No position exists for this anchor (i.e the position has not been read yet)
 +  * //Red// - Position has been read from the anchor and it differs from the currently shown value in the input box
 +  * //Green// - Position has been read from the anchor and it is the same as the currently shown value in the input box
 +
 +The positions of the anchors is continuously read in the background and as positions comes in or input box values changes the colors will be set accordingly. There's also two buttons used for the settings:
 +
 +  * //Get from anchors// - Fills the input boxes with the positions read from the anchors
 +  * //Write to anchors// - Writes the currently shown values in the input boxes to the anchors. In order to check that the write has been successful wait about 10s and all the fields should turn green as the positions are read back. If some of the fields are still red, try pressing the button again.
 +
  
 ==== Anchor identification mode ==== ==== Anchor identification mode ====
 displays the configured anchor positions. When the crazyflie is close to an anchor this is indicated in the graphs by highlighting it. This mode is useful to identify anchors and verify that the system is correctly configured. displays the configured anchor positions. When the crazyflie is close to an anchor this is indicated in the graphs by highlighting it. This mode is useful to identify anchors and verify that the system is correctly configured.
 {{ :doc:crazyflie:client:pycfclient:cfclient_anchor_identification.png?700 |}} {{ :doc:crazyflie:client:pycfclient:cfclient_anchor_identification.png?700 |}}
 +
 +  - Plot for X/Y (top view) showing anchors and Crazyflie
 +  - Plot for X/Z showing anchors and Crazyflie
 +  - Plot for Y/Z showing anchors and Crazyflie
 +  - Sets the graph mode
 +    * //Position estimate// - Normal viewing mode
 +    * //Anchor identification// - Enhanced mode where anchor id and marker becomes larger when Crazyflie is closer
 +  - Current system mode indication. The system must be in TWR mode for the anchor identification mode to be available.
  
 ====== ZMQ backends ====== ====== ZMQ backends ======
doc/crazyflie/client/pycfclient/index.1485435172.txt.gz · Last modified: 2017-01-26 13:52 by kristoffer