|
49 | 49 | "\n",
|
50 | 50 | "## Basics and understanding VSS and Vision System Data\n",
|
51 | 51 | "\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", |
54 | 53 | "ADAS camera or controller manufacturer in the automotive industry, and OEMs use different vendors or\n",
|
55 | 54 | "the same OEM may use different vendors for different vehicle models. AWS IoT FleetWise provides an\n",
|
56 | 55 | "advantage because with VSS standardization, you can bring your own Interface Definition Language\n",
|
|
96 | 95 | "\n",
|
97 | 96 | "ROS 2 messages are modeled using four essential VSS components:\n",
|
98 | 97 | "\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", |
101 | 99 | "\n",
|
102 | 100 | "- **Sensor**: A sensor is a modeled primitive or complex value that is collected from the vehicle.\n",
|
103 | 101 | " For ROS 2, the ROS topic is modeled as a sensor, such as `/Cameras/Front/Image`.\n",
|
|
157 | 155 | "[here](https://aws.amazon.com/ec2/pricing/on-demand/).\n",
|
158 | 156 | "\n",
|
159 | 157 | "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", |
161 | 164 | "1. **Select the checkbox** next to _'I acknowledge that AWS CloudFormation might create IAM\n",
|
162 | 165 | " resources with custom names.'_\n",
|
163 | 166 | "1. Choose **Create stack**.\n",
|
164 | 167 | "1. Wait until the status of the Stack is **CREATE_COMPLETE**; this can take up to ten minutes.\n",
|
165 | 168 | "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", |
169 | 172 | " ```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", |
172 | 174 | " ```\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", |
177 | 177 | "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." |
179 | 179 | ]
|
180 | 180 | },
|
181 | 181 | {
|
|
208 | 208 | "source": [
|
209 | 209 | "cd\n",
|
210 | 210 | "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", |
212 | 212 | "sudo ./aws/install --update\n",
|
213 | 213 | "if ! ( aws iotfleetwise create-decoder-manifest help | grep -q ros2 ); then\n",
|
214 | 214 | " echo \"Error: The AWS CLI does not support the vision system data feature.\" >&2\n",
|
|
292 | 292 | "You can either download a pre-built binary, or build it from source.\n",
|
293 | 293 | "\n",
|
294 | 294 | "<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", |
296 | 299 | "</div>\n",
|
297 | 300 | "\n",
|
298 | 301 | "### Downloading the pre-built binary\n",
|
|
694 | 697 | }
|
695 | 698 | },
|
696 | 699 | "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", |
698 | 701 | "\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", |
709 | 711 | "\n",
|
710 | 712 | "\n",
|
711 | 713 | "## Creating the necessary files"
|
|
2183 | 2185 | "source": [
|
2184 | 2186 | "For this demo, let's use the time-based campaign.\n",
|
2185 | 2187 | "\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>" |
2187 | 2194 | ]
|
2188 | 2195 | },
|
2189 | 2196 | {
|
|
2226 | 2233 | }
|
2227 | 2234 | ],
|
2228 | 2235 | "source": [
|
| 2236 | + "DATA_FORMAT=\"PARQUET\"\n", |
| 2237 | + "# DATA_FORMAT=\"JSON\"\n", |
| 2238 | + "\n", |
2229 | 2239 | "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", |
2233 | 2251 | "echo $CAMPAIGN | jq -C"
|
2234 | 2252 | ]
|
2235 | 2253 | },
|
2236 | 2254 | {
|
2237 | 2255 | "cell_type": "markdown",
|
2238 | 2256 | "metadata": {},
|
2239 | 2257 | "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:" |
2245 | 2259 | ]
|
2246 | 2260 | },
|
2247 | 2261 | {
|
|
2252 | 2266 | },
|
2253 | 2267 | "outputs": [],
|
2254 | 2268 | "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" |
2261 | 2270 | ]
|
2262 | 2271 | },
|
2263 | 2272 | {
|
|
2289 | 2298 | "cell_type": "markdown",
|
2290 | 2299 | "metadata": {},
|
2291 | 2300 | "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." |
2293 | 2302 | ]
|
2294 | 2303 | },
|
2295 | 2304 | {
|
|
2307 | 2316 | "cell_type": "markdown",
|
2308 | 2317 | "metadata": {},
|
2309 | 2318 | "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`" |
2311 | 2320 | ]
|
2312 | 2321 | },
|
2313 | 2322 | {
|
|
0 commit comments