Author: Kristoffer Richardsson

The Crazyflie supports wireless communication using both the Crazyradio PA and BLE (Bluetooth Low Energy https://en.wikipedia.org/wiki/Bluetooth_Low_Energy). BLE is used with the mobile phone apps while Crazyradio PA usually is used together with a PC.

The lower levels of the radio communication in the Crazyflie is handled by the nRF51 that is capable of handling both types of communication. When using the Crazyradio we are using the manufacturers, Nordic Semiconductor, proprietary Enhances ShockBurst protocol (ESB) which makes it simple to send packages, up to 32 bytes, between each other. When communicating over BLE we are using Nordic Semis S110 SoftDevice which is a BLE stack developed by Nordic Semi to simplify implementation.

When we designed the first Crazyflie, the Crazyflie 1.0/Nano, we choose to use the nRF24L01+ that uses the ESB protocol because of simplicity, good range and low latency. Then came the Crazyflie 2.0 and we wanted BLE for mobile client support. Luckily Nordic released the nRF51 which could handle both. However there is a small drawback, both protocols can’t run concurrently and has to be interleaved. For BLE this has never been any problem as this protocol has the priority, but for ESB it means that when BLE is running there will be a small amount of packet loss.

The CRTP protocol we developed that runs on top of the ESB, handles the packet loss fairly well but as more and more Crazyflies are added we have been seeing communication issues. So last week we dived in to this problem and after some digging we understood that BLE was one of the problems. Therefor we added a switch which disables BLE as soon as a ESB packet is received. This improved the ESB connection and it now seems more stable. If you have the possibility we suggest you to get the latest from the crazyflie2-nrf-firmware master branch, try it out and give us feedback.

This change will hopefully provide more stable communication between the Crazyradio PA and the Crazyflie. From a functionality point of view, most users will not see any difference, but we would like to point out that if you have communicated with your crazyflie using the Crazyradio PA, it will not be possible to connect with a mobile phone until the Crazyflie has been re-booted. Note that a simple radio scan with the python client has the same effect and disables BLE.

2020 has arrived! We are back after a long and nice holiday and are ready for new awesome year. So what’s happening in 2020 at Bitcraze?

Frequently we will go through a hectic period of releasing new hardware and adding new features that’s followed by a period of stabilization and maintenance. Since last fall we released a number of new products and added lots of new functionality to the Crazyflie, this spring it’s time to look back, finish up and make things more stable.

First up this year is to release a few of the products we didn’t manage to get out during the fall, the AI-deck and the Active marker deck. The first batches should be ready during the beginning of 2020 and we are really excited to see what our users will do with the new hardware.

The AI-deck

Secondly we will be focusing on getting the Lighthouse deck out of Early Access. After the release last year we’ve added lots of functionality such as full pose using only a single base-station, but we’re still missing Lighthouse V2 support. In order to finish up we need to make the system easier to use and to add the V2 support.

The third thing we will be focusing on is stability and usability. We’re really happy about the ecosystem that exists around the Crazyflie platform. With lots of hard work and help/contributions from our community it’s become rather extensive over the years. But with the ecosystem and feature-set continuing to grow it’s not always easy to keep up.

The last thing we will be looking at is to continue adding more swarm-related functionality to simplify the task of flying multiple Crazyflies at the same time. Some of the features we’ve been discussing are: improved positioning, improved communication, drone health, trajectories and so on.

In order to handle the growing product portfolio and Crazyflie platform we’ll also continue growing the team during 2020. Hopefully there will more news on this already during the coming weeks :-)

With a long list of new customers, a growing ecosystem and lots of interesting things to come, we’re really looking forward to an exciting and fun year at Bitcraze! Oh, and as always there’s a few new hardware prototypes cooking… Happy New Year!

2019 is coming to an end and we are soon flipping the calendar to a new year. This is the last blog post of 2019 – time to look back and recap what has been going on during the year.

Community

We have had quite a few blog posts by community members this year. It is exciting for us to hear about the cool things our users are doing with our products, and we are happy to share them with all of you. If you have not read them yet and you might have some spare time during the holidays, it is well worth the time spent!

During 2019, we have also attended a number of conferences and events, where we have met a lot of interesting people, heard about amazing projects and got feedback from users. We attended FOSDEM (Belgium), ICRA (Canada), IMAV (Spain), ISRF (South Korea) and finally IROS (China).

Software

There have been quite a lot of improvements to the software in the Crazyflie ecosystem. Apart from bug fixes there has been some restructuring to simplify modifications and increase the utilization of system resources. The Crazyflie firmware has also been generalized to support multiple hardware platforms. We have added an app layer, Peer 2 Peer communication and support for new decks (see below).

The community has been buzzy contributing new and improved functionality as well as bug fixes to the software stack. Just to mention a few: support for new sensors, improved positioning support, better logging to SD-card, improved communication, new controllers and compressed trajectories. We can not express how grateful we are, thank you all!

Hardware

There have been quite some work on new hardware as well during 2019. We kicked the year off by releasing the two new platforms: the Crazyflie 2.1 and Roadrunner, and finished it by the recent release of the Crazyflie Bolt.

On the deck side there has been a focus on positioning support in the Passive– and Active marker decks that we have released in collaboration with our friends at Qualisys. The Lighthouse deck also falls into this category, we are excited about the performance and have high hopes of future awesomeness when it leaves Early access!

We have put a lot of work into the AI-deck during the year. Unfortunately we did not manage to finalize it 2019, but hopefully it should not be too long into 2020 until it is available in the store.

Documentation

Documentation is always hard, especially when the system is spread over many repositories. We have moved a fair amount of our documentation from the wiki to the code repositories to keep it closer to the code, and hopefully make it easier to keep it up to date. The documentation is now also published on the web to make it easy to access.

Logistics

We have tried out various 3d party shipping solutions earlier, but have settled on shipping our selfs, from our own warehouse in Sweden. This give us better control of the process and we have made a number of improvements and automated as much as possible to keep it lean and smooth.

Bitcraze

It has been an intense year for the Bitcraze family. We have moved to a new office with much more space and opportunities. It has required quite some work to set up labs, flight arena and other areas to our liking, but finally we have settled in and are very happy with the result!

Björn decided to leave the company in the beginning of the year, but on the other hand Kimberly joined in May! We have also had the great pleasure of hosing interns Victor and Zhouxin during the year.

Kimberly McGuire

On the system side, we have revamped our server platform for web, forum, wiki and internal services and are now using kubernetis. We also had a rapid increase in spam on the forum during the summer, but managed to counter it with better anti-spam tools.

Conclusions

It is a good exercise to look back and remember what we have done during the year. We are equally surprised each time we do this and realize all the things we have managed to squeeze in, only being 5 persons in the company! It has been yet another hectic year, but full of happiness and excitement.

Thanks for an awesome year!

This week we are exhibiting at IROS in Macau. We are running our fully autonomous demo based on the Lighthouse positioning technology and charging pads. We also have brought some prototypes to show, for instance the Crazyflie Bolt, the AI deck and the Active marker deck. You can read more about the demo at the IROS 2019 page.

We’d love to hear what you are working on, discuss issues, possibilities or new products. If you are at IROS, drop by our booth (B34) and say hi!

Lighthouse yaw

We have not only prepared for IROS, we have also been working on improving the lighthouse positioning system. Recently we added a (slightly hackish) solution for updating the yaw with data from the Lighthouse deck. This means that it is not necessary to start the Crazyflie facing the positive X direction when using the Lighthouse deck. The Crazyflie will understand its heading and act accordingly.

Two Crazyflies facing a random direction, take off and rotate to yaw=0.

We are also working on integrating the Lighthouse deck in a better way in the kalman filter. If everything goes according to plan, it will enable a Crazyflie to fly with only one base station, and be more robust when using two base stations.

We are happy to announce that we have made new official releases of a number of our software components. The name of the release is 2019.09 and we have outlined the main changes below.

Crazyflie/Roadrunner firmware

  • Added support for the Crazyflie Bolt
  • Improved support for external positioning systems
  • Basic support for the Lighthouse positioning system
  • Added support for the Active marker deck
  • Improved debug support
  • Improved uSD card logging functionality
  • Bug fixes

For more details, please see crazyflie-release, crazyflie-firmware and crazyflie2-nrf-firmware.

Download the release package that you can flash with the client from crazyflie-release.

Python client and library

  • Basic Lighthouse support
  • More examples
  • Bug fixes

For more details, please see crazyflie-lib-python and crazyflie-clients-python. Note: the version of the crazyflie-lib-python is 0.1.8.

The Windows build of the python client has unfortunately been delayed but will be available soon.

LPS Node firmware

  • Improved menus
  • Bug fixes

For more details and download, please see lps-node-firmware




Kimberly and Arnaud is at IMAV in Madrid this week. Drop by the booth and check out the demo.

We have referred to Fun Fridays in a number of posts in this blog, but recently realized that we never described what it is about. Hopefully that will be rectified in this post.

Light painting

The concept is simple: on Fridays we do what ever we want to, as long as it is fun, interesting and (at least remotely) connected to Bitcraze. It might be trying out a new technology, play with a new sensor, create new functionality, design a prototype board or similar. Our belief is that playing is key to being creative and that creativity is beneficial to the employees as well as to the company.

There are many other companies that have similar concepts, though most of them might not go as far as reserving 20% of the time for it. For us this was a simple choice since we’re all really passionate about technology and like to explore new things.

We’ve tried to implement this in previous work environments and also talked to other companies about it. Most of the time it comes down to two things, trust and money. The concern that employees will not do useful things and this will waste company resources (i.e money). For us this isn’t really an issue. First of all we work in a way where everyone is involved and takes responsibility for the company, so we trust everyone on the team. Secondly the idea behind Bitcraze is to create a workplace where we want to work. The idea has never been to optimize on profit but instead create a sustainable company that shares the values and direction of the team.

Even though we do not prioritize higher profits, it turns out that time when employees can make their own choices are very good from a business point of view as well. It has been said that 3M has a similar concept where they invest 15% of the time into “free” projects, and that 85% of the revenue today comes from these projects!

Playing with Crazyflie 2.1 choreography with Lighthouse positioning

Looking back it has also been a good deal for Bitcraze, a lot of our products (actually most of them) and internal systems have been started on Fun Fridays. A few examples are the LPS, the Lighthouse and the Multiranger deck as well as the Bolt. There is also a (large) number of prototypes in our drawers that never made it into products, not to mention the happiness it has created!

We have briefly mentioned the Active marker deck earlier in our blog and in this post we will describe how it works and what it is all about.

The Active marker deck is a result of our collaboration with Qualisys, a Swedish manufacturer of high end optical tracking systems. Optical tracking systems are often referred to as motion capture (mocap) systems and are using cameras to track markers on an object. By using multiple cameras it is possible to calculate the 3D position of the markers and the object they are attached to with very high precision and accuracy. It is common to use mocap systems in robotic labs to track the position and orientation of robots, for instance quadrotors.

Passive markers

The most common marker type is the passive marker, that is reflective spheres that are attached to the robot. By using infrared flashes on the cameras, the visibility of the markers is maximized and it makes it easier for the system to detect and track them. We are selling the Motion capture marker deck to make it easy to attach markers to a Crazyflie.

To get the full pose (position, roll, pitch, yaw) of a robot, the markers must be placed in a configuration that makes it possible for the mocap system to identify the orientation. This means that there must be some asymmetry in the marker positions to understand what is front, back, up, down and so on.

With a swarm of Crazyflies, unique marker configurations makes it possible to distinguish one individual from another and track all drones simultaneously. With a larger number of robots it becomes cumbersome though to place markers in unique configurations, and one approach to solving this problem is to have known start positions for all individuals and keep track of their motions over time instead. This solution is used in the Crazyswarm for instance and all Crazyflies can use the same marker configuration in this setup. Another approach is to make it possible to distinguish one marker from another, enter the Active marker deck.

Active markers

It is possible to use infrared LEDs instead of the passive markers, this is called active markers. The LEDs are triggered by the flash from the cameras and they are easily detected as strong points of light. Since they are emitting light they can be detected further away from the camera than a passive marker and the smaller physical size also keeps them more separated when they are far away and only a few pixels are available to detect them in the camera.

Furthermore Qualisys has a technology that makes it possible to assign an id to each marker and that enables the tracking system to identify individual markers and thus uniquely identify individuals in a swarm. With different IDs on the markers, there is no need have asymmetrical configurations and the marker layout can be the same on all drones. It also reduces the risk of errors in the estimated pose, since there is more information available.

The deck

The Active marker deck is designed to go on top of the Crazyflie and has four arms with one LED each. The arms are as long as possible to maximize the signal/noise ratio in the cameras, while still short enough to be protected from crashes by the motors. There is a STM32 F0 on the deck that takes care of the LEDs and handling of IDs and the main Crazyflie CPU does not have to spend any time on this.

The status of the deck is that the hardware is fully functional (we might want to move something around before we produce it though) and that there is a basic implementation of the firmware. IDs are assigned to the markers using parameters in the standard parameter framework in the client or from a script.

We will start production of the deck in the near future and it will be available in the store this autumn. Qualisys added support for rigid bodies using active markers in V2019.3 of the QTM tracking software.

We have so many interesting things we want to do, but too little time to do it. Now we are looking for more talented people to join our team to help us create awesomeness!

We don’t have a clear description of exactly what we are looking for but there are some properties that we think are important:

  • You are interested in technology
  • You are passionate
  • You want to learn new things and evolve your skills

Head over to our jobs page for more information.

The High-level Commander has been part of the Crazyflie firmware since the 2018.10 release. In combination with a positioning system, it can fly the Crazyflie along a trajectory that is either defined in the firmware or uploaded through the python lib. It originates from the Crazyswarm project and we have used it in various demos since it is possible to make trajectories that are very fluid and looks really cool. The trajectories are defined as 7th degree polynomials describing segments executed one after each other.

The controller gives full control of position, velocity, acceleration and jerk, the only problem is that it is non-trivial to generate the polynomials. We have wanted to simplify the creation of trajectories for a long time and have finally had some time to play with it. In this blog post we will describe how it can be done with Bezier curves and show some examples.

Each segment in a High-level commander trajectory is defined by four 7 degree polynomials, one for x, y, z and yaw. There is also a scaling parameter that tells the controller the time scale to use when executing the segment. Using polynomials of degree 7 makes it possible to design trajectories that are continuous in position, velocity, acceleration and jerk when changing from one segment to the next, which is important to get a smooth and controlled flight.

Bezier curves are common in many graphics applications and are probably known to most users. They are parametric curves defined by control points, usually three or four. Bezier curves can also be expressed as a polynomial, and this is what we will use in this case. To get a correct mapping to the desired polynomials we need some more control points and will use 8 per segment. The basic idea is to define the trajectory as Bezier curves and make sure the control points are placed in such a way that the continuity requirements are satisfied.

Bezier curve with 8 control points

On this page from University of Cambridge, there is a good explanation on continuity across the joins between curves and formulas for c0, c1 and c2 continuity. We also need c3 continuity which can be calculated in the same manner

With these formulas it is possible to set the handles of the Bezier curves to make sure we get a smooth ride.

We have added a python example that implements the ideas above. You can find it in crazyflie-lib-python/examples/positioning/bezier_trajectory.py. The design is based on Nodes that represents the connection points between bezier curves (called Segments). The Nodes has a set of handles that are shared between the Segments that use the Node. If not all handles are set the implementation will set them to appropriate values, see the comments in the code for more details. The Node API only allows the user to set handles on one of the Segments, the handles for the other segment are automatically set to generate a continuous trajectory.

The example uses nodes in the corners of a square and contains three parts:

No velocity in the nodes. The Crazyflie stops in the Nodes. Similar to calling go-to in the HL commander.
Velocity in the nodes. A fluid motion all the way around.

Velocity in the nodes. A fluid motion all the way around.

A bit more aggressive settings to get a little action.

Finally a video showing the full sequence, we use the Lighthouse for positioning.

As mentioned earlier, we will be attending ICRA 2019 and have started to work on the demo that we will run in our booth. The main features we are going to show this time are the Lighthouse positioning deck and the Crazyflie 2.1.

One Crazyflie flying and 5 re-charging on their pads

Running a demo with flying Crazyflies at a conference, usually means a lot of work with changing and charging batteries, starting demos and so on. This takes time and leads to less time to talk to all the interesting people that visit our booth. This year we are aiming at making the demo as fully automated as possible. We will have 8 Crazyflie 2.1 with Lighthouse and Qi charger decks, each with a charging pad. A computer will orchestrate the Crazyflies and make sure one is flying at all times while the others re-charge their batteries. When the battery of the flying Crazyflie is depleted it goes back to its pad while another one takes over.

Most of the functionality is implemented in the Crazyflie firmware and it is pretty much autonomous after the trajectory is started. It will fly the trajectory over and over until it is low on battery, when it goes back to where it started from for recharging. Even though the Lighthouse positioning is very good, it sometimes slips off the charging pad when landing, so we have added a reposition feature to take off again and land if it is not charging after landing.

The orchestration computer (we call it the Control tower) is just keeping track of the state of the flying copter and starts a new one when the flying one goes back the the pad.

We are reusing the spiral trajectory from IROS last year and it has the property that it is possible to run up to 4 copters at the same time without colliding, if they are started at the correct times. There is a swarm feature in the Control tower that runs up to 4 Crazyflies with continuous replacements. The chargers are not fast enough to keep it going and it does not work as expected every time, but it is exciting with a few more Crazyflies buzzing around!

There are some bits and pieces left to implement, like crash detection, but the demo is mostly functional. If you want to play with the (slightly hackish) code, it is available at https://github.com/bitcraze/crazyflie-firmware-experimental/tree/icra-2019

You can find us in booth 101 at ICRA 2019, May 20 – 22. Drop by and say hi, check out the demo and tell us what you are working on. We love to hear about all the interesting projects that are going on. See you there!