

AWS IoT FleetWise 不再向新客戶開放。現有的 AWS IoT FleetWise 客戶可以繼續使用 服務。[上的連線行動性指南 AWS](https://aws.amazon.com/solutions/guidance/connected-mobility-on-aws/)提供如何為連線行動解決方案開發和部署模組化服務的指引，這些解決方案可用於實現與 AWS IoT FleetWise 同等的功能。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 匯入 AWS IoT FleetWise 訊號目錄
<a name="import-signal"></a>

您可以使用 AWS IoT FleetWise 主控台或 API 來匯入訊號目錄。

**Topics**
+ [匯入訊號目錄 （主控台）](#import-signal-catalog-console)
+ [匯入訊號目錄 (AWS CLI)](#import-signal-catalog)

## 匯入訊號目錄 （主控台）
<a name="import-signal-catalog-console"></a>

您可以使用 AWS IoT FleetWise 主控台匯入訊號目錄。

**重要**  
您最多可以有一個訊號目錄。如果您已經有訊號目錄，則不會在主控台中看到匯入訊號目錄的選項。

**匯入訊號目錄**

1. 開啟 [AWS IoT FleetWise 主控台](https://console.aws.amazon.com/iotfleetwise/)。

1. 在導覽窗格中，選擇**訊號目錄**。

1. 在訊號目錄摘要頁面上，選擇**匯入訊號目錄**。

1. 匯入包含訊號的檔案。
   + 若要從 S3 儲存貯體上傳檔案：

     1. 選擇 **Import from S3** (從 S3 匯入)。

     1. 選擇 **Browse S3** (瀏覽 S3)。

     1. 對於**儲存貯體**，輸入儲存貯體名稱或物件，從清單中選擇它，然後從清單中選擇檔案。選擇**選擇檔案**按鈕。

     或者，針對 **S3 URI**，輸入 Amazon Simple Storage Service URI。如需詳細資訊，請參閱《*Amazon S3 使用者指南*》中的[存取儲存貯體的方法](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-bucket-intro.html)。
   + 若要從您的電腦上傳檔案：

     1. 選擇**從檔案匯入**。

     1. 上傳 [車輛訊號規格 (VSS)](https://www.w3.org/auto/wg/wiki/Vehicle_Signal_Specification_(VSS)/Vehicle_Data_Spec) 格式的 .json 檔案。

1. 驗證訊號目錄，然後選擇**匯入檔案**。

## 匯入訊號目錄 (AWS CLI)
<a name="import-signal-catalog"></a>

您可以使用 [ImportSignalCatalog](https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_ImportSignalCatalog.html) API 操作上傳 JSON 檔案，以協助建立訊號目錄。您必須遵循 [車輛訊號規格 (VSS)](https://www.w3.org/auto/wg/wiki/Vehicle_Signal_Specification_(VSS)/Vehicle_Data_Spec) 將訊號儲存在 JSON 檔案中。下列範例使用 AWS CLI。

若要匯入訊號目錄，請執行下列命令。
+ 將 {{signal-catalog-name}} 取代為您建立的訊號目錄名稱。
+  （選用） 將描述取代為{{描述}}，以協助您識別訊號目錄。
+ 以包含 VSS 中定義訊號的 JSON 字串檔案名稱取代 {{signal-catalog-configuration-vss}}。

如需如何設定分支、屬性、感應器和致動器的詳細資訊，請參閱 [Configure AWS IoT FleetWise 訊號](define-signal.md)。

```
aws iotfleetwise import-signal-catalog \
                 --name {{signal-catalog-name}} \
                 --description  {{description}} \
                 --vss file://{{signal-catalog-configuration-vss}}.json
```

### 訊號目錄組態 (VSS)
<a name="signal-catalog-configuration-VSS"></a>

JSON 必須經過字串化並透過 `vssJson` 欄位傳遞。以下是 VSS 中定義的訊號範例。

```
{
	"Vehicle": {
		"type": "branch",
		"children": {
			"Chassis": {
				"type": "branch",
				"description": "All data concerning steering, suspension, wheels, and brakes.",
				"children": {
					"SteeringWheel": {
						"type": "branch",
						"description": "Steering wheel signals",
						"children": {
							"Diameter": {
								"type": "attribute",
								"description": "The diameter of the steering wheel",
								"datatype": "float",
								"unit": "cm",
								"min": 1,
								"max": 50
							},
							"HandsOff": {
								"type": "branch",
								"children": {
									"HandsOffSteeringState": {
										"type": "actuator",
										"description": "HndsOffStrWhlDtSt. Hands Off Steering State",
										"datatype": "boolean"
									},
									"HandsOffSteeringMode": {
										"type": "actuator",
										"description": "HndsOffStrWhlDtMd. Hands Off Steering Mode",
										"datatype": "int8",
										"min": 0,
										"max": 2
									}
								}
							}
						}
					},
					"Accelerator": {
						"type": "branch",
						"description": "",
						"children": {
							"AcceleratorPedalPosition": {
								"type": "sensor",
								"description": "Throttle__Position. Accelerator pedal position as percent. 0 = Not depressed. 100 = Fully depressed.",
								"datatype": "uint8",
								"unit": "%",
								"min": 0,
								"max": 100.000035
							}
						}
					}
				}
			},
			"Powertrain": {
				"type": "branch",
				"description": "Powertrain data for battery management, etc.",
				"children": {
					"Transmission": {
						"type": "branch",
						"description": "Transmission-specific data, stopping at the drive shafts.",
						"children": {
							"VehicleOdometer": {
								"type": "sensor",
								"description": "Vehicle_Odometer",
								"datatype": "float",
								"unit": "km",
								"min": 0,
								"max": 67108863.984375
							}
						}
					},
					"CombustionEngine": {
						"type": "branch",
						"description": "Engine-specific data, stopping at the bell housing.",
						"children": {
							"Engine": {
								"type": "branch",
								"description": "Engine description",
								"children": {
									"timing": {
										"type": "branch",
										"description": "timing description",
										"children": {
											"run_time": {
												"type": "sensor",
												"description": "Engine run time",
												"datatype": "int16",
												"unit": "ms",
												"min": 0,
												"max": 10000
											},
											"idle_time": {
												"type": "sensor",
												"description": "Engine idle time",
												"datatype": "int16",
												"min": 0,
												"unit": "ms",
												"max": 10000
											}
										}
									}
								}
							}
						}
					}
				}
			},
			"Axle": {
				"type": "branch",
				"description": "Axle signals",
				"children": {
					"TireRRPrs": {
						"type": "sensor",
						"description": "TireRRPrs. Right rear Tire pressure in kilo-Pascal",
						"datatype": "float",
						"unit": "kPaG",
						"min": 0,
						"max": 1020
					}
				}
			}
		}
	},
	"Cameras": {
		"type": "branch",
		"description": "Branch to aggregate all cameras in the vehicle",
		"children": {
			"FrontViewCamera": {
				"type": "sensor",
				"datatype": "VehicleDataTypes.SVMCamera",
				"description": "Front view camera"
			},
			"RearViewCamera": {
				"type": "sensor",
				"datatype": "VehicleDataTypes.SVMCamera",
				"description": "Rear view camera"
			},
			"LeftSideViewCamera": {
				"type": "sensor",
				"datatype": "VehicleDataTypes.SVMCamera",
				"description": "Left side view camera"
			},
			"RightSideViewCamera": {
				"type": "sensor",
				"datatype": "VehicleDataTypes.SVMCamera",
				"description": "Right side view camera"
			}
		}
	},
	"ComplexDataTypes": {
		"VehicleDataTypes": {
			"type": "branch",
			"description": "Branch to aggregate all camera related higher order data types",
			"children": {
				"SVMCamera": {
					"type": "struct",
					"description": "This data type represents Surround View Monitor (SVM) camera system in a vehicle",
					"comment": "Test comment",
					"deprecation": "Test deprecation message",
					"children": {
						"Make": {
							"type": "property",
							"description": "Make of the SVM camera",
							"datatype": "string",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Description": {
							"type": "property",
							"description": "Description of the SVM camera",
							"datatype": "string",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"FPS": {
							"type": "property",
							"description": "FPS of the SVM camera",
							"datatype": "double",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Orientation": {
							"type": "property",
							"description": "Orientation of the SVM camera",
							"datatype": "VehicleDataTypes.Orientation",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Range": {
							"type": "property",
							"description": "Range of the SVM camera",
							"datatype": "VehicleDataTypes.Range",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"RawData": {
							"type": "property",
							"description": "Represents binary data of the SVM camera",
							"datatype": "uint8[]",
							"dataencoding": "binary",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"CapturedFrames": {
							"type": "property",
							"description": "Represents selected frames captured by the SVM camera",
							"datatype": "VehicleDataTypes.Frame[]",
							"dataencoding": "typed",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						}
					}
				},
				"Range": {
					"type": "struct",
					"description": "Range of a camera in centimeters",
					"comment": "Test comment",
					"deprecation": "Test deprecation message",
					"children": {
						"Min": {
							"type": "property",
							"description": "Minimum range of a camera in centimeters",
							"datatype": "uint32",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Max": {
							"type": "property",
							"description": "Maximum range of a camera in centimeters",
							"datatype": "uint32",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						}
					}
				},
				"Orientation": {
					"type": "struct",
					"description": "Orientation of a camera",
					"comment": "Test comment",
					"deprecation": "Test deprecation message",
					"children": {
						"Front": {
							"type": "property",
							"description": "Indicates whether the camera is oriented to the front of the vehicle",
							"datatype": "boolean",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Rear": {
							"type": "property",
							"description": "Indicates whether the camera is oriented to the rear of the vehicle",
							"datatype": "boolean",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						},
						"Side": {
							"type": "property",
							"description": "Indicates whether the camera is oriented to the side of the vehicle",
							"datatype": "boolean",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						}
					}
				},
				"Frame": {
					"type": "struct",
					"description": "Represents a camera frame",
					"comment": "Test comment",
					"deprecation": "Test deprecation message",
					"children": {
						"Data": {
							"type": "property",
							"datatype": "string",
							"dataencoding": "binary",
							"comment": "Test comment",
							"deprecation": "Test deprecation message"
						}
					}
				}
			}
		}
	}
 
}
```

下列範例顯示在 JSON 字串中 VSS 中定義的相同訊號。

```
{
   "vssJson": "{\"Vehicle\":{\"type\":\"branch\",\"children\":{\"Chassis\":{\"type\":\"branch\",\"description\":\"All data concerning steering, suspension, wheels, and brakes.\",\"children\":{\"SteeringWheel\":{\"type\":\"branch\",\"description\":\"Steering wheel signals\",\"children\":{\"Diameter\":{\"type\":\"attribute\",\"description\":\"The diameter of the steering wheel\",\"datatype\":\"float\",\"unit\":\"cm\",\"min\":1,\"max\":50},\"HandsOff\":{\"type\":\"branch\",\"children\":{\"HandsOffSteeringState\":{\"type\":\"actuator\",\"description\":\"HndsOffStrWhlDtSt. Hands Off Steering State\",\"datatype\":\"boolean\"},\"HandsOffSteeringMode\":{\"type\":\"actuator\",\"description\":\"HndsOffStrWhlDtMd. Hands Off Steering Mode\",\"datatype\":\"int8\",\"min\":0,\"max\":2}}}}},\"Accelerator\":{\"type\":\"branch\",\"description\":\"\",\"children\":{\"AcceleratorPedalPosition\":{\"type\":\"sensor\",\"description\":\"Throttle__Position. Accelerator pedal position as percent. 0 = Not depressed. 100 = Fully depressed.\",\"datatype\":\"uint8\",\"unit\":\"%\",\"min\":0,\"max\":100.000035}}}}},\"Powertrain\":{\"type\":\"branch\",\"description\":\"Powertrain data for battery management, etc.\",\"children\":{\"Transmission\":{\"type\":\"branch\",\"description\":\"Transmission-specific data, stopping at the drive shafts.\",\"children\":{\"VehicleOdometer\":{\"type\":\"sensor\",\"description\":\"Vehicle_Odometer\",\"datatype\":\"float\",\"unit\":\"km\",\"min\":0,\"max\":67108863.984375}}},\"CombustionEngine\":{\"type\":\"branch\",\"description\":\"Engine-specific data, stopping at the bell housing.\",\"children\":{\"Engine\":{\"type\":\"branch\",\"description\":\"Engine description\",\"children\":{\"timing\":{\"type\":\"branch\",\"description\":\"timing description\",\"children\":{\"run_time\":{\"type\":\"sensor\",\"description\":\"Engine run time\",\"datatype\":\"int16\",\"unit\":\"ms\",\"min\":0,\"max\":10000},\"idle_time\":{\"type\":\"sensor\",\"description\":\"Engine idle time\",\"datatype\":\"int16\",\"min\":0,\"unit\":\"ms\",\"max\":10000}}}}}}}}},\"Axle\":{\"type\":\"branch\",\"description\":\"Axle signals\",\"children\":{\"TireRRPrs\":{\"type\":\"sensor\",\"description\":\"TireRRPrs. Right rear Tire pressure in kilo-Pascal\",\"datatype\":\"float\",\"unit\":\"kPaG\",\"min\":0,\"max\":1020}}}}}}"
}
```

**注意**  
您可以下載[示範指令碼](https://raw.githubusercontent.com/aws/aws-iot-fleetwise-edge/main/tools/cloud/ros2-to-nodes.py)，將 ROS 2 訊息轉換為與訊號目錄相容的 VSS JSON 檔案。如需詳細資訊，請參閱 [https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb](https://github.com/aws/aws-iot-fleetwise-edge/blob/main/docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb)。  
視覺系統資料處於預覽版本，可能會有所變更。

如果您使用客戶受管 AWS KMS 金鑰[啟用加密](key-management.md)，請包含下列政策陳述式，讓您的角色可以叫用 `ImportSignalCatalog` 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}}"
            ]
        }
    ]
}
```

------