CrazyS: A Software-in-the-Loop Simulation Platform for the Crazyflie 2.0 Nano-Quadcopter

  • Giuseppe SilanoEmail author
  • Luigi Iannelli
Part of the Studies in Computational Intelligence book series (SCI, volume 831)


This chapter proposes a typical use case dealing with the physical simulation of autonomous robots (specifically, quadrotors) and their interfacing through ROS (Robot Operating System). In particular, we propose CrazyS, an extension of the ROS package RotorS, aimed to modeling, developing and integrating the Crazyflie 2.0 nano-quadcopter in the physics based simulation environment Gazebo. Such simulation platform allows to understand quickly the behavior of the flight control system by comparing and evaluating different indoor and outdoor scenarios, with a details level quite close to reality. The proposed extension, running on Kinetic Kame ROS version but fully compatible with the Indigo Igloo one, expands the RotorS capabilities by considering the Crazyflie 2.0 physical model, its flight control system and the Crazyflie’s on-board IMU, as well. A simple case study has been considered in order to show how the package works and how the dynamical model interacts with the control architecture of the quadcopter. The contribution can be also considered as a reference guide for expanding the RotorS functionalities in the UAVs field, by facilitating the integration of new aircrafts. We rel5,eased the software as open-source code, thus making it available for scientific and educational activities.


Software-in-the-loop simulation Virtual reality UAV Crazyflie 2.0 ROS Gazebo RotorS Robotics System Toolbox Continuous integration 


  1. 1.
    Scaramuzza, D., Achtelik, M.C., Doitsidis, L., Friedrich, F., Kosmatopoulos, E., Martinelli, A., Achtelik, M.W., Chli, M., Chatzichristofis, S., Kneip, L., Gurdan, D., Heng, L., Lee, G.H., Lynen, S., Pollefeys, M., Renzaglia, A., Siegwart, R., Stumpf, J.C., Tanskanen, P., Troiani, C., Weiss, S., Meier, L.: Vision-controlled micro flying robots: from system design to autonomous navigation and mapping in GPS-denied environments. IEEE Robot. Autom. Mag. 21(3), 26–40 (2014)CrossRefGoogle Scholar
  2. 2.
    Stuart, M.A., Marc, L.L., Friedland, J.C.: High resolution imagery collection for post-disaster studies utilizing unmanned aircraft systems. Photogramm. Eng. Remote. Sens. 80(12), 1161–1168 (2014)CrossRefGoogle Scholar
  3. 3.
    Erdos, D., Erdos, A., Watkins, S.E.: An experimental UAV system for search and rescue challenge. IEEE Aerosp. Electron. Syst. Mag. 28(5), 32–37 (2013)CrossRefGoogle Scholar
  4. 4.
    Choi, S., Kim, E.: Image acquisition system for construction inspection based on small unmanned aerial vehicle. Lecture Notes in Electrical Engineering, vol. 352, pp. 273–280 (2015)Google Scholar
  5. 5.
    Eschmann, C., Kuo, C.M., Kuo, C.H., Boller, C.: Unmanned aircraft systems for remote building inspection and monitoring. In: 6th European Workshop Structural Health Monitoring, vol. 2, pp. 1179–1186 (2012)Google Scholar
  6. 6.
    Fraundorfer, F., Heng, L., Honegger, D., Lee, G.H., Meier, L., Tanskanen, P., Pollefeys, M.: Vision-based autonomous mapping and exploration using a quadrotor MAV. In: IEEE International Conference on Intelligent Robots and Systems, pp. 4557–4564 (2012)Google Scholar
  7. 7.
    Kamel, B., Santana, M.C.S., De Almeida, T.C.: Position estimation of autonomous aerial navigation based on hough transform and harris corners detection. In: International Conference on Circuits, Electronics, Control and Signal Processing Systems, pp. 148–153 (2010)Google Scholar
  8. 8.
    Kanistras, K., Martins, G., Rutherford, M.J., Valavanis, K.P.: A survey of unmanned aerial vehicles (UAVs) for traffic monitoring. In: International Conference on Unmanned Aircraft Systems, pp. 221–234 (2013)Google Scholar
  9. 9.
    Xu, J., Solmaz, G., Rahmatizadeh, R., Turgut, D., Boloni, L.: Animal monitoring with unmanned aerial vehicle-aided wireless sensor networks. In: IEEE 40th Conference on Local Computer Networks, pp. 125–132 (2015)Google Scholar
  10. 10.
    Anthony, D., Elbaum, S., Lorenz, A., Detweiler, C.: On crop height estimation with UAVs. In: IEEE International Conference on Intelligent Robots and Systems, pp. 4805–4812 (2014)Google Scholar
  11. 11.
    Bills, C., Chen, J., Saxena, A.: Autonomous MAV flight in indoor environments using single image perspective cues. In: IEEE International Conference on Robotics and Automation, pp. 5776–5783 (2011)Google Scholar
  12. 12.
    Blosch, M., Weiss, S., Scaramuzza, D., Siegwart, R.: Vision based MAV navigation in unknown and unstructured environments. In: IEEE International Conference on Robotics and Automation, pp. 21–28 (2010)Google Scholar
  13. 13.
    Landry, B.: Planning and control for quadrotor flight through cluttered environments. Master’s thesis, MIT (2015)Google Scholar
  14. 14.
    Ferreira de Castro, D., dos Santos, D.A.: A software-in-the-loop simulation scheme for position formation flight of multicopters. J. Aerosp. Technol. Manag. 8(4), 431–440 (2016)CrossRefGoogle Scholar
  15. 15.
    Mancini, M., Costante, G., Valigi, P., Ciarfuglia, T.A., Delmerico, J., Scaramuzza, D.: Toward domain independence for learning-based monocular depth estimation. IEEE Robot. Autom. Lett. 2(3), 1778–1785 (2017)CrossRefGoogle Scholar
  16. 16.
    Hinzmann, T., Schönberger, J.L., Pollefeys, M., Siegwart, R.: Mapping on the fly: real-time 3D dense reconstruction, digital surface map and incremental orthomosaic generation for unmanned aerial vehicles. In: Field and Service Robotics, pp. 383–396. Springer International Publishing (2018)Google Scholar
  17. 17.
    Sucan, I.A., Chitta, S.: Moveit! (2013)
  18. 18.
    Tallavajhula, A., Kelly, A.: Construction and validation of a high fidelity simulator for a planar range sensor. In: IEEE Conference on Robotics and Automation, pp. 6261–6266 (2015)Google Scholar
  19. 19.
    Diankov, R., Kuffner, J.: Openrave: a planning architecture for autonomous robotics. Technical Report 79, Robotics Institute, Pittsburgh, PA (2008)Google Scholar
  20. 20.
    Elkady, A., Sobh, T.: Robotics middleware: a comprehensive literature survey and attribute-based bibliography. J. Robot. (2012). Article ID 959013Google Scholar
  21. 21.
    Koenig, N., Howard, A.: Design and use paradigms for Gazebo, an open-source multi-robot simulator. In: IEEE International Conference on Intelligent Robots and Systems, pp. 2149–2154 (2004)Google Scholar
  22. 22.
    Rohmer, E., Singh, S.P.N., Freese, M.: V-REP: a versatile and scalable robot simulation framework. In: IEEE International Conference on Intelligent Robots and Systems, pp. 1321–1326 (2013)Google Scholar
  23. 23.
    Michel, O.: Webots professional mobile robot simulation. Int. J. Adv. Robot. Syst. 1, 39–42 (2004)CrossRefGoogle Scholar
  24. 24.
    Shah, S., Dey, D., Lovett, C., Kapoor, A.: AirSim: high-fidelity visual and physical simulation for autonomous vehicles. In: Field and Service Robotics (2017)Google Scholar
  25. 25.
    Echeverria, G., Lassabe, N., Degroote, A., Lemaignan, S.: Modular open robots simulation engine: MORSE. In: IEEE International Conference on Robotics and Automation, pp. 46–51 (2011)Google Scholar
  26. 26.
    Bitcraze, A.B.: Crazyflie official website.
  27. 27.
    Meyer, J., Sendobry, A., Kohlbrecher, S., Klingauf, U., von Stryk, O.: Comprehensive simulation of quadrotor UAVs using ROS and Gazebo. In: Noda, I., Ando, N., Brugali, D., Kuffner, J.J. (eds.) Simulation, Modeling, and Programming for Autonomous Robots, pp. 400–411. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  28. 28.
    Furrer, F., Burri, M., Achtelik, M., Siegwart, R.: RotorS–a modular gazebo MAV simulator framework. In: Anis, K. (ed.) Robot Operating System (ROS): The Complete Reference, vol. 1, pp. 595–625. Springer International Publishing (2016)Google Scholar
  29. 29.
    Hönig, W., Ayanian, N.: Flying multiple UAVs using ROS. In: Koubaa, A. (ed.) Robot Operating System (ROS): The Complete Reference, vol. 2, pp. 83–118. Springer International Publishing (2017)Google Scholar
  30. 30.
    Shokry, H., Hinchey, M.: Model-based verification of embedded software. Computer 42(4), 53–59 (2009)CrossRefGoogle Scholar
  31. 31.
    Van der Auweraer, H., Anthonis, J., De Bruyne, S., Leuridan, J.: Virtual engineering at work: the challenges for designing mechatronic products. Eng. Comput. 29(3), 389–408 (2013)CrossRefGoogle Scholar
  32. 32.
    Aminzadeh, A., Atashgah, M., Roudbari, A.: Software in the loop framework for the performance assessment of a navigation and control system of an unmanned aerial vehicle. IEEE Aerosp. Electron. Syst. Mag. 33(1), 50–57 (2018)CrossRefGoogle Scholar
  33. 33.
    Preiss, J.A., Honig, W., Sukhatme, G.S., Ayanian, N.: Crazyswarm: a large nano-quadcopter swarm. In: IEEE International Conference on Robotics and Automation, pp. 3299–3304 (2017)Google Scholar
  34. 34.
    Galea, B., Kry, P.G.: Tethered flight control of a small quadrotor robot for stippling. In: IEEE International Conference on Intelligent Robots and Systems, pp. 1713–1718 (2017)Google Scholar
  35. 35.
    Araki, B., Strang, J., Pohorecky, S., Qiu, C., Naegeli, T., Rus, D.: Multi-robot path planning for a swarm of robots that can both fly and drive. In: IEEE International Conference on Robotics and Automation, pp. 5575–5582 (2017)Google Scholar
  36. 36.
    Hönig, W., Milanes, C., Scaria, L., Phan, T., Bolas, M., Ayanian, N.: Mixed reality for robotics. In: IEEE International Conference on Intelligent Robots and Systems, pp. 5382–5387 (2015)Google Scholar
  37. 37.
    Giernacki, W., Skwierczyski, M., Witwicki, W., Wroski, P., Kozierski, P.: Crazyflie 2.0 quadrotor as a platform for research and education in robotics and control engineering. In: 22nd International Conference on Methods and Models in Automation and Robotics, pp. 37–42 (2017)Google Scholar
  38. 38.
    Bucki, N., Mueller, M.W.: Improved quadcopter disturbance rejection using added angular momentum. In: 2018 IEEE International Conference on Intelligent Robots and Systems (2018)Google Scholar
  39. 39.
    Silano, G.: CrazyS GitHub repository. (2018)
  40. 40.
    Silano, G.: CrazyS GitHub pull request on RotorS. (2018)
  41. 41.
    Bitcraze, A.B.: Crazyflie 2.0 hardware specification. Bitcraze Wiki. (2018)
  42. 42.
    Silano, G., Aucone, E., Iannelli, L.: CrazyS: a software-in-the-loop platform for the Crazyflie 2.0 nano-quadcopter. In: 2018 26th Mediterranean Conference on Control and Automation, June 2018, pp. 352–357 (2018)Google Scholar
  43. 43.
    Luis, C., Ny, J.L.: Design of a Trajectory Tracking Controller for a Nanoquadcopter. École Polytechnique de Montréal, Technical Report (2016).
  44. 44.
    Siciliano, B., Sciavicco, L., Villani, L., Oriolo, G.: Robotics-Modelling, Planning and Control, 2nd edn. Advanced Textbooks in Control and Signal Processing, Springer (2008)Google Scholar
  45. 45.
    Förster, J.: System identification of the Crazyflie 2.0 nano quadrocopter. Bachelor’s thesis, ETH Zurich (2015).
  46. 46.
    The automatic coordination of teams lab. GitHub repository, RotorS fork, crazyflie-dev branch.
  47. 47.
    Vicon motion systems. Vicon official website. (2018)
  48. 48.
    NaturalPoint, Inc., Optitrack official website. (2018)
  49. 49.
    Qualisys, A.B.: Qualisys official website. (2018)
  50. 50.
    Subramanian, G.: Nonlinear control strategies for quadrotors and CubeSats. Master’s thesis, University of Illinois (2015)Google Scholar
  51. 51.
    Madgwick, S.O.H., Harrison, A.J.L., Vaidyanathan, R.: Estimation of IMU and MARG orientation using a gradient descent algorithm. In: 2011 IEEE International Conference on Rehabilitation Robotics, June 2011, pp. 1–7 (2011)Google Scholar
  52. 52.
    Myungsoo, J., Roumeliotis, S.I., Sukhatme, G.S.: State estimation of an autonomous helicopter using Kalman filtering. In: 1999 IEEE International Conference on Intelligent Robots and Systems. Human and Environment Friendly Robots with High Intelligence and Emotional Quotients, vol. 3, pp. 1346–1353 (1999)Google Scholar
  53. 53.
    Roberts, J.M., Corke, P.I., Buskey, G.: Low-cost flight control system for a small autonomous helicopter: In: 2003 IEEE International Conference on Robotics and Automation, vol. 1, Sept 2003, pp. 546–551 (2003)Google Scholar
  54. 54.
    Rehder, J., Nikolic, J., Schneider, T., Hinzmann, T., Siegwart, R.: Extending kalibr: calibrating the extrinsics of multiple IMUs and of individual axes. In: IEEE International Conference on Robotics and Automation, pp. 4304–4311 (2016)Google Scholar
  55. 55.
    Glaser, S., Woodall, W.: Xacro. (2015)
  56. 56.
    RotorS GitHub issues tracker. Increase odometry sensor rate.
  57. 57.
  58. 58.
    Kalibr issue tracker. Obtaining IMU parameterss from datasheet. (2018)
  59. 59.
    Kalibr GitHub wiki. IMU noise model, Kalibr wiki.
  60. 60.
    Zheng, J., Qi, M., Xiang, K., Pang, M.: IMU performance analysis for a pedestrian tracker. In: Huang, Y., Wu, H., Liu, H., Yin, Z. (eds.) Intelligent Robotics and Applications, pp. 494–504. Springer International Publishing (2017)Google Scholar
  61. 61.
    Woodall, W.: Creating a workspace for catkin. (2018)
  62. 62.
    Autonomous system laboratory. mav\_comm repository. (2018)
  63. 63.
    Liu, Z., Hedrick, K.: Dynamic surface control techniques applied to horizontal position control of a quadrotor. In: 2016 20th International Conference on System Theory, Control and Computing (ICSTCC), pp. 138–144 (2016)Google Scholar
  64. 64.
    Islam, S., Faraz, M., Ashour, R.K., Cai, G., Dias, J., Seneviratne, L.: Adaptive sliding mode control design for quadrotor unmanned aerial vehicle. In: International Conference on Unmanned Aircraft Systems, pp. 34–39 (2015)Google Scholar
  65. 65.
    Dydek, Z.T., Annaswamy, A.M., Lavretsky, E.: Adaptive control of quadrotor UAVs: a design trade study with flight evaluations. IEEE Trans. Control. Syst. Technol. 21(4), 1400–1406 (2013)CrossRefGoogle Scholar
  66. 66.
    Weinstein, A., Cho, A., Loianno, G., Kumar, V.: Visual inertial odometry swarm: an autonomous swarm of vision-based quadrotors. IEEE Robot. Autom. Lett. 3(3), 1801–1807 (2018)CrossRefGoogle Scholar
  67. 67.
    Vempati, A.S., Kamel, M., Stilinovic, N., Zhang, Q., Reusser, D., Sa, I., Nieto, J., Siegwart, R., Beardsley, P.: PaintCopter: an autonomous UAV for spray painting on three-dimensional surfaces. IEEE Robot. Autom. Lett. 3(4), 2862–2869 (2018)CrossRefGoogle Scholar
  68. 68.
    Dunkley, O., Engel, J., Sturm, J., Cremers, D.: Visual-inertial navigation for a camera-equipped 25g nano-quadrotor. In: IEEE International Conference on Intelligent Robots and Systems, pp. 1–2 (2014)Google Scholar
  69. 69.
    Campos-Macías, L., Gómez-Gutiérrez, D., Aldana-López, R., de la Guardia, R., Parra-Vilchis, J.I.: A hybrid method for online trajectory planning of mobile robots in cluttered environments. IEEE Robot. Autom. Lett. 2(2), 935–942 (2017)CrossRefGoogle Scholar
  70. 70.
    Bansal, S., Akametalu, A.K., Jiang, F.J., Laine, F., Tomlin, C.J.: Learning quadrotor dynamics using neural network for flight control. In: IEEE Conference on Decision and Control, pp. 4653–4660 (2016)Google Scholar
  71. 71.
    Matthies, L., Brockers, R., Kuwata, Y., Weiss, S.: Stereo vision-based obstacle avoidance for micro air vehicles using disparity space. In: 2014 IEEE International Conference on Robotics and Automation, May 2014, pp. 3242–3249 (2014)Google Scholar
  72. 72.
    Field, T., Diankov, R., Sucan, I., Kay, J.: Collada URDF. ROS Wiki. (2018)
  73. 73.
    MathWorks. Robotics system toolbox. MathWorks official website.
  74. 74.
    MathWorks. Connect to a ROS-enabled robot from simulink. MathWorks official website.
  75. 75.
    MathWorks. Install robotics system toolbox add-ons. MathWorks official website.
  76. 76.
    MathWorks. Create custom messages from ROS package. MathWorks official website.
  77. 77.
  78. 78.
    Silano, G.: Crazyflie hovering example by using the robotics system toolbox. YouTube. (2018)
  79. 79.
    MathWorks. Generate a standalone ROS node from simulink. MathWorks official website.
  80. 80.
    Silano, G.: Crazyflie 2.0 hovering example when only the ideal odometry sensor is in the loop. YouTube. (2018)
  81. 81.
    Silano, G.: Crazyflie 2.0 hovering example when disturbances act on the drone. YouTube. (2018)
  82. 82.
    Silano, G.: Crazyflie 2.0 hovering example when the state estimator and the on-board sensors are taking into account. YouTube. (2018)
  83. 83.
    Mueller, M.W., Hamer, M., D’Andrea, R.: Fusing ultra-wideband range measurements with accelerometers and rate gyroscopes for quadrocopter state estimation. In: IEEE International Conference on Robotics and Automation, pp. 1730–1736 (2015)Google Scholar
  84. 84.
    Mellinger, D., Kumar, V.: Minimum snap trajectory generation and control for quadrotors. In: IEEE International Conference on Robotics and Automation, pp. 2520–2525 (2011)Google Scholar
  85. 85.
    Travis CI, GMBH. TravisCI official website. (2018)
  86. 86.
    Duvallet, F.: ROS package continuous integration using Travis-CI repository. (2018)
  87. 87.
    Silano, G.: ROS TravisCI integration pull request. (2018)
  88. 88.
    Travis CI, GMBH. Getting started with TravisCI. (2018)

Copyright information

© Springer Nature Switzerland AG 2020

Authors and Affiliations

  1. 1.Department of EngineeringUniversity of Sannio in BeneventoBeneventoItaly

Personalised recommendations