Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

M-R-VulcaN/crazyflie-link-cpp-expanded

Repository files navigation

Crazyflie C++ Lib

A library which you could include into your c++ project and run the functions in here to code yourself a program for the crazyflie. A c++ version of crazyflie-lib-python

Setup and Install

For Visual Studio Editting Best Experience

sudo apt install -y libusb-1.0-0-dev
git clone https://github.com/M-R-VulcaN/crazyflie-link-cpp-expanded.git
cd crazyflie-link-cpp-expanded

How to Run

First you must build:

mkdir build
cd build
cmake ..
make

Before you can run an example:

./example_<example_name>

File Structure Explained

Directories

src - source files for crazyflie lib classes and functions

examples - example files

include/crazflieLinkCpp - contains all header files for crazyflie lib

Build and install development version of the python binding

  1. Install vscode
  2. code <path_to_repo_directory>
  3. Install c/c++ add-on
  4. Install CMakeLists add-on
  5. Click Allow intelisense for c/c++
  6. Click Allow intelisense for CMakeLists and select unspecified compiler

Development

Repo Structure

  • src - source files for crazyflie lib classes and functions

  • examples - example files which you can run

  • include - contains all header files for crazyflie lib

IMPORTANT DATA SOURCES and REFERENCES

METHODS and ARCHITECTURE

Note: The difference between V2 and V1 is the use of 2 bytes instead of 1 to represent the ID of the param, increasing the potential size of the TOC by 256 times.

View UML

You can view the uml using this link

Set Param Protocol Structure

Set Param Value:

Send:

Byte # 2 sizeof(<param type>)
Value: <param id> <param value>
Description: Param ID The value of the param

Receive:

Byte # 2 sizeof(<param type>)
Value: <param id> <new param value>
Description: Param ID The new value of the param

Read Param Protocol Structure

Read Param Value:

Send:

Byte # 2
Value: <param id>
Description: Param ID

Receive:

Byte # 2 sizeof(<param type>)
Value: <param id> <param value>
Description: Param ID The value of the param

TOC Protocol Structure

Get Toc Item V2:

Send:

Byte # 1 2
Value: 2 <param id>
Description: Command Number Param ID

Receive:

Byte # 1 2 1 strlen strlen
Value: 2 <param id> <type code> <group name string> <param name string>
Description: Command # Param ID Param Type Group Name Param Name

Get Toc Info V2:

Send:

Byte # 1
Value: 3
Description: Command Number

Receive:

Byte # 1 2 4
Value: 3 <size> <crc>
Description: Command # Number of elements in the Toc Current Cyclic Redundancy Check value