Human-Error Prevention for Autonomous Edge Software Using Minimalistic Modern C++
Abstract
:1. Introduction
1.1. Background
1.2. Research Objectives
- Free from object-oriented constraints and simultaneously type-safe.
- Using a minimal robot-software environment as a compiler of standard language specification.
- No additional tools such as computer-aided software engineering (CASE) or software framework.
- Providing well-designed building blocks easy to associate the result of a top–down approach.
- Zero overhead in run-time.
2. Related Work
2.1. Top–Down Approach
2.2. Bottom–Up Approach
3. Dependency Injection DSL for Separation of Functionalities and Time Domain
3.1. Design Pattern: Type-Safe Portable Real-Time Control
- Problem and Context: Robot software highly depends on the environment and cannot be ported to different platforms. It is especially difficult to port its simulator for testing.
- Solution: Provide environment independency for robot software that includes different control cycles such as image processing, motor control, and sensing, in addition their interaction. In addition, because it is only implemented with the standard grammar of a programming language, it has portability and no additional tool is required.
- Consequences and Trade-Offs: This is an extension of the bridge pattern of GoF [32] for robot software. Therefore, it inherits the issue of the bridge pattern.
3.2. Loosely Coupled Implementation of Tightly Coupled Architecture Using Modern C++
3.3. Isolation of Objects and Real-Time Aspect
3.4. Input/Output Aspect Implementation Independent from Execution Environment
3.5. Implementation of SA Interference Aspect
4. Preventive Metaprogramming DSL for Real-Time Loop
4.1. Pattern: Compile as Right Control
- Problem and Context: Robot software executes unexpected runaway by excessive or overlooked update of sampled-time filters.
- Solution: Eliminate excessive or overlooked execution of sampled-time filters as compile error before robot-software execution. It can be applied to all types of robot software that use a sampled-time filter, e.g., signal filters, Kalman filters, and particle filters.
- Consequences and Trade-Offs: It has portability and does not require an additional code generator because it is only implemented with the programming language’s standard grammar. Compile-time check cannot detect errors that occur at run time. Therefore, an additional instance check is introduced in this paper.
4.2. Update-Law Metaprogramming Using Modern C++ Specification
4.3. Overlooking to Invoke is a Compilation Error Using “Substitution Failure Is Not An Error” (SFINAE)
5. Results
5.1. Summary of Proposed Methods
- Free from object-oriented constraints, simultaneously type-safe (i.e., achieved by the proposed design patterns).
- Using a minimal robot-software environment (i.e., implemented under C++11 compliance).
- No additional tools (i.e., implemented by the C++11 compliance design patterns).
- Providing well-designed building blocks (i.e., achieved by “Type-Safe Portable Real-time Control”).
- Zero overhead in run time (i.e., achieved by “Compile as Right Control”).
5.2. Portability by ISO Compliant
5.3. Development of SA Real-Time Simulation Using “Type-Safe Portable Real-Time Control”
5.4. Robust Behavior Simulation to Verify Independence from Execution Environment
5.5. Defective Design Prevention Using “Compile as Right Control”
6. Discussion
7. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
Abbreviations
DSL | Domain Specific Language |
SA | Subsumption Architecture |
UML | Unified Modeling Language |
OOAD | Object Oriented Analysis and Design |
AOAD | Aspect Oriented Analysis and Design |
DI | Dependency Injection |
RAII | Resource Acquisition Is Initialization |
CEID | Cyclic Execution Is Destruction |
CRTP | Curiously Recurring Template Pattern |
SFINAE | Substitution Failure Is Not An Error |
Appendix A. Implementation of Dependency Injection DSL for Separation of Functionalities and Time Domain
Appendix B. Implementation of Preventive Metaprogramming DSL for Realtime Loop
References
- Leveson, N.G. Chapter Computers and Risk. In Safeware: System Safety and Computers; Addison-Wesley Professional: Boston, MA, USA, 1995. [Google Scholar]
- Yazici, M.; Basurra, S.; Gaber, M. Edge Machine Learning: Enabling Smart Internet of Things Applications. Big Data Cogn. Comput. 2018, 2, 26. [Google Scholar] [CrossRef]
- Kang, K.D.; Chen, L.; Yi, H.; Wang, B.; Sha, M. Real-Time Information Derivation from Big Sensor Data via Edge Computing. Big Data Cogn. Comput. 2017, 1, 5. [Google Scholar] [CrossRef]
- AWS IoT SDKs. Available online: https://docs.aws.amazon.com/iot/latest/developerguide/iot-sdks.html (accessed on 1 September 2019).
- Understand and Use Azure IoT Hub SDKs. Available online: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-sdks (accessed on 1 September 2019).
- Brooks, R.A. A robust layered control system for a mobile robot. IEEE J. Robot. Autom. 1986, 2, 14–23. [Google Scholar] [CrossRef] [Green Version]
- FORM S-1 iROBOT CORPORATION; Chapter BUSINESS; 2005; p. 53. Available online: https://www.sec.gov/Archives/edgar/data/1159167/000095013505005611/b55709a2sv1za.htm#110 (accessed on 1 November 2019).
- Leveson, N.G. Chapter Medical Devices: The Therac-25 Story. In Safeware: System Safety and Computers; Addison-Wesley Professional: Boston, MA, USA, 1995. [Google Scholar]
- Meyer, B. Object-Oriented Software Construction, 2nd ed.; Prentice Hall: Englewood Cliffs, NJ, USA, 1997. [Google Scholar]
- Jacobson, I.; Ng, P.W. Aspect-Oriented Software Development with Use Cases; Addison-Wesley Professional: Boston, MA, USA, 2005. [Google Scholar]
- Ghosh, D. DSLs in Action; Manning Publications: Greenwich, CT, USA, 2010. [Google Scholar]
- The C++ Standards Committee; ISO/IEC 14882:2011; ISO/IEC: Geneva, Switzerland, 2011.
- Overture Project. Overture Tool Formal Modelling in VDM. Available online: http://overturetool.org (accessed on 4 January 2019).
- Verifying Multi-Threaded Software with Spin. Available online: http://spinroot.com/spin/whatispin.html (accessed on 4 January 2019).
- Information Technology—Z Formal Specification Notation—Syntax, Type System and Semantics ISO/IEC 13568:2002; ISO/IEC: Geneva, Switzerland, 2002.
- Calegari, R.; Ciatto, G.; Mariani, S.; Denti, E.; Omicini, A. LPaaS as Micro-Intelligence: Enhancing IoT with Symbolic Reasoning. Big Data Cogn. Comput. 2018, 2, 23. [Google Scholar] [CrossRef]
- Leite, A.; Pinto, A.; Matos, A. A Safety Monitoring Model for a Faulty Mobile Robot. Robotics 2018, 7, 32. [Google Scholar] [CrossRef]
- Fröhlich, A.A. Application Oriented Operating Systems; GMD-Forschungszentrum Informationstechnik: Sankt Augustin, Germany, 2001. [Google Scholar]
- Brugali, D.; Salvaneschi, P. Stable Aspects in Robot Software Development. Int. J. Adv. Robot. Syst. 2006. [Google Scholar] [CrossRef]
- Maoz, S.; Ringert, J.O.; Rumpe, B. Synthesis of component and connector models from crosscutting structural views. In Proceedings of the ESEC/FSE 2013 9th Joint Meeting on Foundations of Software Engineering, Saint Petersburg, Russia, 18–26 August 2013. [Google Scholar]
- Wehrmeister, M.A.; Freitasb, E.P.; Binottoc, A.P.D.; Pereirad, C.E. Combining aspects and object-orientation in model-driven engineering for distributed industrial mechatronics systems. Mechatronics 2014, 24, 844–865. [Google Scholar] [CrossRef]
- OpenRTM-Aist Official Website. Available online: http://www.openrtm.org/ (accessed on 4 January 2019).
- ROS Wiki. Available online: http://www.ros.org/wiki/ (accessed on 4 January 2019).
- Correal, R.; Pajares, G.; Ruz, J. A Matlab-Based Testbed for Integration, Evaluation and Comparison of Heterogeneous Stereo Vision Matching Algorithms. Robotics 2016, 5, 24. [Google Scholar] [CrossRef]
- Yan, Z.; Fabresse, L.; Laval, J.; Bouraqadi, N. Building a ROS-Based Testbed for Realistic Multi-Robot Simulation: Taking the Exploration as an Example. Robotics 2017, 6, 21. [Google Scholar] [CrossRef]
- Jensen, K.; Larsen, M.; Nielsen, S.; Larsen, L.; Olsen, K.; Jørgensen, R. Towards an Open Software Platform for Field Robots in Precision Agriculture. Robotics 2014, 3, 207–234. [Google Scholar] [CrossRef] [Green Version]
- Gonzalez, F.; Zalewski, J. Teaching Joint-Level Robot Programming with a New Robotics Software Tool. Robotics 2017, 6, 41. [Google Scholar] [CrossRef]
- Johnson, S.C. Yacc: Yet Another Compiler-Compiler. Available online: http://dinosaur.compilertools.net/yacc/index.html (accessed on 18 June 2019).
- Spinczyk, O.; Gal, A.; Schröder-Preikschat, W. AspectC++: An aspect-oriented extension to the C++ programming language. In CRPIT ’02 Proceedings of the Fortieth International Conference on Tools Pacific: Objects for Internet, Mobile and Embedded Applications; Australian Computer Society, Inc.: Darlinghurst, Australia, 2002; pp. 53–60. [Google Scholar]
- Willink, E.D.; Muchnick, V.B. Preprocessing C++: Meta-class aspects. In Proceedings of the Eastern European Conference on Technology of Object Oriented Languages and Systems, Prague, Czech Republic, 7 July 1999. [Google Scholar]
- Yao, Z.; Zheng, Q.L.; Chen, G.L. AOP++: A Generic Aspect-Oriented Programming Framework in C++. In Proceedings of the 4th International Conference, GPCE 2005, Tallinn, Estonia, 29 September–1 October 2005; pp. 94–108. [Google Scholar]
- Gamma, E.; Helm, R.; Johnson, R.; Vlissides, J. Design Patterns: Elements of Reusable Object-Oriented Software; Addison-Wesley Professional: Boston, MA, USA, 1995. [Google Scholar]
- Fowler, M. Inversion of Control Containers and the Dependency Injection Pattern; Technical Report; ThoughtWorks: Chicago, IL, USA, 2004. [Google Scholar]
- Tambe, S.; Many Other C++ aficionados. More C++ Idioms. Available online: https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms (accessed on 4 January 2019).
- Sutter, H. Exceptional C++; Addison-Wesley Professional: Boston, MA, USA, 1999. [Google Scholar]
- Raspberry Pi. Available online: https://www.raspberrypi.org/ (accessed on 22 June 2019).
- Arduino. Available online: https://www.arduino.cc/ (accessed on 17 June 2019).
- CCCC-C and C++ Code Counter. Available online: http://cccc.sourceforge.net/ (accessed on 22 June 2019).
- Adachi, N. Model based development utilizing DI container for wide variety products and effective tests. In Proceedings of the JUSE Software Quality Symposium 2014, Tokyo, Japan, 14 September 2014; Available online: https://www.juse.jp/sqip/symposium/archive/2014/day1/files/happyou_D2.pdf (accessed on 31 October 2019). (In Japaneses).
- Maria, A. RT PREEMPT HOWTO. Available online: https://wiki.linuxfoundation.org/realtime/documentation/howto/applications/application_base (accessed on 4 January 2019).
- OpenCV. Available online: https://opencv.org/ (accessed on 17 June 2019).
- TensorFlow. Available online: https://www.tensorflow.org/ (accessed on 17 June 2019).
- Autoware.AI. Available online: https://www.autoware.ai/ (accessed on 17 June 2019).
- He, K.; Lahijanian, M.; Kavraki, L.E.; Vardi, M.Y. Towards manipulation planning with temporal logic specifications. In Proceedings of the 2015 IEEE international conference on robotics and Automation (ICRA), Seattle, WA, USA, 26–30 May 2015; pp. 346–352. [Google Scholar]
- Sankel, D. N4766 Draft, C++ Extensions for Reflection. Available online: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4766.pdf (accessed on 15 October 2019).
- The C++ Standards Committee. Wording Paper, C++ Extensions for Concepts. Available online: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0734r0.pdf (accessed on 22 June 2019).
Linux PC | MacOSX | Raspberry Pi 3B+ | Arduino | |
---|---|---|---|---|
Architecture | Intel x86 | Intel x86 | ARM Cortex | AVR |
OS | Linux 3.10.17 | OSX 10.9.3 OSX 10.13.6 | Linux 4.14 | N/A (Arduino IDE 1.8.3) |
Compiler | g++ 4.7.3 | g++ 4.8.2 clang 9.0 | g++ 6.3.0 | g++ 5.4.0 |
Standard library | Yes | Yes | Yes | N/A |
Porting | Yes | Yes | Yes | N/A |
C++11 | C++03 | |
---|---|---|
Real-time standard | No | No |
Concurrency standard | Yes | No |
Time-adjustment standard | Yes | No |
Copy-control grammar | Yes | No |
Strict override | Yes | No |
C++11 | C++03 | |
---|---|---|
ComputerVision | 6 | 6 |
MotorControl | 6 | 6 |
SensorRecognition | 5 | 5 |
SAInterference | 8 | 8 |
RealtimeFunctionalityIF | 0 | 0 |
ChronoCycleLogicalThread | 1 | N/A |
RTPreemptCycleLogicalThread | 3 | 3 |
TransactionIO | 4 | 4 |
Total | 33 | 32 |
Total Man Hour | New Code | Bugs | Bug Density |
---|---|---|---|
85.5% | 127.0% | 31.7% | 17.9% |
© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Fukano, R.; Ishikawa, M. Human-Error Prevention for Autonomous Edge Software Using Minimalistic Modern C++. Big Data Cogn. Comput. 2019, 3, 52. https://doi.org/10.3390/bdcc3040052
Fukano R, Ishikawa M. Human-Error Prevention for Autonomous Edge Software Using Minimalistic Modern C++. Big Data and Cognitive Computing. 2019; 3(4):52. https://doi.org/10.3390/bdcc3040052
Chicago/Turabian StyleFukano, Ryo, and Masato Ishikawa. 2019. "Human-Error Prevention for Autonomous Edge Software Using Minimalistic Modern C++" Big Data and Cognitive Computing 3, no. 4: 52. https://doi.org/10.3390/bdcc3040052
APA StyleFukano, R., & Ishikawa, M. (2019). Human-Error Prevention for Autonomous Edge Software Using Minimalistic Modern C++. Big Data and Cognitive Computing, 3(4), 52. https://doi.org/10.3390/bdcc3040052