FancySafeBot 0.0.1
A safe robotics library
Loading...
Searching...
No Matches
Coding Standard

A formal coding standard is not enforced, but the following guidelines are recommended to ensure code quality and maintainability. A more comprehensive coding standard with properly configured static analysis tools would be a great contribution to the library.

The Fancy Safe Bot (FSB) library coding standard follows MISRA C++ 2023 and CPP Core Guidelines with some deviations. If you don't have access to a MISRA standard document, you may reference many of the guidelines from µOS++ coding style, Mathworks Polyspace and SonarLint performs static analysis for MISRA C++ 2023 rules listed here. ClangTidy static analysis is also applied with rules specified in .clang-tidy configuration file.

The formatting tool ClangFormat is used to enforce a coding style based on "WebKit" defaults and overridden rules in the .clang-format configuration file.

Note
The FSB library is not intended to be used in safety-critical applications without proper validation and verification. The coding standard is a guideline to help developers write safe and maintainable code, but it does not guarantee safety or correctness in all situations.

The Portable Operating System Interface (POSIX)

POSIX is a family of standard Application Programming Interfaces that allow code to be portable across operating systems. In an attempt to provide portability across Real-Time Operating Systems (RTOS), the FSB library targets POSIX-certified operating systems such as Linux and QNX. FSB system calls and POSIX-related routines are optional and kept separate from the core library.

MISRA Conformance

The FSB library is designed to be compliant with the MISRA C++ 2023 coding standard. The following sections outline the notable deviations from the MISRA C++ 2023 standard and the rationale behind them.

Interfacing With OpenBLAS and CMinpack Libraries

The FSB library interfaces with the OpenBLAS and CMinpack libraries, which are not MISRA compliant. The FSB library is designed to be used in conjunction with these libraries, and it is necessary to allow for some deviations from the MISRA standard in order to facilitate this integration.

URDF Parsing

The FSB library includes a URDF parser that is not MISRA compliant. The URDF parser is intended to only be used when initializing the robot model tree and should not be used in the safety-critical portion of the application typically during real-time operation of a robot.