/blog/images/avatar.webp

Hello World

AUTOSAR_EXP_ARAComAPI

AUTOSAR_EXP_ARAComAPI


[SWS_CORE_90003]{草案} ⌈以 ARA 开头的 C/C++ 符号保留给 AUTOSAR 使用。⌋

自适应平台通常避免使用 C/C++ 预处理器宏。但如果未来某个时间点引入了宏,所有此类宏都将以 ARA 为前缀。因此,平台供应商不应定义任何以此为前缀的符号(包括宏和 C/C++ 符号),以免与标准未来新增内容发生冲突。

AUTOSAR_SWS_CommunicationManagement

AUTOSAR_SWS_CommunicationManagement


7 功能规范

7.1 总体描述

AUTOSAR自适应架构将自适应平台基础软件组织为多个功能集群。这些集群向应用程序提供通用功能服务。AUTOSAR自适应平台的 通信管理(CM 正是这样一个功能集群,隶属于"AUTOSAR自适应应用运行时(ARA)"。它负责构建和监控应用程序之间的通信路径,支持本地和远程通信。

MISRA C 2023 规范英文版

MISRA C 2023 规范英文版

https://ww2.mathworks.cn/help/bugfinder/misra-c-2023-reference.html?lang=en

中文版本


Directives

Implementation

[Dir 1.1] Any implementation-defined behavior on which the output of the program depends shall be documented and understood.


Compilation and build

[Dir 2.1] All source files shall compile without any compilation errors.


Code design

[Dir 4.1] Run-time failures shall be minimized.

[Dir 4.3] Assembly language shall be encapsulated and isolated.

[Dir 4.4] Sections of code should not be “commented out”.

CERT C 规范英文版

CERT C 规范英文版

https://ww2.mathworks.cn/help/bugfinder/cert-c-rules-and-recommendations.html?lang=en


Rules

Preprocessor

[Rule PRE30-C] Do not create a universal character name through concatenation.

[Rule PRE31-C] Avoid side effects in arguments to unsafe macros.

[Rule PRE32-C] Do not use preprocessor directives in invocations of function-like macros.


Declarations and initialization

[Rule DCL30-C] Declare objects with appropriate storage durations.

[Rule DCL31-C] Declare identifiers before using them.

[Rule DCL36-C] Do not declare an identifier with conflicting linkage classifications.

AUTOSAR C++ 2014 规范英文版

AUTOSAR Cpp 2014 规范英文版

https://ww2.mathworks.cn/help/bugfinder/autosar-c-14.html?lang=en

中文版


Language independent issues

[Rule A0-1-1] A project shall not contain instances of non-volatile variables being given values that are not subsequently used.

[Rule A0-1-2] The value returned by a function having a non-void return type that is not an overloaded operator shall be used.

[Rule A0-1-3] Every function defined in an anonymous namespace, or static function with internal linkage, or private member function shall be used.

CERT C++ 规范英文版

CERT C++ 规范英文版

https://ww2.mathworks.cn/help/bugfinder/cert-c-rules.html?lang=en

中文版本


Declare and Initialization

[DCL30-C] Declare objects with appropriate storage durations.

[DCL39-C] Avoid information leakage in structure padding.

[DCL40-C] Do not create incompatible declarations of the same function or object.

[DCL50-CPP] Do not define a C-style variadic function.

[DCL51-CPP] Do not declare or define a reserved identifier.

[DCL52-CPP] Never qualify a reference type with const or volatile.

[DCL53-CPP] Do not write syntactically ambiguous declarations.

Misra C++ 2008 规范

Misra Cpp 2008


Language independent issues

Unnecessary constructs

Rule 0-1-1 (Required) A project shall not contain unreachable code.

Rule 0-1-2 (Required) A project shall not contain infeasible paths.

Rule 0-1-3 (Required) A project shall not contain unused variables.

Rule 0-1-4 (Required) A project shall not contain non-volatile POD variables having only one use.

Rule 0-1-5 (Required) A project shall not contain unused type declarations.

Rule 0-1-6 (Required) A project shall not contain instances of non- volatile variables being given values that are never subsequently used.

Misra C++ 2008 规范

Misra Cpp 2008 规范


语言无关问题

不必要的构造

规则 0-1-1 (必需)项目不应包含无法访问的代码。

规则 0-1-2 (必需)项目不应包含不可行的路径。

规则 0-1-3 (必需)项目不应包含未使用的变量。

规则 0-1-4 (必需)项目不应包含只有一种用途的非易失性 POD 变量。

Misra C++ 2023 规范英文版

MISRA C++ 2023 规范英文版

https://ww2.mathworks.cn/help/bugfinder/misra-cpp-2023-rules-and-directives.html?lang=en

中文版本


Language independent issues

[Rule 0.0.1 Required] A function shall not contain unreachable statements.

[Rule 0.0.2 Advisory] Controlling expressions should not be invariant.

[Rule 0.1.1 Advisory] A value should not be unnecessarily written to a local object.

[Rule 0.1.2 Required] The value returned by a function shall be used.

[Rule 0.2.1 Advisory] Variables with limited visibility should be used at least once.

C++ 编码规范

C++ 编码规范

本文基于 Google C++ Style Guide 编写,通过规范 C++ 的代码风格,提高代码的可读性,可维护性,可扩展性,同时保证 C++ 语言的新特性得以高效使用。


1. 项目结构

1.1 模块目录

模块目录结构如下:

colcon 使用详细总结

colcon 使用详细总结

colcon 是 ROS 2 默认的元构建工具,是 catkin_make、catkin_tools、ament_tools 的迭代升级版本,用于ROS 2工作空间的包构建、测试、打包与环境管理,支持ament_cmake、ament_python、纯CMake、Python setuptools等多种构建类型,采用拓扑序并行构建,原生支持工作空间叠加(overlay/underlay)机制,是ROS 2开发的核心工具。

ROS2 源码详细分析

ROS2 源码详细分析(基于Humble LTS 稳定版)

本文基于ROS2 Humble LTS官方源码,从分层架构、核心模块源码实现、全链路通信流程三个维度,对ROS2核心源码进行深度拆解,同时补充关键设计思想与源码阅读路径。

ROS2 使用详细总结

ROS2 使用详细总结

本文基于ROS2最新LTS版本(Humble Hawksbill / Jazzy Jalisco)编写,覆盖从环境搭建、核心概念、开发流程、进阶特性到生态应用、避坑指南的全链路内容,兼顾入门与实战,是一份可直接落地的ROS2全栈使用手册。

DDS 协议详细总结

DDS协议 全面详细总结

DDS(Data Distribution Service,数据分发服务)是由OMG(对象管理组织) 标准化的、以数据为中心的发布-订阅(DCPS) 分布式实时通信中间件协议,专为高可靠、低延迟、高可用的分布式硬实时系统设计,是自动驾驶、工业4.0、航空航天、机器人等领域的核心通信标准。