Category: Crazyflie

The Crazyflie 10DOF has a pressure sensor that can be used as an altimeter. This sensors was waiting to be used and we had many contributors implementing altitude hold/hover mode for it. We recently merged one of the best working contributions to the main branch of both the Crazyflie client and firmware so that it is now a bit easier to experiment with it. The current code is based on the work done by omwdunkley who did a great initial job and you can read more about it in his post.

The altitude-hold is another control-loop that will try to keep the copter at the same altitude by using the altimeter and the accelerometer to sense the altitude and vertical speed. This is controlled by keeping a button pressed on the game-pad. When altitude hold is activated the thrust joystick axis controls the altitude set-point and thus are used to make the copter rise or fall.

Foam on the Crazyflie 10DOF altimeter

Foam on the Crazyflie 10DOF pressure sensor

From our test in a calm pressure stable room the altitude is held at roughly ±15cm. However we had some problems when we where moving around. The Crazyflie sometimes suddenly rose and went to the ceiling. After some debugging we found that the problem was mainly physical, the pressure sensor is exposed of dynamic pressure when flying. To fix that we cut some of the foam we have in the Crazyflie box (yes that was planed all along ;-), and we stuck it on top of the pressure sensor. Doing so greatly improve the stability when flying more aggressively! (Something we kind of knew from peoples suggestions but it is nice to see it working in reality)

This functionality still require some debugging, tuning and code clean-up, but if you want to test it just grab the latest version of the firmware and client from Bitbucket. To begin with check that the altitude hold function is well configured for you joystick mapping (we found that it is best set on the shoulder button of the thrust hand). The altitude lock will be activated as long as the button is pressed. It can be pressed while the copter is flying or while it is in the ground. If pressed when the copter is in the ground, you will have to press the thrust joystick up a bit to make the copter fly higher. We also recommend to be a bit experienced with flying the Crazyflie as the altitude hold sometimes requires a quick recovery manoeuvre ;-).

Our products at the Seeedstudio Bazaar are almost out of stock. Currently there are still some 10-DOF bundles in the Seeedstudio US warehouse, but the 6-DOF is old out. Below is the estimations for when things are back in stock. If you are eager to get any of the products that are out of stock, then you can always check with our distributors. If the bundles go out of stock it is also possible to buy the 10-DOF kit and Crazyradio separately.

  • 10/6-DOF bundles and kits will be restocked mid November
  • Spare motors will be back in stock mid October

The new motors have a little neat update, the top bearing is concealed inside the motor housing. This will make it much more crash resistant from forces to the top since there is no bearing to depress. The small downside is that it might be little bit more difficult to remove hard sitting propellers.

Bitcraze bazzar stock

We have been in need of a 3D printer for a while now, in order to print parts designed by community members and also prototype new parts. After talking about it for ages we finally got around to buying an Ultimaker. For now we have mostly been playing around (printing various things found online) but our plan is also to make some models that users can print themselves. Let’s see if we run out of plastic before we get that far :-)

Below are some parts we printed. The Crazyradio cover designed by foosel and the frame designed by VGer.

Bitcraze Ultimaker

 

This Monday post we are devoting to the community development and we will try to give a short summary of what is going on there. We recently haven’t our selves had that much time to help out with this development, something we intend to change, so all credit goes to the community!

  • A port of the OpenPilot CC3D firmware to the Crazyflie done by webbn. Still under development but video already shows promising results.
  • Altitude hold functionality which is being developed in parallel by many, omwdunkley, phiamo, et. al. We hope we soon can contribute to this as well.
  • Improved thrust control which is being discussed a lot and hopefully we will soon see some ideas realized.
  • A Ruby cfclient written by hsanjuan.
  • The Android client with a lot of work from derf and sebastian.
  • The FPV implementation driven mainly by omwdunkley and SuperRoach. Omwdunkley has made an awesome HUD (Heads Up Display) which we hopefully sometime will see integrated into the cfclient. Check out the video!
We have probably forgotten some of the great development that has been going on recently and if that is the case please write a comment about it and we will update the post with it.

For the last couple of years (!) we have been discussing on and off about automatically flying the Crazyflie from a PC using OpenCV and a camera. We did a try a while ago using a PS3 Eye camera that wasn’t very successful. One of the issues we were having was detecting the distance from the Crazyflie to the camera. Another issue was a lag of about 1 second which made it impossible to control the Crazyflie using the video as input. So last week this discussion came up again and we finally decided to buy a Xbox360 Kinect. The image resolution is higher than the PS3 Eye and of course it has the ability to detect the distance from the camera to the objects it’s seeing.

Crazyflie and Kinect

The goal was to create a proof-of-concept application that shows that it’s possible as well as providing a stub for anyone that’s interested in doing more development. The application uses the normal image as well as the depth image from the Kinect to estimate where the Crazyflie is. This can easily be done by attaching a small colored ball to the Crazyflie and using a white background for flying. The images are processed and the current X/Y/Z co-ordinates given to a control loop. The control loop consists of thee PID regulators that will correct the roll/pitch/thrust that is sent to the Crazyflie to reach a X/Y/Z set-point in the image. The X/Y set-point can be selected by clicking the image or you can hold down the mouse button and drag it around. A cool feature that we would like in the future is to draw a geometric shape that the Crazyflie could follow. But there’s still a lot of work to be done with the control loop before we can achieve that.

After seeing the video you might be asking yourself where the James Bond theme music or the inverted pendulum is. Well, we are’t quite there yet and we will probably not even get near it. But still, this shows that the concept works. And for anyone that’s interested, it’s possible to do some basic trajectory planning algorithms at home with a Crazyflie and a Kinect.

For a more technical details have a look at the Kinect page in the hacks section of the wiki.

The first time we saw the video for the Leap Motion we instantly thought “Wow, we have to fly the Crazyflie with this!”. So finally last week a fresh Leap Motion landed on our desk and we went to work. We were really happy to see that there was an SDK for Linux. Leap Motion listened to the community that thought that an early release of the code was better than nothing at all. The API is very nice to work with and you can easily get metrics for you hand (like elevation and roll/pitch). So we created a Leap Motion driver in the joystick layer that replaces the normal input device, and it’s flying! We are going to be honest, at first it wasn’t that fun. It was more the concept that was very exciting. But as we flew more and more it started getting really great! There’s just something magical about it :-)

You fly the Crazyflie using a single hand. Thrust is calculated using the elevation of you hand from the sensor, so holding your hand higher means larger thrust. Pitch/roll is controlled by tilting you hand the same way you want the Crazyflie platform to tilt. So tilting your hand forward tilts the Crazyflie forward. Lastly the yaw is controlled by rotating your hand in the X/Y plane (around the Z-axis). For thrust/pitch/roll the control values are absolute, but for yaw it’s the rate that you control (just like the normal controls in the Crazyflie client).

As a safety mechanism the Crazyflie will only respond if the Leap Motion detects 4 or more fingers. So holding your fist above the sensor does nothing, but the instant you open up your hand you can start to control the Crazyflie.

The code for flying with the Leap Motion is still on a development branch but if you are eager to try it then have a look at the instructions in the hacks section of the wiki for documentation on how to get flying! The plan is to merge the Leap Motion code into the main track once we are finished with the development.

Crazyflie and Leapmotion

We are now all back from vacation, restarting the work on Bitcraze stuff. We are looking forward to play with the Leap Motion we just received…

The development is still going forward. Among other things the Android client development has greatly improved lately and we are hopefully getting closer to the first official binary release. We are also thinking of releasing a new version of the client and firmware as some functionalities and bug fix has been implemented since the last version.

After the second batch was finished we made the Bitcraze products available to distributors through the Seeedstudio Warehouse. Now we are really excited to see that our products have started showing up in distributor webshops around the globe. In order for our users to easily find local retailers we have compiled a list of distributors. There’s some lag between the time you start distributing our products until we get notified by Seeedstudio, so if you are not in the list of distributors drop us an email and we will add you.distributors

We finally got the time to clean-up the Crazyflie kicad project enough to make it publicly available.  It is not in a perfect shape but should be good enough to use and learn from. It’s a 4 layer board with signal layers on bottom and top and power planes in the middle. We have also uploaded the custom kicad-libs parts which should be placed in the same directory level as the kicad projects in order to make use of them, it also includes Crazyradio kicad parts.

It is released under CC BY-NC-SA license so you are able to use if for personal use, and please respect that. Please also give us feedback if you have some comments or find something that could be improved!

Crazyflie kicad snapshot

 

Last year we quickly hacked together a client for Android to show that it was technically possible to use the Crazyflie/Crazyradio on the platform. It worked, but it wasn’t very good. After that not much has happened, until now. Thanks to contributions being made by fredg02, Sebastian Sams and bug tickets from Sascha Heymann, the hackish prototype we did is now turning into something that is actually usable. It’s still under heavy development but there’s already some new features. Here’s a quick run-down of what’s been added:

  • An external controller can be used instead of on-screen thumb sticks
  • You can scan for Crazyflies
  • The same flight control settings that are in the cfclient are now available (i.e advanced mode, X-mode, max roll/pitch/yaw and thrust)

So the Android client works with phones and tables that support USB host or OTG. Anything else? Well, there just happens to be an Android platform that even comes shipped with an external controller…the Ouya! So if you have an Ouya and a Crazyflie you can just side-load and you are ready to go! Since we are used to the PS3 gamepad we had some issues getting used to the Ouya controller. If you have the same issue you can pair your PS3 controller with your Ouya and use it instead!

Once the software becomes more stable an APK will be released, but until then the repository with the code and issue tracker can be found here.

 copter_ouya

In order for users to be able to pilot the Crazyflie from platforms without a graphical user interface there’s now a headless client in the repository named cfheadless. It’s intended to be run the command-line and is still under development, but working.

The main reason it was made in the first place was to enable flying from the Raspberry Pi. The QT interface was very sluggish and it required all the QT dependencies to be installed. So the cfheadless client doesn’t depend on QT and doesn’t have a graphical user interface at all. For users to quickly get something working with the Raspberry Pi we prepared a pre-configured SD-card image that is based on the Raspian Wheezy. We didn’t remove anything from the image, we just added the things needed to fly the Crazyflie. It works out of the box with the Crazyradio and a PS3 controller. In order to switch to anther controller you will have to connect to the Pi and edit the configuration.

To use the image you have to edit the configuration if needed and then just connect your controller, power on the Crazyflie and lastly connect the Crazyradio. The cfheadless client will now automatically start and connect to the Crazyflie.

The image can be downloaded using this torrent or via direct download. The torrent is preferred since the direct download is limited to 6 simultaneous downloads. For more information on how to use the image have a look at the wiki page and if there’s any issues or suggestions drop by the project tracker at Bitbucker and add them. If you already have a Raspian image downloaded and running and you want to be able to use it with the Crazyflie then have a look at how we made the image or the hacks page with the original instructions.

Crazyflie and Raspberry Pi