How to use cfClient with Litewing

Published  January 3, 2025   0
cfClient for LiteWing
cfClient for LiteWing

What is cfClient?

cfClient is a GUI application designed for configuring, controlling, and debugging drones running Crazyflie-based firmware, including the LiteWing drone. It allows users to connect their drone, monitor sensor data, adjust flight settings, and manage input devices such as joysticks or game controllers.

With cfClient, you can:

  • Connect to the LiteWing drone over WiFi from any computer.

  • Monitor battery level and real-time flight data.

  • Adjust PID tuning, roll/pitch/yaw limits, and motor outputs.

  • Use flight modes like position hold, altitude hold, and assisted control.

  • Log and analyse flight performance using built-in tools.

This guide covers the basic setup for installing and using cfClient with LiteWing. For more advanced features, refer to the official cfClient documentation.

Installing cfClient

To install cfClient, make sure Python 3 is installed on your computer supported versions are Python 3.10, 3.11, 3.12 and 3.13 and then follow these steps:

1.Clone the repository:

git clone https://github.com/jobitjoseph/crazyflie-clients-python.git
cd crazyflie-clients-python 

2.Install dependencies and the client:

pip3 install -e .

3.Run cfClient:

cfclient

cfClient will now launch, and you can proceed to connect your LiteWing.

PS: If you are facing any kind of error while installing or running the cfclient, try to install it and run it in a virtual environment.

cfClient Interface for LiteWing

As you can see the user interface for the cfclient is very simple and easy to use. On the top Left coner you can see the connect and scan buttons right next to the UDP address selector. By default the UDP address will be automatically populated when you launch the cfclinet, if not just click the scan button after you have connected to the LiteWing’s WiFI. Then click on the connect button to connect to the drone. Once successfully connected the live readings from the will be displayed in the UI with the connection status on top of the GUI window. The emergency stop button can be used to be used to stop the motors from spinning, if in case of an emergency. The battery level indicator will indicate the LiteWing batteries charge level and the battery voltage.

Tabs and toolboxes

The main interface also consists of multiple tabs that can be shown or hidden via the View → Tabs menu. Additionally, these tabs can function as toolboxes—detachable windows that can be docked along the sides of the main window. This setup allows multiple windows to be displayed simultaneously. For example, the Console Log can remain open as a toolbox while the Parameter Tab is active for setting values. To open a toolbox, navigate to View → Toolboxes. If the corresponding tab is already open, it will be converted into a toolbox instead of a tab.

The following tabs/toolboxes are available:

  • Flight Control Tab

  • Console Tab

  • Plotter Tab

  • Parameter Tab

  • Log Blocks Tab

  • Lighthouse Positioning Tab

  • Loco Positioning Tab

  • Tuning Tab

Since we are talking about the basic flight controls, currently we will only focus on the the Light Control Tab. 

Flight Control Tab

In the flight control tab, you can see the multiple sections within. We will discuss each section one by one.

Basic Flight Control

The Basic Flight Control section consists of the basic control options we have available with the LiteWing.

  • Flight Modes

    This option allows you to select the flight mode.

    • Normal Mode – Designed for beginners, minimal control over parameters.

    • Advanced Mode – Unlocks the maximum tilt angle and thrust value changes for more dynamic flight control.

  • Assisted Modes

    These modes provide additional stability and control using sensors connected through the expansion ports. Depending on the sensor detected, you will be able to select the possible assist mode. With the below mentioned sensors this settings has no effect.

    • Altitude-Hold Mode – Maintains a constant flight altitude. Requires a barometric pressure sensor such as MS5611.

    • Position-Hold Mode – Holds the current flight position. Requires an optical flow sensor such as PMW3901 and a Time-of-Flight (ToF) sensor such as VL53I1X.

    • Height-Hold Mode – Keeps a fixed flight height. Requires a TOF sensor such as VL53I1X and must be activated at 40 cm or higher above the ground.

    • Hover Mode – Maintains a steady hover at 40 cm or higher over the take-off point. Requires an optical flow sensor such as PMW3901 and a ToF sensor such as VL53I1X.

Note: In Assisted Mode, the thrust controller functions as a height controller. AT the moment only height hold mode is tested successfully. Other modes may need some adjustment to work properly.

  • Trim Adjustments

    Trimming compensates for sensor misalignment and ensures level flight. 

    • Roll Trim – Adjusts rotation around the drone’s front-to-back horizontal axis. Used to correct side-to-side tilt.

    • Pitch Trim – Adjusts rotation around the drone’s left-to-right horizontal axis. Used to correct forward and backward tilt.

Advanced Flight Control

This section will be activated if you have selected the advanced flight mode. This section allows you to modify the following parameters.

  • Max angle: set the maximum pitch and roll rotation.

  • Max yaw rate: set the allowed yaw.

  • Max thrust: set the maximum thrust.

  • Min thrust: set the minimum thrust.

  • Slew limit: prevent sudden drop of thrust. When the thrust drops below this limit, the rates below Slew rate will not be allowed.

  • Slew rate: this is the maximum rate when the thrust is below slew limit.

  • To start using the cfclient, first make sure you are PC is connected to the LiteWIng’s acceespoint.

Flight Data

In the flight data section you can see the live reading from the LiteWing and drone. From the game pad the values such as thrust, pitch, roll, yaw and height values will be displayed. From the LiteWing the live data including the actuall flight data, IMU sensor values thrust and motor PWM values will be displayed. Using these live data it will be easier for you to clibarate the LiteWing when needed.

Input Devices

To control the Crazyflie, an input device is required. Typically, this would be a gamepad, but any device with at least four analog axes can be used. Below is an overview of input devices and how to configure them.

Since input devices provide raw axis values, a mapping is required to convert them into meaningful controls such as roll, pitch, yaw, and thrust. The client software includes default mappings for commonly used controllers, but users can also create custom mappings, or reconfigure the existing once if needed.

Creating New Mappings

The software includes predefined mappings for Xbox and PlayStation (PS3/PS4) controllers. If you are using a different device, you can create a custom configuration or modify the existing one through the following steps:

  • Once the controller is connected to the computer, open the Input Device menu and select  Configure Device Mapping.

  • Select the device you want to configure from the input device list and click Configure.

Select a device from the List and Click Configure LiteWing

  • For each control function (roll, pitch, yaw, thrust), click Detect and follow the instructions to assign the correct axis or button.

Assign roll, pitch, yaw, and thrust for liteWing
  • If you need to map a function to two axes (e.g., left/right shoulder buttons), select Combined Axis Detection and follow the instructions.

Selecting Combined Axis Detection
  • After mapping all necessary functions, enter a mapping name and click Save.

  • To modify an existing mapping, select it from the dropdown, click Load, make your changes, and either:

    • Click Save (to update the existing mapping).

    • Enter a new name and click Save (to create a new mapping).

Selecting an Input Device

To select the current input device and mapping:

  • Open the Input Device menu.

  • Choose the desired mode (see below).

Selecting an Input Device for LiteWing

  • Select the input device and the correct mapping.

Have any question realated to this Article?

Ask Our Community Members