Author: Kristoffer Richardsson

We attended the Innovation Week at Lund University on Thursday last week. Primarily we wanted to talk to students and possibly find future colleagues (yes, we are hiring) but it was also a good opportunity to get some demo time with the Lighthouse positioning system.

The demo setup. A bit blurry, sorry!

As mentioned in an earlier blog post, we are going to ICRA in May and we have started to think about what to demo. The main feature will of course be the Lighthouse deck. The setup at Innovation week also served the purpose of a first iteration for the ICRA setup.

We reused an old cage that we created for another fair a couple of years ago, built from a garden tent. It turned out to be fairly wobbly and a bit heavy (steel tubing) considering we will bring it in our luggage to Canada. We probably have to rethink the construction a bit and see if we can change to aluminium.

We put the Lighthouse base stations on tripods, which worked like a charm in our flight lab. We found that we had a lot of problems calibrating the system, not to mention flying the Crazyflie, at the Innovation week fair though. It turned out that the floor was not as stable as one might expect and that the tripods were swaying when people walked by. We solved the problem by adding a tube to the top of tripod that was pushed against the ceiling and thus minimizing the movement. Experience from the real world is always useful!

The general idea for the demo at ICRA is to automate as much as possible to give us more time with visitors. With the high precision of the Lighthouse system, it should be easy to land the Crazyflies on Qi chargers to avoid changing batteries. We hope to set up 6-8 Crazyflies where one is always flying while the others are charging, and have the possibility to temporarily fly more Crazyflies for small swarms. It is still just ideas and we will not see the end result until we are at ICRA, but it will be fun to build!

Last week was busy at Bitcraze as we moved to our new office. We packed all our tools, equipment, toys, components, stock and other bits and pieces into boxes and on Tuesday the moving truck came to pick it all up. Everything was very smooth and by lunch all the stuff had been unloaded in the new office.

Office work

Until now we have had our offices at various co-working spaces, but this time we rent a “real” office. We get a lot of more space that fits our needs better (a flight lab!) but the drawback is that we have to buy a lot of stuff that was part of the package earlier, such as furniture, printer, network, fire extinguishers, coffee brewer and lots of other things.

Painting Bitcraze green wall

We spent most of last week unpacking, buying stuff, painting and installing and we are in pretty good shape now. There are still a lot to do but the most important functionality is up and running. We even managed to ship orders in the store every day except Tuesday when we moved.

If you are in the area, drop by and say hi!

We currently have our office at The Ground, a co-working space for startups. It has been three fantastic years at The Ground, with lots of awesome people around and we have had a great time, but space is limited and we are now moving on to our own office. We have found a great place where we will not only get more office space, we will also finally have our own dedicated flight lab!

Flight lab
The flight lab

We hope the flight lab will be a useful tool for future quad copters and positioning systems, and we think it will speed up the development process and help us create even better products.

We will move to the new office February 25, stay tuned for more information.

Björn is leaving Bitcraze

We are sad to announce that Björn is leaving the company. Björn has been involved in film making on his spare time and has now decided to explore this world full time. He has been a much valued colleague and he will be missed, but we are at the same time excited on behalf of him and hope for a bright film future!

We are happy to announce that the Roadrunner soon will be available in our store. The Roadrunner is an Ultra Wide Band (UWB) tag that can be used to acquire the position of any robot or object in a Loco Positioning System, which makes the LPS work with more than the Crazyflie.

The Roadrunner

The Roadrunner started out as a joint project with a customer that wanted to track go-karts on a track, but we think it should be equally useful for tracking any robot or vehicle indoors. It is essentially a Crazyflie 2.1 with an integrated LPS deck, but stripped of all quadcopter stuff, all in a nice package. It can be interfaced through the Crazyradio and USB, but also through a UART if needed. It can be powered with anything between 4 – 17V. Since it is based on the Crazyflie 2.1 platform, all tools, libraries and clients are compatible. It also has the same expansion port which makes it compatible with existing decks and can be extended with custom hardware.

You might be curious about the name we choose? We usually name internal projects after birds and what could be a better name for tracking a car than the Roadrunner? We liked the name and decided to stick to it when releasing it as a product.

We release the Roadrunner as an Early access product since we are a bit uncertain of how it will be used. We hope to get feedback from anyone using it and improve the design if needed.

This is also the first product to be released based on our new platform concept. We will release a number of new hardware designs in the near future and the platform concept is intended to simplify managing and building firmware binaries for the different hardware configurations.

On a side note, Arnaud from Bitcraze and Fred, the maintainer of the Crazyflie android client, will be visiting FOSDEM 2019 in Brussels at the end of the month. If you want to meet us there just ping us in the comment, by mail, on twitter or on the forum.

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.

We have a collaboration with Qualisys, a Swedish manufacturer of top of the line motion capture systems. Similar to us they are a passionate about what they do, are working on high tech products and to make it even better, they are located in Gothenburg, just a couple of hours away by train. If you are not familiar with motion capture systems, it is a system that can track objects with reflective markers in space using high resolution cameras. The precision/accuracy is very good (sub millimeter) and can be used to track more or less anything such as the movements of a human body or the position of a robot, for instance a Crazyflie. The position of a Crazyflie is calculated by the MoCap system and by sending it to the drone via radio, it can fly autonomously.

Qualisys

We are super happy of getting the opportunity to work with MoCap systems and making it an integral part of the Bitcraze eco system. We have already added support in Crazyswarm for the Qualisys system and soon there will be a tab in the Crazyflie python client for basic autonomous flight using a Qualisys system. We will release a passive MoCap deck in the near future that will make it easy to attach reflective markers to a Crazyflie in a well known configuration, see this blog post for more information. Further more we are looking at making an active marker deck that utilizes Qualisys’ active marker technology to both position and identify an object at the same time.

Recently we spent a day in the large lab of Qualisys. We played with the LPS system in a larger set up and experimented with passive MoCap deck configurations and finally tried to fly a swarm.

Martin and Tobias configuring MoCap decks

Unfortunately we ran out of time and we tried to push the envelop a bit too far so we never managed to fly the full sequence without crashes, on the other hand, getting that close in a couple of hours is not too bad. Even though the full swarm did not work out we learned new things and had a lot of fun. Thanks Martin and everyone at Qualisys!

 

If you are looking for a motion capture system and want more information about Qualisys, please do not hesitate to contact us or Qualisys.

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.

We are working hard in the Bitcraze team to prepare and get ready for IROS 2018 in Madrid next week. As usual preparing for fairs and exhibitions make us add useful features and functionality that we might not had planned to implement but that we find useful or need. Even though some of it might be a bit hackish, most of it will add value to the project and will hopefully be useful to the community. Notable functionality that we are working on this time: 

  • design for a 3D-printable charging pad
  • basic support for the experimental Light House deck
  • support for the high level commander in the python lib
  • “app” for autonomous flying running in the Crazyflie

Charging pads

The plan is to fly a small crazyswarm with 6 Crazyflies using a motion capture system from Qualisys. Since we want to spend as much time as possible talking to people and minimize setup time, we were looking for a solution to automatically recharge the batteries between flights. We are planning to use Qi-charger decks for contact less charging with 3D-printed landing pads with slopes to make the Crazyflies slide into the correct charging position even if they land a few millimetres off. 

The Light House deck

Even though the Light House deck hardware still is very much experimental we have started to add support for it in the Crazyflie firmware. Hopefully we will be able to run our demos using either LPS or the Lighthouse to show the difference in performance.

Support for the high level commander in the python lib

The high level commander was contributed by Wolfgang Hoenig and James Alan Preiss (thanks!) an has been available in the Crazyflie firmware for a while. In an environment with positioning support it provides high level commands such as “take off” and “go to” as well as flying user defined trajectories and is used by Crazyswarm. We wanted to use the same functionality in our demo but running it stand alone in the firmware. The easiest way to get acquainted with the functionality was to play with it from python and as a side effect we implemented the API in the python lib for anyone to use. There is also an example script called autonomous_sequence_high_level.py in the examples directory.

App for autonomous flight

For ICRA last year we wrote code in the Crazyflie firmware to fly trajectories autonomously. At that point we simply fed setpoints to the PID controller to make the Crazyflie follow a preprogrammed path. Now we have more tools in the Crazyflie toolbox (the high level commander and the Mellinger controller) and by using them we have reduced the amount of code needed and complexity of the solution while the performance has been improved (code on github). 

We started the work on TDoA 3 in May and it has been functional for a few months, but it is a bit cumbersome to make it work since it requires compiling firmware with special flags and running scripts to configure anchors. To rectify this and make it more accessible we are now working on integrating it just like the other positioning modes; TWR and TDoA2. 

Changes

The anchors already contained most of the required functionality. We have added support to change to the TDoA3 mode via LPP, that is using the Crazyflie as a bridge between the client and the anchors, transmitting data to the anchors via UWB.

In the Crazyflie TDoA 3 has been added as a third mode. This means that it is now auto detected when the Crayzflie is switched on and it can be selected from a client – no need for compile flags any more! We have also added a new mapping to the memory sub system to transfer anchor information for a dynamic number of anchors to a client. This means that instead of being available to the client as a long list of log variables and parameters, most of the TDoA3 information and configurations are available in a memory map using the same protocol we use to access real memory like the configuration EEPROM or the deck memories. This way we have much more freedom to define and transfer the data-structure to and from the Crazyflie.

The python client/lib is the piece of software that requires most changes. The UI (and implementation) was designed to handle 8 anchors, but with TDoA3 it must support a dynamic and larger number. The new memory mapping has of course to be implemented in the lib as well. The anchor position configuration part of the LPS tab will be separated into a dialog box to get more space for the controls. We also have some ideas for improvements in anchor position configuration (saving to file and sanity checking of configurations for instance) that will be easier to implement in the future as well.

Feedback

The driver for this work is of course to make the TDoA 3 technology available to anyone that wants to try it out. It is important to remember that it still is experimental and that we have mainly tested it in single room setups with a few anchors. Our hope is that more users will use it in various settings and that we will get feedback and contributions to iron out any remaining problems. We currently lack easy access to larger spaces which makes it hard for us to verify the functionality in a system with many anchors.

The code in the firmware for the anchors and the Crazyflie is mostly ready while there still remains some work in the lib/client, hopefully it can be committed and pushed during the week (see issue bitcraze/crazyflie-clients-python#349). If you want to try it out when the client is fixed, remember to upgrade the anchor firmware (including git sub modules), the Crazyflie firmware (including git sub modules), the python lib and the python client. Since this is still work in progress APIs and protocols may change until the first official release.

The summer has been unusually long and warm here in Sweden, with a never ending sun beaming on the Bitcraze team members enjoying our vacation. As usual, at least one of us has been in the office at any given time, but staffing has been sparse. We apologise for delayed answers to emails and similar.

Even though we have been enjoying some time off, we have also managed to do some clean up of tasks that have been long over due. For instance merging pull requests and fixing a few nasty bugs (for details please see github), and implementing long overdue functionalities like being able to have more than 255 log and param variable (when the Crazyflie firmware develoment started many years ago, we though that 255 variables ought to be enough for anybody).

Everyone will be back in the office this week but we plan to continue the cleaning a few more weeks. We hope to be able to do some work on TDoA3, the Crazyradio, impementing Crazyswarm functionality in the python lib and more generally everything we normally do not have the time to do.

We have some exciting projects coming up this autumn: In October we are going to IROS where we will try demo a swarm in 2x2x2.5m, we also have quite some hardware that is now very close to be finalized that we should be able to release and start shipping before the winter.

Stay tuned for more products and blog posts!