Category: Random stuff

Another hectic year has passed. We can’t believe it’s been seven years since our first blog post. Only missing a few Monday blog posts over these past seven years makes this post #375! Kind of impressing from a bunch of nerds that rather write code instead of communicative and fun blog posts :-).

As being the last blog post of the year we can’t think of anything better then summarizing 2018.

Community

The community is one of the big motivators for us. We are very, very thankful for your support! You keep us going!

Software

  • On the Loco positioning side there has been a lot of focus on TDoA, aka swarm positioning. During the year we managed to release TDoA2 and TDoA3 as experimental. Read more about the algorithms in their respective blog post.
  • The Crazyswarm fork was merged into master, thanks again USC ACT Lab!
  • Together with Qualisys we continued the work to add support for their MoCap cameras to the Crazyflie system.
  • It might not be correctly classified as software but we released a new front page!
  • Firmware and Software release 2018.10 packs a lot of new stuff.

Hardware

Logistics

We can’t summarize 2018 without a note about the logistics problems we had which made us move the stock to our office in Malmö. Who figured it could be that hard! For those that had to wait a long time for their packages, we apologize. The good news is that it is much better now and logistics will work flawlessly in 2019!, hopefully… :-)

A few weeks ago we wrote about the release of the Multi-ranging deck and the new STEM ranging bundle.

The STEM ranging bundle is a great addition in the classroom for a wide range of students. By combining the Flow deck v2’s time-of-flight distance sensor and optical flow sensor with the Multi-ranger deck’s ability to measure distance to objects, the Crazyflie gets position and spatial awareness.

We have shot a video that shows the bundle in action!

 

To get started with the STEM ranging bundle we have created a guide for the bundle with step-by-step instructions. The code for the demos in the video are available in the example directory of the crazyflie-lib-python project:

  • multiranger_push.py: When the application in launched the Crazyflie will take off and hover. If anything is getting close to the right/left/front/back sensors the Crazyflie will move in the opposite direction. 
  • multiranger_pointcloud.py: When the application is launched the Crazyflie will take off, hover and a 3D-plot will be shown of what is detected by the Multi-ranger deck sensors. By default the left/right/front/back/up sensors will be plotted, but you can also add the Crazyflie position and the down sensor if you like. The Crazyflie can be moved around by using the arrow keys on the keyboard and w/s for up/down and a/d for rotating CCW/CW. For more info see the documentation in the example.

We love feedback so please leave some comments in the field below!

Even though we are getting closer to Christmas and hopefully some well deserved rest, there are lots of things going on at Bitcraze. This week we have collected news about various topics that we wanted to share with you.

China

Tobias and Marcus visited our Chinese manufacturer Seeed last week in Shenzen. We are trying to visit Seeed at least once a year to meet in person rather than only via the internet. 

huaqiangbei

It is always a great experience to visit Shenzen and it seems as things are moving at blazing speed over there, with amazing changes from year to year. Such as that you can now paying with face recognition in the grocery store and park you car in automatic parking garages.

Lighthouse deck

We are making progress on the Lighthouse front and we have a preliminary hardware design for the first version of the deck. There are still a lot of things to be done but we hope we will be able to order the first batch soon and that it will be available in our store the first quarter next year.

Qi charger V1.2 deck

The Qi charger deck is compatible with the Qi V1 standard. Recently we have been testing the deck with a new off-the-shelf charger and discovered that the deck was not working with the new charger. After investigating we discovered that the Qi deck is not compatible with the new Qi V1.2 chargers. We started a redesign of the board and we have now started to produce a batch of Qi deck V1.2 that is compatible with Qi 1.2 chargers. The new Qi deck will be released early January.

Roadrunner

The Roadrunner is our first stand alone Tag for the Loco Positioning System. It is in essence a Crazyflie with an integrated LPS deck but without motors and a different form factor, it was initially developed for an external project to track go-karts on a racing track. The Roadrunner can be fitted to anything that you want to track in a Loco Positioning System, a ground robot for instance. Since it is based on the Crazyflie, all the libraries and tools that are available in the Bitcraze eco-system are compatible. We plan to start selling the Roadrunner in our store in the beginning of next year.

The Crazyflie Z-ranger and Flow decks share one sensor: the VL53 ranging sensor that provides mm-precision by measuring the time of flight of laser pulses. The manufacturer of this sensor has released an improved version, the VL53L1x that works for longer distances compare to the old one. The old sensor worked for distances up to 1 meter while the new one works up to 2 meters.

The Z-ranger deck interfaces a VL53 sensor facing downwards underneath the Crazyflie, it allows to implement very precise altitude-hold by using the ranging to the floor as absolute height.

The Flow deck has both a down-facing VL53 for height measurements as well as an optical flow sensor for position measurements that allows the Crazyflie to hold its height and fly at constant velocity.

We have released both the Z-ranger V2 and Flow V2 which allows to achieve accurate altitude hold and position hold at much higher heights. With the Flow V2 and Z-ranger V2 it is possible to fly almost all the way up to the ceiling in an ordinary room!

Both decks are available in the Bitcraze online store.

In August we got invited by Marion from ETH Zurich to help out with this years PolyHack, that is organized by Telejob, and which theme was about drones. We really like this kind of events but our reality is that we normally don’t have enough time to participate. For this occasion though we had the opportunity to both have fun and see how our products work when used during an event like this. Two birds with one stone and the decision was made.  Together with one of the main sponsors ELCA, we organized the flying postman challenge:

Drones seem to be the future of post deliveries, but how is it going to work? Join us to reproduce a swarm of drones delivering parcels through a city to have a glimpse at this future!

The challenge the teams got was to deliver as many parcels within 5min in a miniature city, 4m x 4m, using Crazyflies. Since the Crazyflies can’t carry that much payload the parcels was just digital/imaginary but had to be picked up at a pick-up zone. They were allowed to use up to thee Crazyflies simultaneous to increase capacity. For more details checkout the challenge description.

To manage the challenge ELCA developed the CrazyServ which uses a REST API to control Crazyflies, wrapping the high level position commander, and to pick-up parcels. One nice benefit with a server is that it can keep track of which parcels has been picked up and been delivered making the scoring fully automatic.

Bitcraze part in the challenge was to bring drones, technical support and our loco positioning system to make up the 4m x 4m city. Or actually three of them, as there were going to be six teams competing for the victory. The initial information was that the three systems would be installed in separated rooms, far away, but we ended up having them side by side. That left us with some live-hacking, changing from TDoA-2 to TDoA-3 so the anchors would not interfere with each other. We ended up using 12 anchors in total which gave enough precision for the PolyHackers to complete their challenge.

The PolyHack was a success and we had a great time. The winning team in our challenge, Electek Innovation, managed to deliver 19 parcels during the 5min with the use of a “loop” system. Congrats and well done! If you get inspired by this hackaton the CrazyServ is available on github! Together with a e.g. swarm bundle it shouldn’t be to hard to reproduce.

Thanks Telejob for letting us take part of this great event!

 

During the fall there’s been a lot of things going on in production. Like we wrote a couple of weeks ago we’re releasing lots of new hardware during the fall and in the meantime we’re of course continuing to manufacture batches of the previous products. Unfortunately things don’t always run smoothly as one would hope. We’ve hit a few bumps in the road and we wanted to share the latest status so you know what’s going on. As always the times stated below are our current best estimate, but we’re expecting the current issues to be sorted out within a couple of weeks.

Photo by frank mckenna on Unsplash

Crazyflie 2.0 / Battery charger kits (with battery)

Due to an issue with battery sourcing the last batch has been delayed for some time. This has now finally been solved and a both of these products should be available within a few weeks, and with them the bundles that depend on them (like the Swarm bundle).

Flow deck v2

Shortly after shipping the first units customers noticed issues due to the deck connector not fully connecting all the pins. After investigating this with our manufacturer we’ve found the source of the problem: The test rig where the final testing is done was actually deforming the metallic connectors inside the female connector on some of the units. Right now the factory is re-working the effected units and as soon as they are finished we will stock the deck again. Unfortunately there’s no update yet to when the re-worked decks will be available, but we’re estimating a couple of weeks. We will contact the customers that have gotten faulty boards shortly and organize a replacement.

Multi-ranger

Finally the multi-ranger deck has been manufactured and is undergoing final testing. The deck should be available within a couple of weeks.

 

 

Last week we have been focusing on making a release for nearly all our firmware and software. This was done mainly to support the new products we will release this fall but it also contains a lot of other functionality that have been added since the previous release. In this blog-post we will describe the most important features of this release.

New Loco Positioning status and configuration tab

New deck support

The Crazyflie firmware and Crazyflie client 2018.10 adds support for a range of new decks that are about to be released:

  • Flow deck V2 and Z-Ranger V2: New versions of the flow and Z-Ranger deck that uses the new VL53L1 distance sensor. Drivers are implemented in the Crazyflie firmware and the client has been updated to allow flying up to 2 meter in height hold and hover modes when the new decks are detected.
  • Multiranger deck: Diver for the new Multiranger deck is implemented in the Crazyflie firmware, support code is now present in the lib as well as an example implementing the push demo that makes the Crazyflie fly in hover mode using the flow deck and move away from obstacles:

The Flow deck V2 is already available in our webstore. The Z-Ranger V2 and Multiranger will be available in the following weeks, stay tuned on the blog for updated information.

Crazyswarm support

During the year, functionality implemented for the Crazyswarm project has been merged back to the Crazyflie firmware master branch. Practically it means that the Crazyflie firmware 2018.10 is the first stable version to support Crazyswarm. The main features implemented by Crazyswarm are:

  • Modular controller and estimator framework that allows to switch the estimator or the controller at runtime. Practically it means that it is not required to recompile the firmware to use a different controller anymore.
  • Addition of a high-level commander that is able to generate setpoints for the controller from within the Crazyflie. The high-level commander is usable both from Crazyswarm and from the Crazyflie python library. It currently has commands to take-off, land, go to a setpoint and follow a polynomial trajectory. It is made in such a way that it can be extended in the future.
  • Addition of the Mellinger controller: a new controller that allows to fly much tighter and precise trajectories than the PID controller. It is tuned pretty tight so it is currently mostly usable using a motion capture or lighthouse as positioning and togeather with the high-level commander.

Improved and more stable Loco Positioning System

A lot of work has been put in the Loco Positioning System (LPS) this summer. The result of this work is the creation of a new ranging mode: TDoA3. TDoA3 allows to fly as many Crazyflie as we want in the system and to add as many anchors are needed, see our previous blog-post for more information. With this release TDoA 3 is added as a stable ranging mode for LPS. The added features related to LPS are:

  • Added TDoA3 as a ranging mode in the LPS-Node-firmware, the Crazyflie 2.0 firmware and the Crazyflie client
  • Revampted the Crazyflie client LPS tab and communication protocol to handle more than 8 anchors
  • Implementation of a new outlier detector for TDoA2 and TDoA3 that drastically improve positioning noise and flight quality

Release notes and downloads

As usual the release build and release note is available on Github. The Crazyflie client and lib are also available as python pip package as cfclient and cflib.

In this blog post we will describe one of the demos we were running at IROS and how it was implemented. Conceptually this demo is based on the same ideas as for ICRA 2017 but the implementation is completely new and much cleaner.

The demo is fully autonomous (no computer in the loop) but it requires an external positioning system. We flew it using either the Loco Positioning System or the prototype Lighthouse system.
A button has been added to the LPS deck to start the demo. When the button is pressed the Crazyflie waits for position lock, takes off and repeats a predefined spiral trajectory until the battery is out, when it goes back to the door of the cage and lands.
For some reason we forgot to shoot a video at IROS so a reproduced version from the (messy) office will have to do instead, imagine a 2×2 m net cage around the Crayzflie.

Implementation

As mentioned in an earlier blog post the demo uses the high level commander originally developed by Wolfgang Hoenig and James Alan Preiss for Crazyswarm. We prototyped everything in python (sending commands to the Crazyflie via Crazyradio) to quickly get started and design the demo . Designing trajectories for the high level commander is not trivial and it took some time to get it right. What we wanted was a spiral downwards motion and then going back up along the Z-axis in the centre of the spiral. The high level commander is a bit picky on discontinuities and we used sines for height and radius to generate a smooth trajectory. 

Trajectories in the high level commander are defined as a number of pieces, each describing x, y, z and yaw for a short part of the full trajectory. When flying the trajectories the pieces are traversed one after the other. Each piece is described by 4 polynomials with 8 terms, one polynomial per x, y, z and yaw. The tricky part is to find the polynomials and we decided to do it by cutting our trajectory up in segments (4 per revolution), generate coordinates for a number of points along the segment and finally use numpy.polyfit() to fit polynomials to the points. 

When we were happy with the trajectory it was time to move it to the Crazyflie. Everything is implemented in the app.c file and is essentially a timer loop with a state machine issuing the same commands that we did from python (such as take off, goto and start trajectory). A number of functions in the firmware had to be exposed globally for this to work, maybe not correct from an architectural point of view but one has to do what one has to do to get the demo running :-) The full source code is available at github. Note that the make file is hardcoded for the Crazyflie 2.1, if you want to play with the code on a CF 2.0 you have to update the sensor setting

This approach led to an idea of a possible future app API (for apps running in the Crazyflie) containing similar functionality as the python lib. This would make it easy to prototype an app in python and then port it to firmware.

Controllers

The standard PID controller is very forgiving and usually handles noise and outliers from the positioning system in a fairly good way. We used it with the LPS system since there is some noise in the estimated position in an Ultra Wide Band system. The Lighthouse system on the other hand is much more precise so we switched to the Mellinger controller instead when using it. The Mellinger controller is more agile but also more sensitive to position errors and tend to flip when something unexpected happens. It is possible to use the Mellinger with the LPS as well but the probability of a crash was higher and we prioritised a carefree demo over agility. An extra bonus with the Mellinger controller is that it also handles yaw (as opposed to the PID controller) and we added this when flying with the Lighthouse. 

Going faster

Since the precision in the Lighthouse positioning system is so much better we increased the speed to add some extra excitement. It turned out to be so good that it repeatedly almost touched the panels at the back without any problems, over and over again!

One of the reasons we designed the trajectory the way we did was actually to make it possible to fly multiple copters at the same time, the trajectories never cross. As long as the Crazyflies are not hit by downwash from a copter too close above all is good. Since the demo is fully autonomous and the copters have no knowledge about each other we simply started them with appropriate intervals to separate them in space. We managed to fly three Crazyflies simultaneously with a fairly high degree of stability this way.

Last week half of Bitcraze, Kristoffer, Tobias and Arnaud were at IROS 2018 where we had an exhibitor booth. We have had a great week and met so many interesting and inspiring people, both users of the Crazyflie as well as persons curious in what we do. Thanks to everyone that passed by the booth, it is awesome to hear how Crazyflie is used and how we can improve it even more.

This year we invited Qualisys to share the booth with us, they kindly provided a motion capture system and we had the pleasure to be joined by Martin to help us and present Qualisys.

Demo-wise we had prepared a bunch of demos which you can read about in our previous post about IROS. It won’t surprise anyone to hear that not everything has been working as planned. The Lighthouse demo did not work when we set it up in the booth (it did in the office!) but some live hacking solved the problem on Tuesday. We also had unexpected issues with the Crazyswarm demo: our landing pad design and flight trajectory was working very well in the office, but in the booth we experienced much more instabilities that prevented us to successfully fly and land all 6 crazyflies in Crazyswarm. We still need to investigate what happened. The autonomous demos, both using the UWB Loco Positioning System and Lighthouse (when fixed), have been surprisingly robust: they do not require a connection to a computer and they worked almost all the time, when they failed they failed without drama and could be reset very quickly.

Overall we have been able to accumulate flight time and experience much quicker in this last week than in the last months, now we have a lot of things to test and improve and also a lot of things we can be much more confident about. We have been fixing and improving the demo during the event and we will write more blog posts in the coming weeks about things we have developed and improved for and during IROS.

To conclude, thanks again to everyone that dropped by the booth, this kind of event always make us come back with a boost of motivation and fresh new ideas and it is all thanks to you!