From AgentSpeak to C for Safety Considerations in Unmanned Aerial Vehicles

  • Samuel Bucheli
  • Daniel Kroening
  • Ruben Martins
  • Ashutosh Natraj
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9287)


Unmanned aerial vehicles (UAV) are becoming increasingly popular for both recreational and industrial applications, leading to growing concerns about safety. Autonomous systems, such as UAVs, are typically hybrid systems consisting of a low-level continuous control part and a high-level discrete decision making part. In this paper, we discuss using the agent programming language AgentSpeak to model the high-level decision making. We present a translation from AgentSpeak to C that bridges the gap between high-level decision making and low-level control code for safety-critical systems. This allows code to be written in a more natural high-level language, thereby reducing its overall complexity and making it easier to maintain, while still conforming to safety guidelines. As an exemplar, we present the code for a UAV autopilot. The generated code is evaluated on a simulator and a Parrot AR.Drone, demonstrating the flexibility and expressiveness of AgentSpeak as a modeling language for UAVs.


Multiagent System Unmanned Aerial Vehicle Belief Revision Belief Base Safety Consideration 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.



This work was supported by Engineering and Physical Sciences Research Council (EPSRC) grant EP/J012564/1.


  1. 1.
    Agrawal, A., Simon, G., Karsai, G.: Semantic Translation of Simulink/Stateflow Models to Hybrid Automata Using Graph Transformations. Electronic Notes in Theoretical Computer Science 109, 43–56 (2004)CrossRefGoogle Scholar
  2. 2.
    Bordini, R.H., Braubach, L., Dastani, M., Fallah-Seghrouchni, A.E., Gómez-Sanz, J., Leite, J., O’Hare, G., Pokahr, A., Ricci, A.: A Survey of Programming Languages and Platforms for Multi-Agent Systems. Informatica 30(1), 33–44 (2006)zbMATHGoogle Scholar
  3. 3.
    Bordini, R.H., Fisher, M., Visser, W., Wooldridge, M.: Verifying Multi-agent Programs by Model Checking. Autonomous Agents and Multi-Agent Systems 12(2), 239–256 (2006)CrossRefGoogle Scholar
  4. 4.
    Bordini, R.H., Hübner, J.F.: Semantics for the jason variant of agentspeak (plan failure and some internal actions). In: European Conference on Artificial Intelligence, pp. 635–640. IOS Press (2010)Google Scholar
  5. 5.
    Bordini, R.H., Hübner, J.F., Wooldridge, M.: Programming Multi-Agent Systems in AgentSpeak Using Jason. John Wiley & Sons (2007)Google Scholar
  6. 6.
    Bucheli, S., Kroening, D., Martins, R., Natraj, A.: AgentSpeak Translator. (last visited June 15, 2015). doi: 10.5281/zenodo.18572
  7. 7.
    Bucheli, S., Kroening, D., Martins, R., Natraj, A.: Modified tum\_ardrone package (last visited 15, June 2015). doi:  10.5281/zenodo.18571.
  8. 8.
    Clarke, E., Kroning, D., Lerda, F.: A tool for checking ANSI-C programs. In: Jensen, K., Podelski, A. (eds.) TACAS 2004. LNCS, vol. 2988, pp. 168–176. Springer, Heidelberg (2004) CrossRefGoogle Scholar
  9. 9.
    Dennis, L.A., Fisher, M., Lincoln, N., Lisitsa, A., Veres, S.M.: Practical Verification of Decision-Making in Agent-Based Autonomous Systems. Automated Software Engineering Online, 1–55 (2014). doi: 10.1007/s10515-014-0168-9
  10. 10.
    Dennis, L.A., Fisher, M., Webster, M.: Two-stage agent program verification. Journal of Logic and Computation Online (2015). doi: 10.1093/logcom/exv002
  11. 11.
    Díaz, Á.F., Earle, C.B., Fredlund, L.Å.: eJason: an implementation of jason in erlang. In: Dastani, M., Hübner, J.F., Logan, B. (eds.) ProMAS 2012. LNCS(LNAI), vol. 7837, pp. 1–16. Springer, Heidelberg (2013) CrossRefGoogle Scholar
  12. 12.
    Doan, T.T., Yao, Y., Alechina, N., Logan, B.: Verifying heterogeneous multi-agent programs. In: International Joint Conference on Autonomous Agents and Multiagent Systems. IEEE Computer Society (2014)Google Scholar
  13. 13.
    Engel, J., Sturm, J., Cremers, D.: tum\_ardrone. (last visited June 15, 2015)
  14. 14.
    Engel, J., Sturm, J., Cremers, D.: Scale-Aware Navigation of a Low-Cost Quadrocopter with a Monocular Camera. Robotics and Autonomous Systems 62(11), 1646–1656 (2014)CrossRefGoogle Scholar
  15. 15.
    Fisher, M., Dennis, L., Webster, M.: Verifying autonomous systems. Communications of the ACM 56(9), 84–93 (2013)CrossRefGoogle Scholar
  16. 16.
    Fortino, G., Rango, F., Russo, W., Santoro, C.: Translation of statechart agents into a BDI framework for MAS engineering. Engineering Applications of Artificial Intelligence 41, 287–297 (2015)CrossRefGoogle Scholar
  17. 17.
    Hama, M.T., Allgayer, R.S., Pereira, C.E., Bordini, R.H.: UAVAS: AgentSpeak Agents for Unmanned Aerial Vehicles. In: Workshop on Autonomous Software Systems at CBSoft (Autosoft 2011) (2011)Google Scholar
  18. 18.
    Harel, D., Politi, M.: Modeling Reactive Systems with Statecharts: The Statemate Approach, 1st edn. McGraw-Hill Inc., New York (1998) Google Scholar
  19. 19.
    Holzmann, G.: The Spin Model Checker: Primer and Reference Manual. Addison-Wesley Professional (2003)Google Scholar
  20. 20.
    Huang, H., Sturm, J.: tum\_simulator. (last visited June 15, 2015)
  21. 21.
    ICAO Cir 328: Unmanned Aircraft Systems (UAS). International Civil Aviation Organization (2011)Google Scholar
  22. 22.
    Mikk, E., Lakhnech, Y., Siegel, M., Holzmann, G.: Implementing statecharts in PROMELA/SPIN. In: Workshop on Industrial Strength Formal Specification Techniques, pp. 90–101. IEEE Computer Society Press (1998)Google Scholar
  23. 23.
    Motor Industry Software Reliability Association and Motor Industry Software Reliability Association Staff: MISRA C: 2012: Guidelines for the Use of the C Language in Critical Systems. Motor Industry Research Association (2013)Google Scholar
  24. 24.
    Nelson, R.C.: Flight stability and automatic control. McGraw-Hill (1997)Google Scholar
  25. 25.
    Piskorski, S., Brulez, N., Eline, P., D’Haeyer, F.: AR.Drone Developer Guide Revision SDK 2.0. Parrot S.A. (2012)Google Scholar
  26. 26.
    Pnueli, A., Siegel, M.D., Singerman, E.: Translation validation. In: Steffen, B. (ed.) TACAS 1998. LNCS, vol. 1384, pp. 151–166. Springer, Heidelberg (1998) CrossRefGoogle Scholar
  27. 27.
    Puri, A.: A Survey of Unmanned Aerial Vehicles (UAV) for Traffic Surveillance. Department of Computer Science and Engineering, University of South Florida, Tech. rep. (2005)Google Scholar
  28. 28.
    Quigley, M., Conley, K., Gerkey, B., Faust, J., Foote, T., Leibs, J., Wheeler, R., Ng, A.Y.: ROS: an open-source robot operating system. In: ICRA Workshop on Open-Source Software in Robotics (2009)Google Scholar
  29. 29.
    Rao, A.S.: AgentSpeak(L): BDI agents speak out in a logical computable language. In: Perram, J., Van de Velde, W. (eds.) MAAMAW 1996. LNCS, vol. 1038, pp. 42–55. Springer, Heidelberg (1996) CrossRefGoogle Scholar
  30. 30.
    Rao, A.S., Georgeff, M.P.: BDI Agents: From theory to practice. In: International Conference on Multi-Agent Systems, pp. 312–319. AAAI press (1995)Google Scholar
  31. 31.
    Rao, A.S., Georgeff, M.P.: Modeling rational agents with a BDI-architecture. In: Readings in Agents, pp. 317–328. Morgan Kaufmann Publishers Inc. (1998)Google Scholar
  32. 32.
    van Riemsdijk, M.B., de Boer, F.S., Dastani, M., Meyer, J.J.C.: Prototyping 3APL in the Maude Term Rewriting Language. In: International Joint Conference on Autonomous Agents and Multiagent Systems, pp. 1279–1281. ACM (2006)Google Scholar
  33. 33.
    ROS: Robot Operating System. (last visited June 15, 2015)
  34. 34.
    RTCA: DO-178C, Software Considerations in Airborne Systems and Equipment Certification. Radio Technical Commission for Aeronautics (2011)Google Scholar
  35. 35.
    RTCA: DO-333, Formal Methods Supplement to DO-178C and DO-278A. Radio Technical Commission for Aeronautics (2011)Google Scholar
  36. 36.
    Ryabtsev, M., Strichman, O.: Translation validation: from simulink to C. In: Bouajjani, A., Maler, O. (eds.) CAV 2009. LNCS, vol. 5643, pp. 696–701. Springer, Heidelberg (2009) CrossRefGoogle Scholar
  37. 37.
    Sampath, P., Rajeev, A.C., Ramesh, S.: Translation validation for stateflow to C. In: Design Automation Conference on Design Automation Conference, pp. 23:1–23:6. ACM (2014)Google Scholar
  38. 38.
    Scaife, N., Sofronis, C., Caspi, P., Tripakis, S., Maraninchi, F.: Defining and translating a “safe” subset of simulink/stateflow into lustre. In: International Conference on Embedded Software, pp. 259–268. ACM (2004)Google Scholar
  39. 39.
    Shoham, Y.: Agent-oriented Programming. Artificial Intelligence 60(1), 51–92 (1993)MathSciNetCrossRefGoogle Scholar
  40. 40.
    Staats, M., Heimdahl, M.P.E.: Partial translation verification for untrusted code-generators. In: Liu, S., Araki, K. (eds.) ICFEM 2008. LNCS, vol. 5256, pp. 226–237. Springer, Heidelberg (2008) CrossRefGoogle Scholar
  41. 41.
    Thesing, S., Souyris, J., Heckmann, R., Randimbivololona, F., Langenbach, M., Wilhelm, R., Ferdinand, C.: An abstract interpretation-based timing validation of hard real-time avionics software. In: International Conference on Dependable Systems and Networks, pp. 625–632. IEEE (2003)Google Scholar
  42. 42.
    Vieira, R., Moreira, A., Wooldridge, M., Bordini, R.H.: On the formal semantics of speech-act based communication in an agent-oriented programming language. Journal of Artificial Intelligence Research 29(1), 221–267 (2007)Google Scholar
  43. 43.
    Vu, T., Veloso, M.: Behavior Programming Language and Automated Code Generation for Agent Behavior Control. School of Computer Science, Carnegie Mellon University, Tech. rep. (2004)Google Scholar
  44. 44.
    Ziafati, P., Dastani, M., Meyer, J.-J., van der Torre, L.: Agent programming languages requirements for programming autonomous robots. In: Dastani, M., Hübner, J.F., Logan, B. (eds.) ProMAS 2012. LNCS(LNAI), vol. 7837, pp. 35–53. Springer, Heidelberg (2013) CrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Samuel Bucheli
    • 1
  • Daniel Kroening
    • 1
  • Ruben Martins
    • 1
  • Ashutosh Natraj
    • 1
  1. 1.Department of Computer ScienceUniversity of OxfordOxfordUK

Personalised recommendations