AUTOSAR SOME/IP 序列化规则
AUTOSAR SOME/IP 序列化规则
4 协议规范
SOME/IP 提供基于网络的面向服务通信。它基于服务定义,服务定义列出了服务提供的功能。一个服务可以由零个或多个事件、方法和字段组合而成。
SOME/IP 提供基于网络的面向服务通信。它基于服务定义,服务定义列出了服务提供的功能。一个服务可以由零个或多个事件、方法和字段组合而成。
[SWS_CORE_90003]{草案} ⌈以 ARA 开头的 C/C++ 符号保留给 AUTOSAR 使用。⌋
自适应平台通常避免使用 C/C++ 预处理器宏。但如果未来某个时间点引入了宏,所有此类宏都将以 ARA 为前缀。因此,平台供应商不应定义任何以此为前缀的符号(包括宏和 C/C++ 符号),以免与标准未来新增内容发生冲突。
AUTOSAR自适应架构将自适应平台基础软件组织为多个功能集群。这些集群向应用程序提供通用功能服务。AUTOSAR自适应平台的 通信管理(CM) 正是这样一个功能集群,隶属于"AUTOSAR自适应应用运行时(ARA)"。它负责构建和监控应用程序之间的通信路径,支持本地和远程通信。
https://ww2.mathworks.cn/help/bugfinder/misra-c-2023-reference.html?lang=en
[导则 1.1] 程序输出所依赖的任何实现定义行为,均应形成文档并被充分理解。
[导则 2.1] 所有源文件的编译过程不应产生任何编译错误。
[导则 4.1] 应最大限度降低运行时故障的发生概率。
https://ww2.mathworks.cn/help/bugfinder/misra-c-2023-reference.html?lang=en
[Dir 1.1] Any implementation-defined behavior on which the output of the program depends shall be documented and understood.
[Dir 2.1] All source files shall compile without any compilation errors.
[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”.
https://ww2.mathworks.cn/help/bugfinder/cert-c-rules-and-recommendations.html?lang=en
[规则 PRE30-C] 禁止通过宏拼接创建通用字符名。
[规则 PRE31-C] 避免在不安全宏的参数中引入副作用。
[规则 PRE32-C] 禁止在类函数宏的调用中使用预处理指令。
[规则 DCL30-C] 为对象声明合适的存储期。
https://ww2.mathworks.cn/help/bugfinder/cert-c-rules-and-recommendations.html?lang=en
[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.
[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.
https://ww2.mathworks.cn/help/bugfinder/autosar-c-14.html?lang=en
[规则 A0-1-1] 项目中不得出现为非易失性变量赋值后,该值后续未被使用的情况。
[规则 A0-1-2] 非重载运算符、且返回类型非 void 的函数,其返回值必须被使用。
https://ww2.mathworks.cn/help/bugfinder/autosar-c-14.html?lang=en
[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.
https://ww2.mathworks.cn/help/bugfinder/cert-c-rules.html?lang=en
[DCL30-C] 为对象声明恰当的存储期。
[DCL39-C] 避免结构体填充带来的信息泄露。
[DCL40-C] 不要为同一个函数或对象创建不兼容的声明。
[DCL50-CPP] 不要定义 C 风格的可变参数函数。
https://ww2.mathworks.cn/help/bugfinder/cert-c-rules.html?lang=en
[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.
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.
规则 0-1-1 (必需)项目不应包含无法访问的代码。
规则 0-1-2 (必需)项目不应包含不可行的路径。
规则 0-1-3 (必需)项目不应包含未使用的变量。
规则 0-1-4 (必需)项目不应包含只有一种用途的非易失性 POD 变量。
https://ww2.mathworks.cn/help/bugfinder/misra-cpp-2023-rules-and-directives.html?lang=en
[规则 0.0.1 必需] 函数不得包含不可达语句。
[规则 0.0.2 建议] 控制表达式不应是不变的。
[规则 0.1.1 建议] 不应不必要地向局部对象写入值。
[规则 0.1.2 必需] 函数返回的值应当被使用。
https://ww2.mathworks.cn/help/bugfinder/misra-cpp-2023-rules-and-directives.html?lang=en
[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.
本文基于 Google C++ Style Guide 编写,通过规范 C++ 的代码风格,提高代码的可读性,可维护性,可扩展性,同时保证 C++ 语言的新特性得以高效使用。
模块目录结构如下:
colcon 是 ROS 2 默认的元构建工具,是 catkin_make、catkin_tools、ament_tools 的迭代升级版本,用于ROS 2工作空间的包构建、测试、打包与环境管理,支持ament_cmake、ament_python、纯CMake、Python setuptools等多种构建类型,采用拓扑序并行构建,原生支持工作空间叠加(overlay/underlay)机制,是ROS 2开发的核心工具。
本文基于ROS2 Humble LTS官方源码,从分层架构、核心模块源码实现、全链路通信流程三个维度,对ROS2核心源码进行深度拆解,同时补充关键设计思想与源码阅读路径。
本文基于ROS2最新LTS版本(Humble Hawksbill / Jazzy Jalisco)编写,覆盖从环境搭建、核心概念、开发流程、进阶特性到生态应用、避坑指南的全链路内容,兼顾入门与实战,是一份可直接落地的ROS2全栈使用手册。
DDS(Data Distribution Service,数据分发服务)是由OMG(对象管理组织) 标准化的、以数据为中心的发布-订阅(DCPS) 分布式实时通信中间件协议,专为高可靠、低延迟、高可用的分布式硬实时系统设计,是自动驾驶、工业4.0、航空航天、机器人等领域的核心通信标准。