Blog

What’s better than a single Crazyflie? A swarm of them! Over a year ago our research group at the University of Southern California posted a blog post with the title “Towards CrazySwarms“, explaining how to fly six Crazyflies at the same time. Since then, we’ve expanded our fleet to 49 Crazyflies. It turns out that flying 49 requires a completely different approach. We will outline the additional challenges, and of course show a fun video!

Why is flying many Crazyflies hard? It comes down to two different categories:

  1. Communication Limitations: The standard Crazyflie software does not support controlling more than one crazyflie per radio. Putting 49 radios on a PC is possible, but would cause very high latencies because the Universal Serial Bus (USB) operates, as the name suggests, serially in 1 ms intervals. Earlier, we showed that we can share a radio for two Crazyflies by using different addresses, but 25 radios are still too much to be handled on one PC reasonably. We can overcome this issue by reducing the amount of data to be transferred. However, this forces us to increase the autonomy of the Crazyflie. Instead of sending attitude control input for each Crazyflie at a high rate, we move the controller on-board and send high-level trajectory descriptions and external position information at a low-rate. In particular, we need to:
    1. Move the position controller on-board, and
    2. Be able to handle packet losses more gracefully.

    i) is relatively easy, apart from the testing and tuning. For ii) we use an Extended Kalman Filter to estimate the state on-board. This state, consisting of the position, angle, and the translational velocities, is estimated by combining the on-board sensors (gyroscope, accelerometer) with external position information. Even if we are not able to send the external position for a while due to packet drops, the on-board sensors will keep the estimated state correct for a while.
    Finally, we implemented broadcasts (rather than 1-to-1 communication between PC and each Crazyflie) and used a number of compression tricks in order to limit the required bandwidth further. We are able to broadcast the pose (position and rotation) for all 49 Crazyflies using just three Crazyradios 100 times per second. Each Crazyflie can handle several packet drops in a row before the state estimate becomes too unreliable to fly.

  2. External Position Feedback: The on-board sensors of the Crazyflie are not sufficient to determine its position, so we need some external position feedback. In academia, optical motion capture systems are frequently used. They consist of a number of specialized, synchronized, high-speed infrared cameras. Each object to track is equipped with at least three retroreflective spheres (so-called markers), which reflect infrared light sent out by the IR light sources next to the cameras. If we know the pose of all cameras, we can use triangulation to determine the 3D positions of all retroreflective markers.Traditionally, motion capture systems require that each object has a unique arrangement of markers; this allows to determine each object’s position from a single frame of marker data by searching for its unique pattern. Unfortunately,  the Crazyflie is too small to have 49 unique marker arrangements that can be reliably distinguished. To solve that issue, we put the Crazyflies at known positions initially and use their marker arrangement to track their position and pose over time, at 100 Hz. This allows us to use the same marker arrangement for each Crazyflie.

 

Putting that together (combined with an improved controller), allows us to create nice formations:

So what is next? Eventually, we will integrate our changes into the various projects (including the firmwares and the ROS driver), allowing everyone to work on and with CrazySwarms.

Have fun flieing!

Wolfgang Hönig
PhD Student
Automatic Coordination of Teams Laboratory
University of Southern California
James Preiss
PhD Student
Robotics Embedded Systems Laboratory
University of Southern California

Summertime is a good time to get outside and play :-). For a long time we have been having an assembled Turnigy tylon frame here at the office just lying around and it was time to put a camera on it and test its wings. It is not really a frame built to host a camera, and the least to put a gimbal on it but the size supports it so why not. So that is what I did, which included plenty of tape, zip-ties, drilling etc. Wouldn’t really recommend this frame and maybe that is why they quickly made a new version. I had a really hard time fitting the motors to the mounts which required getting some motor mount adapters and drilling into the aluminium mount to make them fit. To make the gimbal fit I made some wood extensions of the legs, as that was what I could find lying around. Anyway the result wasn’t that bad so I decided to give it a go. The first flight is always a bit nervous and especially with bigger quads so I took a lot of precautions and triple checked important things. The flight went well without any crash and I just used the stock PID settings when building the firmware. I flew it with the python client and a PS3 gamepad as I normally fly the CF2 and a was watching the signal strength carefully when getting far away. It will not survive a drop from 50m as the CF2 might. The basic functionality of the BiqQuad deck works well but I must admit that there are plenty more to implement before it has a rich feature set.

Unfortunately I’m not allowed to publish the onboard GoPro video I took as it captured some public areas (if I interpret the Swedish law correctly).

It is summer time and the tempo in the office is a somewhat slow as most of the Bitcrazers are on vacation recharging their batteries for future awesomeness. This weeks blog post will not contain any cool tech stuff but instead I will tell you a bit about how we work. This is a moving target as we are continuously changing and improving, but I can share a snapshot of how it works right now.

Basics

We have two basic principles that all our work is based on: self organization and continuous improvement.

Our take on self organization can be boiled down to the simple idea that no one in the company can decide what someone else must do. That is right, no one (or every one) is a boss! The result is that we have to find solutions that everyone can accept, this in turn requires complete trust and respect within the company.

Continuous improvement means that we try to become better at what we do. If we fail we try to understand why and find a better way next time. If we succeed we enjoy the success and then we try to understand why we were successful and find an even better way. The key ingredient is feedback, based on (again) respect and trust.

How we do it

Planning can be a useful tool but it can also be expensive when overused. Plans give a shared direction but the cost is that they take time to maintain, they tend to reduce agility and most likely they will be more or less wrong. We try to balance this by planning as little as possible and making long term plans less detailed. We consider planing to be a an opportunity for discussions and the actual plan as a documentation of the discussion. The discussion is more important than the plan it self.

Our long term direction is set by our purpose – the reason we go to work and invest all these hours into this project. We have tried to form one single sentence that captures this and the latest version is “Together we innovate and explore robotics”. The sentence it self is not that important but the discussions leading up to the sentence is what matters.

From the purpose we have tried to create a one year plan and a three year plan based on what we all would like to achieve in the coming years. This is very much a wish list, pretty vague. Every quarter we create a quarterly plan based on the one year plan. This is a list of areas we think are important to work with in the coming tree months, it usually does not contain very specific goals but gives us a good idea of what to do.

board

Björn at the whiteboard writing fake sticky note and looking busy

We kick off every week with a feedback and planing meeting. We look back at the previous week and investigate what we did, why we did it, the outcome and what we felt. When we have agreed on the past we turn to the future and decide what we think are the most important things to work on in the coming week. We also decide on a few experiments that we want to try out that we think will improve the way we work and increase our happiness.

We start every day with a short standup meeting to synchronise the team, understand how we can help each other and make sure we are doing the right thing.

The rest is just hard work :-)

Some inspiration

More about self organization. and what is motivating us?

 

aman_sharma

Going out of the norm for this week, this blog post is about my experience as an intern at Bitcraze. My name is Aman and I joined Bitcraze 8 weeks ago hoping to gain more experience and knowledge in quadcopter robotics while building some new connections.

Working at Bitcraze has been a breath of fresh air compared to all my previous internship experiences. From the work environment to the five brilliant guys that run this company, I believe everything was setup for me to have one of the best internship experiences. Someone was always available to help me with any concept I did not understand and even though I was just an intern, each of the guys made sure to include me in every part of the planning process. This type of inclusion, I believe, allowed me to see my role in the company and how I contributed to the overall goals.

While here, I mainly focused my work on the flight control software behind the Crazyflie. This included learning and understanding the framework behind the crazyflie, tweaking the existing firmware code to get location data, converting MATLAB code to Python that would provide location of all the anchors in a Loco Positioning setup by simply moving the crazyflie around, designing a filter that would provide more stability during flight operations during ‘Fun Fridays’ (definitely a great idea), etc. Also, with Arnaud’s help, I was able to learn how to juggle while I taught him how good peanut butter goes with bananas.

In my opinion, the reason for Bitcraze’s success and the reason it is such an amazing place to work is because of the way the company is setup. They follow a company structure called ‘self organizing’. Having never heard of it before or experienced it before, I was a bit thrown off when I first started working in this environment. Here at Bitcraze, there is no heirarchy, but, instead everyone is a leader of their own individual roles, a concept I believe allows them to solve even the most difficult of problems with ease. Once I acclimated to this, working for Bitcraze tenfolded in awesomeness. The only downside, though, you will never want to work anywhere else again.

During my experience here, I have gained a plethora of skills and have had many great experiences. Most importantly, however, I have built great relationships and learned that where you work and who you work with is just if not more important than what you work on.

PS: They love visitors here, so feel free to come and hangout with the guys!

–  Aman

Thanks!

We have enjoyed your internship a lot! You quickly adapted to our crazy way of working and became a natural member of the team, adding not only your technical skills but also your personality and new angles on what we do.

We hope we will see more of you in the future!

–  The rest of the Bitcraze team

As noted in a previous post, Mike Hamer from ETH Zurich has been implementing an Extended Kalman Filter (EKF) for the Crazyflie. The beginning of this week I am visiting Michael at ETH and we have now pushed the EKF to the Crazyflie master branch!

Visiting ETH is really nice, and it is very impressive to see the Flying Machine Arena in real life. Though, owing to the Crazyflie’s size, we do not need such a big space and can work in a more regular-sized room.

The EKF has now been added to the master branch but is not enabled by default. It is currently intended to be used with the Loco positioning system (although it should be easy enough to integrate with onboard GPS, or potentially offboard motion capture measurements). While it does fly better than the currently used, offboard particle filter for autonomous flight, it requires some care to work properly. I am going to update the wiki description for the loco positioning to document how to get started with the EKF during the week. Our hope is that through community engagement and feedback, we can continue to improve and tune the filter, now that Mike has put the basic functionality in place.

The greatest enhancement is that the Crazyflie is now able to estimate its own position, without the help of an external computer. Coupled with the onboard controller, the Crazyflie can now fly fully autonomously. I have also pushed a new example in the Crazyflie python lib that shows how to send an X/Y/Z set-point to fly the Crazyflie, allowing it to fly through waypoints.

In the near future we (Bitcraze, and hopefully, the community!) need to work on a couple of more things to make it fly even better

  • Revamp of the controller: the current controller is a position controller, splitting it in two controllers, one for position and one for velocity, would allow for a more stable flight and to finally use TheSeanKelly new PID settings!
  • Implementing TDOA positioning on the LPS would allow more than one Crazyflie to fly at the same time
  • Implementing the new commander packet in the Crazyflie, python lib and ROS driver. This will allow us to stop hacking the current commander each time we need a new functionality (such as onboard position control) — and since I have push rights, only my hacks get pushed, which is unfair ;-).

Mike will describe the Kalman filter in greater details in a future post. In the mean time we will update on the progress in the Loco Positioning mailing list.

Controlling the Crazyflie from the PC client through the Crazyradio gives you a lot of flexibility and power when it comes to coding and scripting. The drawback is that you need a computer and Crazyradio which is fine in the office, but not as convenient when flying on the go. As a part of our Friday-Fun hacks we have been working on a standalone controller with everything included to solve that problem.

I finished the first working basic prototype a few weeks ago and have done some test flying during my vacation. I (and the son of a friend) am very happy with the performance end ease of use, so I think it is time to move on and create a usable product.

standalone_controller

So far the controller is very basic, it is only two joysticks, an Arduino and a radio. All it does is to scan the joysticks and send controller packets on a fixed radio channel. Even though it is super simple I like that it is possible to just turn it on and fly, no other actions are required!

The product will have (many) more features, the question is what to add? This is your chance to be a product designer, if you have any input or wishes let us know!

Some ideas that we have so far:

  • Support other protocols to control other copters or robots
  • Arduino compatibility to make it simple to alter the functionality and behaviour
  • Expansion ports, maybe compatible with Crazyflie decks
  • USB and bluetooth low energy to use it as a generic game controller
  • A mode to use it as a Crazyradio connected to a computer over USB

We also need to come up with a name, please share your ideas!

Up until now, we’ve made our products available to customers through Seeedstudio and a number of distributors around the world. This has been a great solution since we’ve been able to focus on development of products instead of shipping packages and maintaining our own e-shop. When customers contact us and want to buy, we’ve been directing them towards local distributors where they can buy in local currency and with faster delivery times. But the last year more and more customers wanted to buy products directly from us and this has been taking up more and more of our time. The main reason has been complex purchasing procedures or local distributors not carrying the hardware the customer wants. Also if a customer starts discussing with us about what to buy, they tend to want to buy directly from us instead. Since we haven’t had a good set-up for this, we’ve been shipping packets on a case-to-case basis from our office basement (yes, the same basement where we fly with the Loco positioning). This has been very time consuming.

So, in order to optimize the sales and shipping, we’ve decided to launch our own e-shop. Our idea is that it is a complement to other distributors and the Seeedstudio Bazaar. Buying from local distributors will result in lower shipping costs and faster delivery. So we’re not aiming at replacing this, instead our goals are:

  • Have one place where we offer a full assortment of our products
  • Take responsibility for the end-to-end experience (both the purchasing and product support)

In order to service the e-shop, we’ve set up warehousing in Hong Kong, close to Shenzhen were the Seeedstudio manufacture is located. Aside from servicing the e-shop, this solution will also be used for drop-shipping custom orders, so replacing our basement packaging system.

As with most things, the more you know about something, the more you understand how complex it is. When we first started thinking about setting up our own e-shop/warehouse solution, we thought that this would probably take about a week: we evaluate a couple of solutions, select one and then just start selling/shipping. Turns out that things are more complex and this has caused a few weeks delay for the Loco positioning products since they will only be available through our shop. Now we’re hoping everything is on track, but we’re very new at this so please bare with us if there’s any hickups along the way when starting this up.

We’re opening up the store today, so you can have a look. Any feedback and comments are welcome! But as you might quickly notice, all the products are out of stock. The Loco positioning hardware as well as the other products are on their way to the warehouse, but they got a bit delayed along the way. Our best estimate is that the products are stocked at the end of the week or beginning of next week. The link to the e-shop is store.bitcraze.io.

store-launch

Here’s a photo of some of the boxes. Looks a lot like normal boxes, but these contain the Loco positioning hardware :-)

 

As summer is here, in the northern part of the hemisphere, in Sweden we like to have a bit of vacation to charge up with new energy. Thus the forward momentum will decline a bit but it also means less distraction from email requests, meetings etc. We take this opportunity to switch focus a bit and just as last year, we will put our effort in cleaning up. That means fixing bugs, improving documentation etc, things that normally doesn’t get prioritized enough.

Along with the cleanup, the Loco positioning system is still our highest priority and we work full thrust to get it in the hands of users. Hopefully we will be able to start shipping the first systems in the beginning of next week and more widely the week after that so make sure to stay tuned and sign up for the newsletter if you are interested! Have a great summer everyone!

Upcomming loco positioning indoor explorer bundle

The upcomming early access loco positioning indoor explorer bundle

The loco positioning hardware is now manufactured and we are working hard on making it available. Loco positioning is still in early access, which means that we have tested the hardware but that the software still requires some love.

One of the big features still to implement is a position stabilization and position sensor fusion in the Crazyflie. This has been worked on from two fronts in the last weeks.

Community member jackemoore has been working hard on getting the Crazyflie 2.0 with a GPS deck working with position hold. He is getting close to having a GPS position hold working but has stumbled upon some system bugs that have to be solved first. You can follow, or even better help out, with the development on the forum post.

Mike Hamer, from ETH Zurich, has started to implement a Kalman filter, based on one of his publications, for the Crazyflie 2.0 firmware. This is still very much a work in progress but the initial results look promising. Mike has found and fixed a bunch of bugs on the way, which has greatly improved the firmware quality and stability. Since it is able to fuse the position estimate with the internal sensors, the Kalman filter will pair nicely with the GPS implementation from jackemoore to add a new layer of stability, as well as with the Loco positioning system. In addition, the Kalman filter is being written in such a way that it should be easy to incorporate additional sensors into the estimate. Keep your eyes open for a blog post in a couple of weeks with more detail on the Kalman filter’s inner workings, and hopefully a fully functional Kalman filter in the Crazyflie shortly thereafter :-).

We are right now eagerly awaiting the first batch of the Loco positioning system to be done and ready for shipping. The interest for the early access release has been very encouraging and we are super happy about the attention we have received from all around the world.

We have made a new video about how to get started with the Loco positioning system that we hope you will enjoy. The video is showing the process from receiving the Loco Positioning system up to having an autonomous flying Crazyflie. The written information can be found on the wiki.