创建 I AWS oT FleetWise 解码器清单 - AWS物联网 FleetWise

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

创建 I AWS oT FleetWise 解码器清单

重要

目前对某些AWS物联网 FleetWise 功能的访问受到限制。有关更多信息,请参阅 AWSAWS 物联网中的区域和功能可用性 FleetWise

您可以使用AWS IoT FleetWise 控制台或 API 为您的车辆模型创建解码器清单。

创建解码器清单(控制台)

您可以使用AWS IoT FleetWise 控制台创建与您的车辆型号关联的解码器清单。

重要

您无法使用物AWS联 FleetWise网控制台在解码器清单中配置视觉系统数据信号。可改用AWS CLI。视觉系统数据目前为预览版,可能会发生变化。

创建解码器清单
  1. 打开AWS物联网 FleetWise 控制台

  2. 在导航窗格中,选择车辆型号

  3. 选择目标车辆型号。

  4. 在“车辆型号摘要”页面上,选择创建解码器清单,然后执行以下操作。

步骤 1:配置解码器清单

一般信息部分,执行以下操作:

  1. 为解码器清单输入唯一名称。

  2. (可选)输入描述。

  3. 选择下一步

添加网络接口

每个解码器清单必须具有至少一个网络接口。您可以向解码器清单中添加多个网络接口。

添加网络接口
  1. 上传网络接口文件。您可以上传适用于 CAN 协议的.dbc 文件,或者为 ROS 2 或自定义接口上传.json 文件。

  2. 输入您的网络接口的名称。如果您上传了自定义接口,则名称已提供。

映射缺失信号

如果车辆模型中有信号在上传的网络接口中缺少配对信号解码器,则可以创建一个默认的自定义解码器来映射缺失的信号。这是可选的,因为您可以在下一步中手动映射信号。

创建默认的自定义解码器
  1. 选择 “为缺失的信号创建默认的自定义解码器”。

  2. 选择下一步

第 2 步:映射 CAN 接口

您可以使用 CAN 信号解码器映射 CAN 信号。如果您选中 “为缺失的信号创建默认自定义解码器” 复选框,则任何缺少解码器信号的信号都会自动映射到默认的自定义信号解码器。

要映射 CAN 信号
  1. CAN 信号映射中,选择信号解码器。

  2. 选择下一步

注意

如果您添加了 ROS 2 或自定义接口,则可以在创建解码器清单之前验证映射。

第 3 步:审核并创建

验证解码器清单的配置,然后选择创建

创建解码器清单 (AWS CLI)

您可以使用 CreateDecoderManifestAPI 操作来创建解码器清单。下面的示例使用了AWS CLI。

重要

在创建解码器清单之前,您必须拥有车辆型号。每个解码器清单都必须与车辆型号相关联。有关更多信息,请参阅 创建AWS物联网 FleetWise 车辆模型

要创建解码器清单,请运行以下命令。

decoder-manifest-configuration替换为包含配置的.json 文件的名称。

aws iotfleetwise create-decoder-manifest --cli-input-json file://decoder-manifest-configuration.json
  • decoder-manifest-name替换为您正在创建的解码器清单的名称。

  • vehicle-model-ARN替换为车辆型号的 Amazon 资源名称 (ARN)。

  • (可选)description替换为描述以帮助您识别解码器清单。

有关如何配置分支、属性、传感器和执行器的更多信息,请参阅配置AWS IoT FleetWise 网络接口和解码器信号

{ "name": "decoder-manifest-name", "modelManifestArn": "vehicle-model-arn", "description": "description", "networkInterfaces": [ { "canInterface": { "name": "myNetworkInterface", "protocolName": "CAN", "protocolVersion": "2.0b" }, "interfaceId": "Qq1acaenByOB3sSM39SYm", "type": "CAN_INTERFACE" } ], "signalDecoders": [ { "canSignal": { "name": "Engine_Idle_Time", "factor": 1, "isBigEndian": true, "isSigned": false, "length": 24, "messageId": 271343712, "offset": 0, "startBit": 16 }, "fullyQualifiedName": "Vehicle.EngineIdleTime", "interfaceId": "Qq1acaenByOB3sSM39SYm", "type": "CAN_SIGNAL" }, { "canSignal": { "name": "Engine_Run_Time", "factor": 1, "isBigEndian": true, "isSigned": false, "length": 24, "messageId": 271343712, "offset": 0, "startBit": 40 }, "fullyQualifiedName": "Vehicle.EngineRunTime", "interfaceId": "Qq1acaenByOB3sSM39SYm", "type": "CAN_SIGNAL" } ] }
  • decoder-manifest-name替换为您正在创建的解码器清单的名称。

  • vehicle-model-ARN替换为车辆型号的 Amazon 资源名称 (ARN)。

  • (可选)description替换为描述以帮助您识别解码器清单。

结构(结构体)中属性节点的顺序必须与信号目录和车辆模型(模型清单)中定义的顺序保持一致。有关如何配置分支、属性、传感器和执行器的更多信息,请参阅配置AWS IoT FleetWise 网络接口和解码器信号

{ "name": "decoder-manifest-name", "modelManifestArn": "vehicle-model-arn", "description": "description", "networkInterfaces": [{ "canInterface": { "name": "myNetworkInterface", "protocolName": "CAN", "protocolVersion": "2.0b" }, "interfaceId": "Qq1acaenByOB3sSM39SYm", "type": "CAN_INTERFACE" }, { "type": "VEHICLE_MIDDLEWARE", "interfaceId": "G1KzxkdnmV5Hn7wkV3ZL9", "vehicleMiddleware": { "name": "ROS2_test", "protocolName": "ROS_2" } }], "signalDecoders": [{ "canSignal": { "name": "Engine_Idle_Time", "factor": 1, "isBigEndian": true, "isSigned": false, "length": 24, "messageId": 271343712, "offset": 0, "startBit": 16 }, "fullyQualifiedName": "Vehicle.EngineIdleTime", "interfaceId": "Qq1acaenByOB3sSM39SYm", "type": "CAN_SIGNAL" }, { "canSignal": { "name": "Engine_Run_Time", "factor": 1, "isBigEndian": true, "isSigned": false, "length": 24, "messageId": 271343712, "offset": 0, "startBit": 40 }, "fullyQualifiedName": "Vehicle.EngineRunTime", "interfaceId": "Qq1acaenByOB3sSM39SYm", "type": "CAN_SIGNAL" }, { "fullyQualifiedName": "Vehicle.CompressedImageTopic", "type": "MESSAGE_SIGNAL", "interfaceId": "G1KzxkdnmV5Hn7wkV3ZL9", "messageSignal": { "topicName": "CompressedImageTopic:sensor_msgs/msg/CompressedImage", "structuredMessage": { "structuredMessageDefinition": [{ "fieldName": "header", "dataType": { "structuredMessageDefinition": [{ "fieldName": "stamp", "dataType": { "structuredMessageDefinition": [{ "fieldName": "sec", "dataType": { "primitiveMessageDefinition": { "ros2PrimitiveMessageDefinition": { "primitiveType": "INT32" } } } }, { "fieldName": "nanosec", "dataType": { "primitiveMessageDefinition": { "ros2PrimitiveMessageDefinition": { "primitiveType": "UINT32" } } } } ] } }, { "fieldName": "frame_id", "dataType": { "primitiveMessageDefinition": { "ros2PrimitiveMessageDefinition": { "primitiveType": "STRING" } } } } ] } }, { "fieldName": "format", "dataType": { "primitiveMessageDefinition": { "ros2PrimitiveMessageDefinition": { "primitiveType": "STRING" } } } }, { "fieldName": "data", "dataType": { "structuredMessageListDefinition": { "name": "listType", "memberType": { "primitiveMessageDefinition": { "ros2PrimitiveMessageDefinition": { "primitiveType": "UINT8" } } }, "capacity": 0, "listType": "DYNAMIC_UNBOUNDED_CAPACITY" } } } ] } } } ] }
  • decoder-manifest-name替换为您正在创建的解码器清单的名称。

  • vehicle-model-ARN替换为车辆型号的 Amazon 资源名称 (ARN)。

  • (可选)description替换为描述以帮助您识别解码器清单。

有关如何配置分支、属性、传感器和执行器的更多信息,请参阅配置AWS IoT FleetWise 网络接口和解码器信号

{ "name": "decoder-manifest-name", "modelManifestArn": "vehicle-model-arn", "description": "description", "networkInterfaces": [ { "interfaceId": "myCustomInterfaceId", "type": "CUSTOM_DECODING_INTERFACE", "customDecodingInterface": { "name": "myCustomInterface" } } ], "signalDecoders": [ { "customDecodingSignal": { "fullyQualifiedName": "Vehicle.actuator1", "interfaceId": "myCustomInterfaceId", "type": "CUSTOM_DECODING_SIGNAL", "customDecodingSignal": { "id": "Vehicle.actuator1" } } }, { "customDecodingSignal": { "fullyQualifiedName": "Vehicle.actuator2", "interfaceId": "myCustomInterfaceId", "type": "CUSTOM_DECODING_SIGNAL", "customDecodingSignal": { "id": "Vehicle.actuator2" } } } ] }
注意

您可以下载演示脚本来创建包含视觉系统信号的解码器清单。有关更多信息,请参阅视觉系统数据开发人员指南

视觉系统数据目前为预览版,可能会发生变化。

如果您启用了使用客户托管AWS KMS密钥的加密,请包括以下政策声明,以便您的角色可以调用 CreateDecoderManifest API 操作。

JSON
{ "Version":"2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "kms:GenerateDataKey*", "kms:Decrypt" ], "Resource": [ "arn:aws:kms:us-east-1:111122223333:key/KMS_KEY_ID" ] } ] }