Category: Random stuff

As 2024 comes to an end, it’s the perfect time to reflect on what we’ve accomplished over the past year. A major highlight has been our work on the Crazyflie 2.1 Brushless. We’re thrilled that it will be available early in the new year! While much of our efforts focused on refining and preparing the platform as a whole, we also introduced some standout features like support for contact charging on a charging pad, perfecting the specially optimized motors, and propeller guards to enhance safety for both users and the drone.

Finalizing the integration of the Crazyflie 2.1 Brushless into our software ecosystem and expanding its documentation were key steps in preparing for its launch. These efforts ensure compatibility, improve the user experience, and make the platform more accessible to the community. We’re looking forward to a smooth launch and to seeing how the community will utilize the new platform!

This year, we introduced updates to the Crazyflie 2.1 kit, making the 47-17 propellers the new default and including an improved battery. These upgrades enhance flight performance and endurance, culminating in the release of the Crazyflie 2.1+—an optimized iteration of our established platform.

The Crazyflie 2.1 Brushless featured on the cover of Science Robotics vol. 9, no. 92

Community

In 2024, Bitcraze had an action-packed year, engaging with the robotics community through numerous conferences, workshops, and live events.

In May, we attended ICRA 2024 in Yokohama. We collected several research posters that now proudly feature at the office. Kimberly presented at the Robotics Developer Day, where she won Best Speaker Award for her impressive live hardware demos with ROS2. We co-organized the ‘Aerial Swarm Tools and Applications’ workshop at RSS 2024 in Delft. Arnaud and Kimberly shared insights on demo-driven development on an episode of OpenCV Live!. Additionally, we had a booth at ROSCon ’24 in Odense, connecting with the vibrant ROS community and showcasing our latest developments.

And don’t forget the developer meetings, where we shared some more behind the scenes information and collected invaluable feedback from the community.

We also released a new edition of our research compilation video, showcasing some of the coolest projects from 2023 and 2024 that highlight the versatility and impact of the Crazyflie platform in research.

Team

In the past year, Bitcraze saw significant changes within the team. in February, Rik rejoined the team. Tove started at Bitcraze in April. Mandy, with whom we’ve already worked extensively over the years, joined as our production representative in Shenzen. At the end of the year, we said goodbye to Kimberly, whose contributions will be deeply missed. Additionally, we had Björn with us for a few months, working on his master’s thesis on fault detection, and Joe continued his industrial postdoc at Bitcraze that began in December 2023. Looking ahead, Bitcraze is hiring for two new roles: a Technical Sales Lead and a Technical Success Engineer, to support our ongoing projects and customer collaborations.


As we close the chapter on 2024, we’re proud of the progress we’ve made, the connections we’ve strengthened, and the milestones we’ve reached. With exciting launches, new faces on the team, and continued collaboration with our community, we’re ready to soar to even greater heights in 2025. Thank you for being part of our journey!

This Christmas, Bitcraze is sending out a callout to Santa. As it turns out, one of our Brushless prototypes has a lifelong dream of becoming one of Santa’s reindeer. In a hopeful attempt to fulfill its wishes, we shot a video to prove that it’s ready for Santa’s most elite aerial team!

Imagine a tiny, determined drone with big dreams, practicing its sleigh route moves with the intensity of an Olympic athlete. Our little Brushless is proving it has what it takes to join the North Pole’s premier delivery squad.

Going through small openings, avoiding obstacles, and flying in perfect precision are skills that any good reindeer should have – but here, the Brushless accomplish this in an autonomous flight, and in a much smaller and more practical package than Rudolph and consorts.

Of course, there’s some technical magic behind this Christmas miracle. For this project, we relied on stock firmware and Python library, taking advantage of the new spiral and constant velocity features (check out the GitHub PR here). These features added variety and fluidity to the maneuvers, moving beyond straight lines and making the flight more interesting. By using the high-level commander, we took a simpler approach compared to trajectory optimization, which we’ve used in past Christmas videos. Trajectory optimization would have been far more difficult for this project due to the unique challenges of the flight path—namely its length and the need for pinpoint accuracy near obstacles and through gates.

Positioning relied on four Lighthouse base stations, which we used to manually locate the Christmas wreaths by holding the drone within each one to log their exact coordinates. This project also gave us the opportunity to further integrate the Brushless into our firmware and Python libraries, setting the stage for a smoother launch in the new year. The Brushless impressed us yet again during this project. Even though we’ve tested it extensively in the past, seeing it navigate tight gates with such precision and handle the demanding flight path reinforced just how capable it is. Working with it in this setting has made us even more excited to release it soon and share its potential with everyone.

Santa, if you’re reading this, we think we’ve found your next top reindeer recruit. You can watch the full audition tape here or below:

And if you think what you just saw is a pretty straight-forward and easy path, think again! This year’s blooper video highlights the resilience of the Crazyflie 2.1 Brushless and the fast, iterative workflow we used for this project. Since testing reliability and resilience was a key goal, we adopted a workflow that allowed for quick scripting, flying, and adjusting—often completing the cycle in just minutes. This approach made crashes more likely, especially during the spiral sections where the drone struggled to keep up and started cutting corners. While we resolved the issue by slowing those sections down, we suspect that more aggressive tuning of the Mellinger controller could have helped the drone maintain speed without cutting corners. The Brushless managed some impressive recoveries, but even minor collisions usually meant it couldn’t keep pace with the rest of the trajectory. After all the trial and error, we had a stable and reliable setup that not only performed well for the demo but also flew beautifully when we showed it to our families at the Christmas party.

Here is what our Brushless could endure during training:


Merry Christmas from all of us at Bitcraze – where even our prototypes have holiday dreams!

Hi everyone! I have a bit of news to share… I’ve decided to leave Bitcraze at the end of 2024. But not before I share with you my latest Fun Friday project that I’ve tried my best to finish up before I leave before my Christmas holiday in December.

Frankensteining the Pololu Robot with the Crazyflie Bolt

During the ROSCon talk about the lighthouse system (see the recording here), I’ve already shown a small example of how the lighthouse system could be used on other robots as well. Here you see a Pololu RPI 2040 (the hyper edition of course), with a slimmed down Crazyflie Bolt and a Lighthouse deck. The UART2 port on the Bolt (pinout is the same as Crazyflie) is interfacing with the UART0 connection on the Pololu (pinout). Then the Pololu’s 3v3 is connected to the vUSB and GND to GND (obviously), so 4 wires in total. Technically, the 3v3 port is not supplying enough power for the Crazyflie on paper, but it seemed to be enough as long as the Crazyflie Bolt doesn’t have motors connected it should be fine. But if anyone would like to do a driving-flying hybrid with this combo, you might need to check the specifications a bit closer. For now, just ignore the red low-battery LED on the Bolt, but if you see it restarting then perhaps give the Pololu a fresh set of batteries.

Since the Pololu RPI 2040 doesn’t have any wireless communication, this can be done through the Crazyflie Bolt and the Crazyradio. I’ve made an app layer variant for the Bolt to forward state estimates and velocity commands; however, it did require a bit of an extra logging variable in the firmware itself. But this allows me to control the Pololu through the CFclient! Since it’s using velocity commands, this means that the mobile app is out though, but perhaps if anyone is interested in getting this rolling, let me know. Also, the screen shows the current X, Y, Z, and yaw estimate of the Bolt transferred to the Pololu with the commands that I’ve given it.

I’d like to have connected this to a differential drive controller to make use of the position setpoints, but unfortunately the AA batteries ran out at the office and I was unable to complete this by the last day. It would have been great to use the Lighthouse positioning for this. Perhaps in the next coming months, I can try to continue with it and have my cats chase an autonomous robot around the house, who knows! If anyone is interested in playing around with this, these are the repositories/branches for both the Bolt and the Pololu:

What is next?

First of all, I’ll take a long holiday in the US, first visiting New York (first time) before I hop over to Tulsa and Santa Barbara to visit family. Early 2025 I’ll be taking a long break, or a mini sabbatical of sorts, where I plan to work on some personal projects but mostly have a breather. I haven’t had a break like this in over 15 years, and given a tough 2023, I can definitely say that I’ve deserved some time off. What will happen after, I will hopefully figure out then, but for sure I will be continuing to co-lead the Aerial Robotics Interest Group at ROS and helping out in support of the Crazyswarm2 project.

I’d like to thank my colleagues at Bitcraze for an amazing 5 years here in Malmö, Sweden, and everyone that I was able to meet through them. I’ve learned a lot in terms of joint software development, code maintenance, community interaction, and, most importantly, having fun during work. I also will never forget the support I received while I was going through cancer treatment, and for that I’m very grateful. I wish you all the best and I hope the Crazyflie continues to thrive, saving more PhD projects as it did mine. Thank you.

November is always a tough month in Sweden, when the darkness deepens and the cold begins to bite. We had our first snow last week, a sudden reminder that winter has arrived. So instead of letting the gloom settle in, we decided to turn to what makes us feel good: pretty lights, pretty trees, and pepparkakor!

I realized that, although we talked about it last year, we never fully showed our big new flight arena once it was up and running. It made an appearance in our latest Christmas video, but was actually never fully revealed before. Capturing a 110square meters space in a single photo is no small feat, but here is my best shot:

It felt the right time to make the office feel a little more wintery. It may be a little early, but we couldn’t resist the charm of festive decorations and a cozy atmosphere to brighten up the dark days. Especially now that we’re more settled into our massive flight arena – a space this large calls for many more Christmas lights! Of course, there’s more to it than just creating a Netflix-Christmas-movie vibe—we’re also gearing up for two big events: our annual Christmas party, which will be hosted here, and the filming of our newest Christmas video!

Speaking of Christmas video, that’s exactly what we’ll be diving into during our next dev meeting! We recently had a great time revisiting how we’ve used demos to guide development – if you missed that particular dev meeting, you can see it here. We thought it would be a great idea to dedicate our next session to exploring all the Christmas videos we’ve created over the years. It’s fascinating to see how our Christmas projects have evolved over time and we hope you’ll join us to reminisce about it Wednesday 11th of December at 15.00 (CET). You’ll find all the info here.

It’s been a while since I last talked about hiring! We successfully onboarded our most recent recruit, and now it’s time to start planning for the future.

One of our challenges as a team is that we’re very heavy on engineers and developers. While that’s fantastic for building products, it means we lack expertise in other important areas. That’s why we’re now shifting our focus to bringing in talent to help fill those gaps. We’ve partnered with a recruitment agency once again to help us find the right people for the job.
We’re currently hiring for two distinct roles—here’s what we’re looking for!

Technical sales lead

You will be responsible for developing and implementing sales strategies while exploring both new and existing markets. You’ll take the lead in driving sales and acquiring new customers, becoming the company’s go-to expert on marketing and sales tactics. Your day-to-day tasks will include supporting business development, optimizing sales processes, and proposing effective marketing strategies. This role is perfect for someone with a background in technical sales with a strong strategic mindset and a sense of responsibility.

You can read more about it here.

Technical success engineer

We’re looking for a Technical Success Engineer to provide our customers with technical guidance and product expertise. This role involves offering first-line support, creating documentation and tutorials, and assisting with tech-focused sales efforts. The goal is to ensure a smooth and seamless customer experience while building strong client relationships. It’s an ideal position for a “social developer”—someone with a solid technical background who also excels in communication and enjoys engaging with others.

You can read more about it here.

Both positions are full-time and based at our office in Malmö, Sweden. If you’re curious about why you should join our team, I’ve already shared some of the many reasons why I love being part of Bitcraze.

If you’re interested or have any questions, please send an email to fredric.vernqvist@techtalents.se or contact us at contact@bitcraze.se.

It’s been 2 weeks ago that we went to ROSCon ’24 in Odense Denmark as exhibitor and silver sponsor! Since it was a 2-hour train ride for us, it made much sense for us to attend this as a company and we are very happy we did. In this blog post we are sharing our experiences of the event.

The Booth Build-up and Demo

We made some changes to our well-known cage that is a must at every conference we have exhibited. Usually, it would take us a good few hours just to set up the cage alone, but we have improved the corners which improved our build-up experience quite a lot and we were done within an hour! Just in time for us to join the tours and bird of feather sessions with no stress!

All done before 11 am!

For ROSCon we prepared a more ROSflavored demo that enabled full demo control from ROS, which was based on the swarming mapping demo shown in this tutorial and the robotics developer day (see this video). Here we already hit a couple of issues that all had to do with the differences between demos for exhibitions versus one-time talk demos (see OpenCV! Live episode where we talked about demo driven development). We switched back to our usual fully decentralized autonomous swarm demo (see this blog post). Luckily, the Crazyflie could still communicate at the same time to give through the multiranger values, such that the computer could still generate the Swarm merging map while the Crazyflies were flying around avoiding each other.

Exhibition Booth

Tuesday and Wednesday were the actually exhibition days so that is when we talked with most of the people. It was a bit slow in the beginning as we were located at the end of the hall, but luckily the ROSCon passport game motivated people to go by each of the booth to get a stamp. We went a bit rogue and made our own much bigger stamp ;) but luckily it still fit as long as we aligned properly. We donated a STEM Ranging bundle as one of the prizes to congratulate whoever won this! And now they can try out this ROS tutorial ;)

Talking to people outside and inside the cage

We noticed that the Crazyflie Brushless got a lot of attention. The ability to carry more than a regular Crazyflie seemed of great interest to many of the ROSCon attendees. Moreover, the prototype of the forward-facing expansion connector (a.k.a. the Camera deck) was also a well-requested feature of the Crazyflie and has solidified our belief that the community needs something like this as well. In general, the lighthouse positioning system and the stand-alone lighthouse node were also quite well received. Luckily we were able to forward people to our accepted talk about the Lighthouse position system on Thursday

Lighthouse Positioning Talk

One of the reasons we were present at ROSCon 2024 was to gauge the interest of the general robotics community in the lighthouse positioning system. We have been using it for years for the Crazyflies, but we’d like to also evangelize its submillimeter and cost-effective awesomeness for any other platform. And there seems to be quite some interest for it! We gave a short presentation on Thursday Afternoon during the ‘ROS Tooling & Testing’ session (we will share the recording once it becomes available).

Talk about Lighthouse Positioning – Taken by Dharini Dutia from Women in Robotics

We also send out some polls just to see what kind of positioning systems are used and for what purpose. It was evident that there are many outdoor roboticists that also use onboard-sensing based state-estimation like SLAM, but there was still a significant portion of people that used indoor positioning systems for the actual positioning replacement and/or Ground truth. And also we got some valuable feedback, like if it would still work out with a Lidar or Kinect, or if it is suitable for a 12-meter size robot (wow). We will take this all in for improvements for any new upgrades to the lighthouse deck and stand-alone nodes for it. Thanks to you all for providing all the feedback and the interest!

Side-events

We also attended a couple of events related to ROSCon 2024. Marcus and Kimberly both attended tours of Odense Robotics, Universal robots and Teradyne facilities. The tour of the SDU Drone Center was particularly impressive. Moreover, we also attended the Aerial Robotics Meetup, who attracted about 90-100 people at the max, with drinks and snacks provided by Dronecode Foundation. It was great to see such a big aerial presence at ROSCon. There was also the Karaoke meetup, the ROSCon afterparty by Odense Robotics with a beer-serving robot arm, the Women in Robotics lunch… there was just too much to attend to but it all was a great success!

Check out the ROSCon 2024 event page on our website of what we have shown at ROSCon 2024 and see more information about the demos/products we had there.

We have some very busy weeks behind us and ahead! As we are working hard on releasing the new CF Brushless, we have been preparing for the upcoming ROSCon in Odense Denmark next week (see this previous blogpost) and we also featured on the latest OpenCV live episode as well! So more about both in this blogpost.

OpenCV Live! Demo Driven Development

We were featured as guests on the latest OpenCV Live! episode hosted by Phil Nelson and Satya Mallick, where we went through a bit of the history of the start of Bitcraze and all of the (crazy) demos done with the Crazyflie in the last decade. We have done a similar topic for our latest developer meeting, but for this episode we put the focus more on vision based demos, since OpenCV has been definitely used in the past at Bitcraze for various reasons! Just type in OpenCV in the top right search barto check out any of the blogs we have written.

During the OpenCV live episode of the 10th of October, Arnaud and Kimberly told the backstories of these demos that went from a manual flight fail where Arnaud flew the Crazyflie 1.0 in Marcus’ hair, using OpenCV and Aruco markers for positioning to flying a swarm in your kitchen. It was really fun to do and alos one lucky listener managed to answer the two questions the host Phil asked at the end, namely “Where does the name Crazyflie come from?” and “Why is the last part (‘-flie’) spelled this way?” and won a STEM ranging bundle. If you’d like to know the answers, go and watch the latest OpenCV! Live episode ;) Enjoy!

ROSCon – What to expect?

So next week we will be present as Silver Sponsor at ROSCon Odense, namely on Monday 21th and Wednesday 23rd of October. The Bitcraze booth will be located on number 21 so that should be near the coffee break place! We will have are old trusty cage with some upgrades with a nice ROS demo which is similar to the one explained in this Crazyflie ROS tutorial we have written a while ago, but then the swarming variant of it. We also hope to show a Brushless Crazyflie Prototype, and a new camera deck prototype, along with anything else we can find lying around at our office :D.

Moreover, Arnaud will be given a presentation on the lighthouse positioning system, namely at Wednesday 23rd of October 14:40 (2:30 pm) called ‘The Lighthouse project: from Virtual Reality to Onboard Positioning for Robotics’. The lighthouse positioning system will also be the system that we will demo at our booth so if you’d like to see it for yourself, or perhaps (during downtime) hack around together with us, you are more than welcome to do so! Check out the Bitcraze ROSCon Eventpage for more details about our demo or the hardware we will show.

There is one thing that has driven both the hardware/software and our enthusiasm forward in the last 13 years, and that is making demos! Whether it’s a new piece of hardware/deck for the Crazyflie or the integration with an existing software framework, it doesn’t matter, but we have got to show it and, by all means… it needs to fly!

We have used fairs, conferences, and online meetings as perfect opportunities to push the capabilities of the little Crazyflie to the fullest. Of all the development goals we set, those self-made deadlines and over-ambitiousness have pushed both the hardware and software to the limit. In this blog post, we will take a look back at all of those demos we’ve done in the past and what we have learned from them.

2013 – 2017: Hacker and Developer Fairs

One of the very first conferences we were invited to was Devoxx in the UK. This was back in 2013, and we flew the Crazyflie (1) with an FPV camera over the actual crowd (blogpost, video), which was something we had already been working on for about half a year before showing it at the conference (blogpost, video). A year later, at Devoxx France (2014), they let us fly at the actual exhibition and over the booths, which showed much better quality (blogpost, video)! Not sure if they would still let us do this at fairs, but back then it was a bit of a wild west :D.

By the time the Crazyflie 2.0 was released, we started going to Makerfaires and even visited 3 of them, all in 2015! At the Makerfaire in the Bay Area (blogpost), New York, and Berlin (blogpost 1, blogpost 2), we prepared an external positioning system with the Kinect 2 and augmented reality markers (ArUco) (blogpost). That was one hectic year, and not without issues with the demo itself along the way (blogpost), but it showcased the Crazyflie and pushed the Crazyflie Python library and client to a more mature state.

Once 2016 came, the ultra-wideband positioning hacks reached a point where we could start demoing them as well. At first, the positioning was still calculated offboard with a ROS(1) node and transmitted to the Crazyflie, which was first showcased at Makerfaire Berlin 2016 (blogpost, video) at the booth itself. Eventually, a live demo was given at FOSDEM 2017 in the actual devroom for Embedded, Mobile, and Automotive (talk page). The Flowdeck was also in development at that time, and we had a small tabletop demo at Makerfaire Shenzhen 2017, where people could press a button, and the Crazyflie would take off, fly a circle, and land again (blogpost, video).

2017 – 2019: Academic Robotics Conferences

From 2017, we made it a habit to also meet with our research users, so we started going to academic robotics conferences as well, starting with ICRA 2017 in Singapore. Here, we showcased the Loco Positioning System, where the positioning was estimated onboard, so no external computer was required to perform the calculations (blogpost, video).

At IROS 2018, we took it up a notch by joining our collaborator Qualisys, showcasing the Loco Positioning System for a swarm, Motion Capture-based localization, and the brand new Lighthouse positioning prototype (blogpost 1, blogpost 2). We also added autonomous charging to it as well, so it was a great deal of work! Maybe we took on a bit too much, but one thing is for sure—we learned a lot by doing it (blogpost 1, blogpost 2, video)! With ICRA and IROS 2019, we perfected the circling swarm demo so that it was fully autonomous. However, this time we only used the Lighthouse positioning system since it was a bit easier to set up (blogpost 1, blogpost 2, video). The computer still had to command which Crazyflie to start flying, but other than that, we didn’t have to mind it that much and had plenty of time to talk with the users.

2020 – 2022: Covid and the Home Lab

As everyone knows—and probably tries to forget—2020 was the year that Covid hit us hard, and we couldn’t travel anywhere anymore. For us, it was quite an adjustment period, as we had to find another type of motivation to keep moving forward and continue development. We introduced the concept of the home lab and gave online talks and tutorials to still show cool stuff with the Crazyflie to the world (blogpost, video).

In 2020, we all joined together to work on the Hyper demo, which was a showcase that demonstrated the Crazyflie could fly with three positioning systems at the same time, enabling it to fly all the way from the meeting room to the flight arena (blogpost, video). We also celebrated Bitcraze’s 10-year anniversary with the BAM Days, a full 3-day online seminar about all things Crazyflie, for which we and our collaborators prepared a whole range of different demos, including a Rust-based app layer example and a peer-to-peer onboard swarming example (blogpost).

2022-now: Back to conferences

At the end of 2022, we managed to go to fairs again, namely IMAV and IROS 2022, where we showcased the fully autonomous swarm demo as before Covid hit. However, due to the demos we conducted during Covid, we also added full onboard peer-to-peer communication. This enabled the Crazyflies to negotiate which Crazyflie could take off, which pretty much completely eliminated the need for an external computer. Moreover, the Crazyflies communicated their positions to each other, which made it possible for them to avoid collisions on the fly (blogpost, video).

We have shown this demo as well for ICRA 2023 in London (blogpost) and ICRA 2024 in Yokohama (blogpost) with different variations and the upcoming brushless version as well (blogpost). The demo is quite robust, but it’s great to learn about the quality of the new motors and props, the guard prototypes of the Crazyflie Brushless, and the flight stability. But as you know us by now, it is time for something different!

Soon – ROSCon 2024

We have been to ROSCon before, back in 2022 (blogpost), but now we will be going to ROSCon 2024 for the first time as exhibitors (blogpost). ROS is a framework that is used by many researchers, including our users through Crazyswarm2, but ROSCon is more developer-oriented, and there will be more companies present that focus more on industry than academia. This time we won’t show our swarm demo as we usually do, but we will be showing demos more in line with what is presented in the ROS skill learning session of the robotics developer day (blogpost, video), but we will be hacking around on the spot! So this will be something new for us to try out, and we are very much looking forward to it!

Developer meeting, 9th of October 2024

This blog post only represents a subset of demos that we have done, but we will go into further detail at the next developer meeting on Wednesday, the 9th of October, at 3 PM CEST! Please join us to learn about all the great demos we have done in the past, get a glimpse of the history of Bitcraze, and discuss why demo-driven development is so important in moving your development forward.

Check for information on how to join the meeting here on discussions: https://github.com/orgs/bitcraze/discussions/1565

See you there!

As you might expect, we use the Crazyflie python client a lot at Bitcraze. The client has a lot of features, ranging from setting up LPS/Lighthouse systems to turning on/off the headlight LEDs on the LED-ring deck. But some of the features we use the most is probably the console view as well as the logging/parameter subsystems. A lot of the time we modify firmware, flash it and want to tweak (via parameters) or to check if the changes are working as expected (via the console or logging). Then switching from the terminal, where we build/flash, to the Qt UI in the Crazyflie python client can be a hassle if you just want to do something quick. It would be great to be able to log/set variables directly from the terminal, well now you can!

Meet the Crazyflie command-line client, a fun Friday project I worked on a while back. The CLI is written in Rust and was made possible thanks to a previous fun Friday project by Arnaud on the Rust Crazyflie link/lib, which has now moved to the official Bitcraze repositories. The CLI project is still very limited, but has some basic functionality:

  • Scan for Crazyflies and pre-select one to interact with
  • List loggable variables, create log configurations and print their value
  • List parameters and get/set them
  • Show the Crazyflie console

Last week the first version, v0.1.0, was released on crates.io. So if you have Rust set up on your computer and want to test it out then all you need to do is to type “cargo install cfcli“. The CLI still only has some basic functionality, but hopefully it can be expanded in the future with more useful things! Feel free to leave any issues or comments you might have on the Github page.

You might remember that at the beginning of this summer, we were invited to do a skill-learning session with the Crazyflie at the Robotics Developer Day 2024 (see this blog post) organized by The Construct. We showed the Crazyflie flying with the multi-ranger deck, capable of mapping the room in both simulation and the real world. Moreover, we demonstrated this with both manual control and autonomous wall-following. Since then, we wanted to make some improvements to the simulation. We now present an updated tutorial on how to do all of this yourself on your own machine.

This tutorial will focus on using the multi-ranger ROS 2 nodes for both mapping and wall-following in simulation first, before trying it out on the real thing. You will be able to tune settings to your specific environment in simulation first and then use exactly the same nodes in the real world. That is one of the main strengths of ROS, providing you with that flexibility.

We have made a video of what to expect of the tutorial, for which you should use this blogpost for the more detailed instructions.

Watch this video first and then again with the instructions below

What do you need first?

You’ll need to setup some things first on the PC and acquire hardware to follow this tutorial in full:

PC preparation

You’ll need to install ROS 2 and Gazebo simulator maintained by the Open Robotics foundation on an Ubuntu machine.

  • Ubuntu 22.04 on a 64-bit x86 device (no ARM)
  • ROS 2 Humble – Install it via these instructions
  • Gazebo Harmonic – Install via these instructions This is not the recommended Gazebo for humble but we will install the specific ROS bridge for this later. Just make sure that you don’t have gazebo classic installed on your machine.

Hardware

You’ll need to components at least of the STEM ranging bundle

If you have any different setup of your computer or positioning system, it is okay as the demos should be simple enough to work, but, be prepared for some warning/error handling that this tutorial might have not covered.

Time to complete:

This is an approximation of how much time you need to complete this tutorial, depended on your skill level, but if you already have experience with both ROS 2/Gazebo and the Crazyflie it should take 1 hour.

If you have the Crazyflie for the first time, it would probably be a good idea to go through the getting started tutorial and connect to it with a CFclient with the Flowdeck and Multi-ranger deck attached as a sanity check if everything is working before jumping into ROS 2 and Gazebo.

Some things holds for ROS 2! It would be handy to go through the ROS 2 Humble beginner tutorials before starting.

1. Installation

This section will install 4 packages:

Make the workspaces for both simulation and ROS. You can use a different directory for this

mkdir ~/crazyflie_mapping_demo
cd crazyflie_mapping_demo
mkdir simulation_ws
mkdir ros2_ws
cd ros2_ws
mkdir src

Let’s clone the repositories in their right location, starting with simulation

cd ~/crazyflie_mapping_demo/simulation_ws
git clone https://github.com/bitcraze/crazyflie-simulation.gitCode language: JavaScript (javascript)

Then navigate to the ROS2 workspace source folder and clone 3 projects:

cd ~/crazyflie_mapping_demo/ros2_ws/src
git clone https://github.com/knmcguire/crazyflie_ros2_multiranger.git
git clone https://github.com/knmcguire/ros_gz_crazyflie
git clone https://github.com/IMRCLab/crazyswarm2 --recursiveCode language: PHP (php)

First install certain requirements as apt-get packages and pip libraries (might want to make a python environment for the latter)

sudo apt-get install libboost-program-options-dev libusb-1.0-0-dev python3-colcon-common-extensions
sudo apt-get install ros-humble-motion-capture-tracking ros-humble-tf-transformations
sudo apt-get install ros-humble-ros-gzharmonic ros-humble-teleop-twist-keyboard
pip3 install cflib transform3D Code language: JavaScript (javascript)

Also follow the instructions to give the proper rights to the Crazyradio 2.0 in this guide, but if this is your first time of working with the Crazyradio 2.0 first follow this tutorial.

Go to the ros2_ws workspace and build the packages

cd  ~/crazyflie_mapping_demo/ros2_ws/
source /opt/ros/humble/setup.bash
colcon build --cmake-args -DBUILD_TESTING=ONCode language: JavaScript (javascript)

Building will take a few minutes. Especially Crazyswarm2 will show a lot of warnings and std_err, but unless the package build has ‘failed’, just ignore it for now until we have proposed a fix to that repository.

If the build of all the packages passes and non failed, please continue to the next step!

2. Simple mapping simulation

This section will explain how to create a simple 2D map of your environment using the multi-ranger. The ROS 2 package designed for this is specifically made for the multi-ranger, but it should be compatible with NAV2 if you’d like. However, for now, we’ll focus on a simple version without any localization inferred from the map.

Open up a terminal which needs to be sourced for both the gazebo model and the newly build ROS 2 packages:

source ~/crazyflie_mapping_demo/ros2_ws/install/setup.bash
export GZ_SIM_RESOURCE_PATH="/home/$USER/crazyflie_mapping_demo/simulation_ws/crazyflie-simulation/simulator_files/gazebo/"Code language: JavaScript (javascript)

First lets be safe and start with simulation. Startup the ROS 2 launch files with:

ros2 launch crazyflie_ros2_multiranger_bringup simple_mapper_simulation.launch.pyCode language: CSS (css)

If you get a ‘No such file or directory’ error on the model, try entering the full path in GZ_SIM_RESOURCE_PATH export.

Gazebo will start with the Crazyflie in the center. You can get a close-up of the Crazyflie by right-clicking it in the Entity tree and pressing ‘Move to’. You can also choose to follow it, but the camera tracking feature of Gazebo needs some tuning to track something as small as the Crazyflie. Additionally, you will see RVIZ starting with the map view and transforms preconfigured.

Open up another terminal, source the installed ROS 2 distro and open up the ROS 2 teleop keyboard node:

source /opt/ros/humble/setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboard

Have the Crazyflie take off with ‘t’ on your keyboard, and rotate it around with the teleop instructions. In RVIZ you should see the map being created and the transform of the Crazyflie moving. You should be able to see this picture, and in this part of the video.

Screenshot of the Crazyflie in Gazebo generating a map with Teleop (video)

3. Simple mapping real world

Now that you got the gist of it, let’s move to the real Crazyflie!

First, if you have a different URI of the Crazyflie to connect to, first change the config file ‘crazyflie_real_crazyswarm2.yaml’ in the crazyflie_ros2_repository. This is a file that Crazyswarm2 uses to know to which Crazyflie to connect to.

Open up the config file in gedit or your favorite IDE like visual code:

gedit ~/crazyflie_mapping_demo/ros2_ws/src/crazyflie_ros2_multiranger/crazyflie_ros2_multiranger_bringup/config/crazyflie_real_crazyswarm2.yamlCode language: JavaScript (javascript)

and change the URI on this line specifically to the URI of your Crazyflie if necessary. Mind that you need to rebuild ros2_ws again to make sure that this has an effect.

Now source the terminal with the installed ROS 2 packages and the Gazebo model, and launch the ROS launch of the simple mapper example for the real world Crazyflie.

source ~/crazyflie_mapping_demo/ros2_ws/install/setup.bash
export GZ_SIM_RESOURCE_PATH="/home/$USER/crazyflie_mapping_demo/simulation_ws/crazyflie-simulation/simulator_files/gazebo/"
ros2 launch crazyflie_ros2_multiranger_bringup simple_mapper_real.launch.py
Code language: JavaScript (javascript)

Now open up another terminal, source ROS 2 and open up teleop:

source /opt/ros/humble/setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboard

Same thing, have the Crazyflie take off with ‘t’, and control it with the instructions.

You should be able to see this on your screen, which you can also check with this part of the video.

Screen shot of the real Crazyflie mapping while being controlled with ROS 2 teleop (video)

Make the Crazyflie land again with ‘b’, and now you can close the ROS 2 node in the launch terminal with ctrl + c.

4. Wall following simulation

Previously, you needed to control the Crazyflie yourself to create the map, but what if you could let the Crazyflie do it on its own? The `crazyflie_ros2_multiranger` package includes a `crazyflie_ros2_multiranger_wall_following` node that uses laser ranges from the multi-ranger to perform autonomous wall-following. Then, you can just sit back and relax while the map is created for you!

Let’s first try it in simulation, so open up a terminal and source it if you haven’t already (see section of the Simple mapper simulation). Then launch the wall follower ROS 2 launch file:

ros2 launch crazyflie_ros2_multiranger_bringup wall_follower_mapper_simulation.launch.pyCode language: CSS (css)

Take off and wall following will go fully automatic. The simulated Crazyflie in Gazebo will fly forward, stop when it sees a wall with it’s forward range sensor and follow the wall on its left-hand side.

You’ll see on RVIZ2 when the full map is created like here below and this part of the tutorial video.

Screenshot of the simulated Crazyflie in Gazebo mapping will autonomously wall following (video)

You can stop the simulated Crazyflie by the following service call in another terminal that is sourced with ROS 2 humble.

ros2 service call /crazyflie/stop_wall_following std_srvs/srv/Trigger

The simulated Crazyflie will stop wall following and land. You can also just close the simulation, since nothing can happen here.

5. Wall following real world

Now that we have demonstrated that the wall-following works in simulation, we feel confident enough to try it in the real world this time! Make sure you have a fully charged battery, place the Crazyflie on the floor facing the direction you’d like the positive x-axis to be (which is also where it will fly first), and turn it on.

Make sure that you are flying with a room with clear defined walls and corners, or make something with cardboard such as a mini maze, but the current algorithm is optimized to just fly in a squarish room.

Source the ROS 2 workspace like previously and start up the wall follower launch file for the

ros2 launch crazyflie_ros2_multiranger_bringup wall_follower_mapper_real.launch.pyCode language: CSS (css)

Like the simulated Crazyflie, the real Crazyflie will take off automatically and automatically do wall following, so it is important that it is flying towards a wall. It should look like this screenshot, or you can check it with this part of the video.

The real crazyflie wall following autonomously while mapping the room (video).

Be careful here to not accidently run this script with the Crazyflie sitting on your desk!

If you’d like the Crazyflie to stop, don’t stop the ROS2 nodes with ctrl-c, since it will continue flying until crash. It’s not like simulation unfortunately where you can close the environment and nothing will happen. Instead, use the ROS 2 service made for this in a different terminal:

ros2 service call /crazyflie_real/stop_wall_following std_srvs/srv/Trigger

Similar the real Crazyflie will stop wall following and land. Now you can close the ROS 2 terminals and turn off the crazyflie.

Next steps?

We don’t have any more demos to show but we can give you a list of suggestions of what you could try next! You could for instance have multiple Crazyflies mapping together like in the video shown here:

This uses the mapMergeForMultiRobotMapping-ROS2 external project, which is combined with Crazyswarm2 with this launch file gist. Just keep in mind that, currently, it would be better to use a global positioning system here, such as the Lighthouse positioning system used in the video. Also, if you’d like to try this out in simulation, you’ll need to ensure different namespaces for the Crazyflies, which the current simulation setup may not fully support.

Another idea is to connect the NAV2 stack instead of the simple mapper. There exists a couple of instructions on the Crazyswarm2 ROS2 tutorials so you can use those as reference. Check out the video below here.

Moreover, if you are having difficulties setting up your computer, I’d like to remind you that the skill-learning session we conducted for Robotics Developer Day was entirely done using a ROSject provided by The Construct, which also allows direct connection with the Crazyflie. The only requirement is that you can run Crazyswarm2 on your local machine, but that should be feasible. See the video of the original Robotics Developer Day skill-learning session here:

The last thing to know is that the ROS 2 nodes in this tutorial are running ‘offboard,’ so not on the Crazyflies themselves. However, do check out the Micro-ROS examples for the Crazyflie by Eprosima whenever you have the time and would like to challenge yourself with embedded development.

That’s it, folks! If you are running into any issues with this tutorial or want to bounce some cool ideas to try yourself, start a discussion thread on https://discussions.bitcraze.io/.

Happy hacking!