Skip to content

Commit e358650

Browse files
committed
Improve VSD demo guide
1 parent df23595 commit e358650

File tree

1 file changed

+54
-45
lines changed

1 file changed

+54
-45
lines changed

docs/dev-guide/vision-system-data/vision-system-data-demo.ipynb

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
"\n",
5050
"## Basics and understanding VSS and Vision System Data\n",
5151
"\n",
52-
"VSS (Vehicle Signal Specification) primarily resembles the physical structure of the vehicle, so\n",
53-
"there often isn't a need to repeat branches and data entries (like doors or axles). There isn't one\n",
52+
"VSS (Vehicle Signal Specification) primarily resembles the physical structure of the vehicle. There isn't one\n",
5453
"ADAS camera or controller manufacturer in the automotive industry, and OEMs use different vendors or\n",
5554
"the same OEM may use different vendors for different vehicle models. AWS IoT FleetWise provides an\n",
5655
"advantage because with VSS standardization, you can bring your own Interface Definition Language\n",
@@ -96,8 +95,7 @@
9695
"\n",
9796
"ROS 2 messages are modeled using four essential VSS components:\n",
9897
"\n",
99-
"- **Branch**: a branch is a tree node that contains other nodes. It can be a simple branch or a\n",
100-
" struct that has children nodes.\n",
98+
"- **Branch**: a branch is a tree node that contains other nodes.\n",
10199
"\n",
102100
"- **Sensor**: A sensor is a modeled primitive or complex value that is collected from the vehicle.\n",
103101
" For ROS 2, the ROS topic is modeled as a sensor, such as `/Cameras/Front/Image`.\n",
@@ -157,25 +155,27 @@
157155
"[here](https://aws.amazon.com/ec2/pricing/on-demand/).\n",
158156
"\n",
159157
"1. Launch an EC2 Graviton instance with administrator permissions:\n",
160-
" [**Launch CloudFormation Template**](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateUrl=https%3A%2F%2Faws-iot-fleetwise.s3.us-west-2.amazonaws.com%2Flatest%2Fcfn-templates%2Fvision-system-data-jupyter.yml&stackName=fwdev-jupyter).\n",
158+
" [**Launch CloudFormation Template**](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateUrl=https%3A%2F%2Faws-iot-fleetwise.s3.us-west-2.amazonaws.com%2Flatest%2Fcfn-templates%2Fvision-system-data-jupyter.yml&stackName=vision-system-data-jupyter).\n",
159+
"1. Enter the **Name** of an existing SSH key pair in your account from\n",
160+
" [here](https://us-east-1.console.aws.amazon.com/ec2/v2/home?region=us-east-1#KeyPairs:).\n",
161+
" 1. Do not include the file suffix `.pem`.\n",
162+
" 1. If you do not have an SSH key pair, you will need to create one and download the corresponding\n",
163+
" `.pem` file. Be sure to update the file permissions: `chmod 400 <PATH_TO_PEM>`\n",
161164
"1. **Select the checkbox** next to _'I acknowledge that AWS CloudFormation might create IAM\n",
162165
" resources with custom names.'_\n",
163166
"1. Choose **Create stack**.\n",
164167
"1. Wait until the status of the Stack is **CREATE_COMPLETE**; this can take up to ten minutes.\n",
165168
"1. For security purposes, the created stack does not expose the jupyter server to the internet.\n",
166-
" Instead, you will have to create an ssh port forwarding to you EC2 instance from your local\n",
167-
" machine. Execute the following from a local terminal, replacing `<NAME-OF-YOUR-KEY>` and\n",
168-
" `<IP-OF-EC2-INSTANCE>`:\n",
169+
" Instead, you will have to create an SSH port forwarding to you EC2 instance from your local\n",
170+
" machine. Go to the **Outputs** tab, then copy/paste the given `SSHPortForwarding` command to your\n",
171+
" local terminal, and adjust the path to your downloaded PEM file as required before executing it:\n",
169172
" ```bash\n",
170-
" chmod 400 <NAME-OF-YOUR-KEY>.pem\n",
171-
" ssh -i <NAME-OF-YOUR-KEY>.pem -N -L 8888:localhost:8888 ubuntu@<IP-OF-EC2-INSTANCE>\n",
173+
" ssh -i <PATH_TO_PEM> -N -L 8888:localhost:8888 ubuntu@<EC2_PUBLIC_IP_ADDRESS>\n",
172174
" ```\n",
173-
"1. With the ssh port forward set up, select the **Outputs** tab, and click on the link corresponding\n",
174-
" to `WebAccessWithPortForwarding`. This will automatically log you into the server. Note that by\n",
175-
" default, the `WebAccess` link will not be accessible as the default security group prevents\n",
176-
" public http access.\n",
175+
"1. With the SSH port forward set up, select the **Outputs** tab, and click on the link corresponding\n",
176+
" to `WebAccessWithPortForwarding`. This will automatically log you into the Jupyter Notebook server.\n",
177177
"1. Once logged in, click on `vision-system-data-demo.ipynb` from the left navigation bar to start\n",
178-
" the interactive demo"
178+
" the interactive demo."
179179
]
180180
},
181181
{
@@ -208,7 +208,7 @@
208208
"source": [
209209
"cd\n",
210210
"curl \"https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip\" -o \"awscliv2.zip\"\n",
211-
"unzip -q awscliv2.zip\n",
211+
"unzip -q -o awscliv2.zip\n",
212212
"sudo ./aws/install --update\n",
213213
"if ! ( aws iotfleetwise create-decoder-manifest help | grep -q ros2 ); then\n",
214214
" echo \"Error: The AWS CLI does not support the vision system data feature.\" >&2\n",
@@ -292,7 +292,10 @@
292292
"You can either download a pre-built binary, or build it from source.\n",
293293
"\n",
294294
"<div class=\"alert alert-block alert-info\">\n",
295-
"Note: If you want to use your own custom ROS2 messages, you will need to <a href=\"#optional-building-from-source\">build it from source</a>.\n",
295+
" Note:\n",
296+
"\n",
297+
" - If you want to use your own custom ROS2 messages, you will need to <a href=\"#optional-building-from-source\">build it from source</a>.\n",
298+
" - The command `install-deps-native.sh` below only installs a minimum ROS2 runtime, not the full `ros-galactic-desktop` package.\n",
296299
"</div>\n",
297300
"\n",
298301
"### Downloading the pre-built binary\n",
@@ -694,18 +697,17 @@
694697
}
695698
},
696699
"source": [
697-
"2. **Optional:** If you are interested in viewing the example source data you can also download the file to your local machine and open it in [Foxglove Studio](https://foxglove.dev/).\n",
700+
"**Optional:** If you are interested in viewing the example source data you can also download the file to your local machine and open it in [Foxglove Studio](https://foxglove.dev/).\n",
698701
"![Foxglove studio screenshot](foxglove-studio-screenshot.jpg)\n",
699-
"\n",
700-
" * Download the ROS2 rosbag file: https://s3.console.aws.amazon.com/s3/object/aws-iot-fleetwise?region=us-east-1&prefix=rosbag2_vision_system_data_demo.db3\n",
701-
" * Download and install Foxglove Studio: https://foxglove.dev/download\n",
702-
" * In Foxglove Studio, open the ROS2 rosbag file:\n",
703-
" * Click 'Open local file'.\n",
704-
" * Select the `rosbag2_vision_system_data_demo.db3` file.\n",
705-
" * Click on the 'Layouts' tab on the left.\n",
706-
" * Click on the 'Import layout' button.\n",
707-
" * Select the file in this folder `vision-system-data-foxglove-layout.json`.\n",
708-
" * Click the 'Play' button to playback the recording.\n",
702+
"* Download the ROS2 rosbag file: https://s3.console.aws.amazon.com/s3/object/aws-iot-fleetwise?region=us-east-1&prefix=rosbag2_vision_system_data_demo.db3\n",
703+
" * Download and install Foxglove Studio: https://foxglove.dev/download\n",
704+
" * In Foxglove Studio, open the ROS2 rosbag file:\n",
705+
" * Click 'Open local file'.\n",
706+
" * Select the `rosbag2_vision_system_data_demo.db3` file.\n",
707+
" * Click on the 'Layouts' tab on the left.\n",
708+
" * Click on the 'Import layout' button.\n",
709+
" * Select the file in this folder `vision-system-data-foxglove-layout.json`.\n",
710+
" * Click the 'Play' button to playback the recording.\n",
709711
"\n",
710712
"\n",
711713
"## Creating the necessary files"
@@ -2183,7 +2185,12 @@
21832185
"source": [
21842186
"For this demo, let's use the time-based campaign.\n",
21852187
"\n",
2186-
"Let's first populate the campaign definition with the correct signal catalog ARN and fleet ARN:"
2188+
"Let's first populate the campaign definition with the correct signal catalog ARN and fleet ARN,\n",
2189+
"and a data destination of the S3 bucket in [Apache Parquet](https://parquet.apache.org/) format:\n",
2190+
"\n",
2191+
"<div class=\"alert alert-block alert-info\">\n",
2192+
"Note: To collect data in the JSON format, uncomment the second line.\n",
2193+
"</div>"
21872194
]
21882195
},
21892196
{
@@ -2226,22 +2233,29 @@
22262233
}
22272234
],
22282235
"source": [
2236+
"DATA_FORMAT=\"PARQUET\"\n",
2237+
"# DATA_FORMAT=\"JSON\"\n",
2238+
"\n",
22292239
"CAMPAIGN=`cat ${S3_CAMPAIGN_FILE} \\\n",
2230-
" | jq .name=\\\"${CAMPAIGN_NAME}\\\" \\\n",
2231-
" | jq .signalCatalogArn=\\\"${SIGNAL_CATALOG_ARN}\\\" \\\n",
2232-
" | jq .targetArn=\\\"${FLEET_ARN}\\\"`\n",
2240+
" | jq \".name=\\\"${CAMPAIGN_NAME}\\\"\" \\\n",
2241+
" | jq \".signalCatalogArn=\\\"${SIGNAL_CATALOG_ARN}\\\"\" \\\n",
2242+
" | jq \".targetArn=\\\"${FLEET_ARN}\\\"\" \\\n",
2243+
" | jq \".dataDestinationConfigs=[{ \\\n",
2244+
" s3Config:{ \\\n",
2245+
" bucketArn:\\\"arn:aws:s3:::${S3_BUCKET_NAME}\\\", \\\n",
2246+
" prefix:\\\"${CAMPAIGN_NAME}-s3\\\", \\\n",
2247+
" dataFormat:\\\"${DATA_FORMAT}\\\", \\\n",
2248+
" storageCompressionFormat:\\\"NONE\\\" \\\n",
2249+
" } \\\n",
2250+
" }]\"`\n",
22332251
"echo $CAMPAIGN | jq -C"
22342252
]
22352253
},
22362254
{
22372255
"cell_type": "markdown",
22382256
"metadata": {},
22392257
"source": [
2240-
"To deploy it to the vehicle, run:\n",
2241-
"\n",
2242-
"<div class=\"alert alert-block alert-info\">\n",
2243-
"Note: to collect data in the json format, uncomment the second line.\n",
2244-
"</div>"
2258+
"To create the campaign, run:"
22452259
]
22462260
},
22472261
{
@@ -2252,12 +2266,7 @@
22522266
},
22532267
"outputs": [],
22542268
"source": [
2255-
"DATA_FORMAT=\"PARQUET\"\n",
2256-
"# DATA_FORMAT=\"JSON\"\n",
2257-
"\n",
2258-
"aws ${ENDPOINT_URL_OPTION} --region $REGION iotfleetwise create-campaign \\\n",
2259-
" --cli-input-json \"${CAMPAIGN}\" \\\n",
2260-
" --data-destination-configs \"[{\\\"s3Config\\\":{\\\"bucketArn\\\":\\\"arn:aws:s3:::${S3_BUCKET_NAME}\\\",\\\"prefix\\\":\\\"${CAMPAIGN_NAME}-s3\\\",\\\"dataFormat\\\":\\\"${DATA_FORMAT}\\\",\\\"storageCompressionFormat\\\":\\\"NONE\\\"}}]\"| jq -r .arn"
2269+
"aws ${ENDPOINT_URL_OPTION} --region $REGION iotfleetwise create-campaign --cli-input-json \"${CAMPAIGN}\" | jq -r .arn"
22612270
]
22622271
},
22632272
{
@@ -2289,7 +2298,7 @@
22892298
"cell_type": "markdown",
22902299
"metadata": {},
22912300
"source": [
2292-
"After successful deployment, approve your campaign by running:"
2301+
"After successful creation, approve your campaign by running the following command. This will deploy the campaign to the fleet."
22932302
]
22942303
},
22952304
{
@@ -2307,7 +2316,7 @@
23072316
"cell_type": "markdown",
23082317
"metadata": {},
23092318
"source": [
2310-
"To verify that the campaign was deployed to the vehicle, we wait until the vehicle status transitions from `READY` to `HEALTHY`"
2319+
"To verify that the campaign was deployed to the vehicle in the fleet, we wait until the vehicle status transitions from `READY` to `HEALTHY`"
23112320
]
23122321
},
23132322
{

0 commit comments

Comments
 (0)