From 3f8bc474289125fefb3992b2ebae43b219a887cd Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 29 Aug 2023 11:56:35 -0400 Subject: [PATCH 01/24] make csi page --- docs/components/board/jetson.md | 3 + docs/extend/modular-resources/examples/csi.md | 91 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 docs/extend/modular-resources/examples/csi.md diff --git a/docs/components/board/jetson.md b/docs/components/board/jetson.md index 9812233b9c..14ce77db7a 100644 --- a/docs/components/board/jetson.md +++ b/docs/components/board/jetson.md @@ -13,6 +13,9 @@ tags: ["board", "components"] Follow one of our Jetson [setup guides](/installation/) to prepare your board for running `viam-server` before configuring a `jetson` board. +If after configuring a `jetson` board you want to add your Orin Nano's CSI camera to your robot, you can with Viam's `csi` module. +Follow [these instructions](/extend/modular-resources/examples/csi) to do so. + {{% /alert %}} Configure a `jetson` board to integrate a [NVIDIA Jetson Orin Module and Developer Kit](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-orin/), [NVIDIA Jetson Xavier NX](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-agx-xavier/), or [NVIDIA Jetson Nano](https://www.nvidia.com/en-us/autonomous-machines/embedded-systems/jetson-nano/) into your robot: diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md new file mode 100644 index 0000000000..add2ff3290 --- /dev/null +++ b/docs/extend/modular-resources/examples/csi.md @@ -0,0 +1,91 @@ +--- +title: "Add an ODrive motor as a Modular Resource" +linkTitle: "ODrive" +weight: 40 +type: "docs" +description: "How to add an ODrive motor with serial or CANbus communication as a modular resource of your robot." +tags: ["motor", "odrive", "canbus", "serial", "module", "modular resources", "Python", "python SDK", "CAN"] +# SMEs: Kim, Martha, Rand +--- + +The [Viam GitHub](https://github.com/viamrobotics/odrive) provides an implementation of ODrive Robotics' [ODrive S1](https://odriverobotics.com/shop/odrive-s1) motor driver as module defining two modular resources [extending](/extend/modular-resources/) the [motor API](/components/motor/#api) as new motor types. + +[Install requirements](#requirements) and [configure](#configuration) the module to configure an `serial` or `canbus` [motor](/components/motor/) {{< glossary_tooltip term_id="resource" text="resource" >}} on your robot. + +## Requirements + +On your robot's computer, download [the Viam `csi` appimage](https://github.com/viamrobotics/odrive) and make it executable: + +``` {class="command-line" data-prompt="$"} +sudo wget https://github.com/seanavery/viam-csi/releases/download/v0.0.2/viam-csi-0.0.2-aarch64.AppImage -O /usr/local/bin/viam-csi +sudo chmod 755 /usr/local/bin/viam-csi +``` + +## Configuration + +### Module + +{{< tabs name="Add the ODrive module">}} +{{% tab name="Config Builder" %}} + +Go to your robot's page on the [Viam app](https://app.viam.com/). +Navigate to the **Config** tab on your robot's page, and click on the **Modules** subtab. + +Copy and the csi module with a name of your choice. + +![The ODrive module with the name 'odrive' and executable path '~/desktop/odrive/odrive-motor/run.sh' added to a robot in the Viam app config builder](/extend/modular-resources/add-odrive/add-odrive-module-ui.png) + +{{% /tab %}} +{{% tab name="JSON Template" %}} + +Go to your robot's page on the [Viam app](https://app.viam.com/). +Navigate to the **Config** tab on your robot's page and select **Raw JSON** mode. +Copy and paste the following raw JSON to add a `csi` [camera](/components/camera) component with the name `my_test_csicam`: + +```json {class="line-numbers linkable-line-numbers"} +{ + "modules": [ + { + "executable_path": "/usr/bin/csi-mr", + "name": "csi_cam_module" + } + ], + "components": [ + { + "model": "viam:camera:csi", + "attributes": { + "width_px": 1920, + "height_px": 1080, + "frame_rate": 30, + "debug": true + }, + "depends_on": [], + "name": "my_test_csicam", + "namespace": "rdk", + "type": "camera" + } + ] +} +``` + +Save the config. + +{{% /tab %}} +{{< /tabs >}} + +Edit and fill in the attributes as applicable to your `csi` camera. + +{{% /tab %}} +{{< /tabs >}} + +The following attributes are available for the `csi` camera resource made programmatically available in the `viam:camera:csi` module: + +| Name | Type | Inclusion | Description | +| ---- | ---- | --------- | ----------- | +| `width_px` | int | Optional | .
Example: `0` | +| `height_px` | string | Optional | . | +| `frame__rate` | string | Optional | . | +| `debug` | string | Optional | .
Example: `"250k"` | + +Save the config. +Check the [**Logs** tab](/program/debug/) of your robot in the Viam app to make sure your `csi` camera has connected and no errors are being raised. From 405e73b143b376970a33b0e2bd4862f51d4e627c Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 29 Aug 2023 13:30:31 -0400 Subject: [PATCH 02/24] add csi docs --- docs/extend/modular-resources/examples/csi.md | 55 ++++++++----------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index add2ff3290..ef9cbf4c42 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -1,20 +1,25 @@ --- -title: "Add an ODrive motor as a Modular Resource" -linkTitle: "ODrive" +title: "Add a CSI Camera as a Modular Resource" +linkTitle: "CSI Camera" weight: 40 type: "docs" -description: "How to add an ODrive motor with serial or CANbus communication as a modular resource of your robot." -tags: ["motor", "odrive", "canbus", "serial", "module", "modular resources", "Python", "python SDK", "CAN"] +description: "How to add a CSI Camera as a modular resource of your robot." +tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Python", "python SDK", "nvidia", "jetson orin", "jetson orin nano", "nano", "camera"] # SMEs: Kim, Martha, Rand --- -The [Viam GitHub](https://github.com/viamrobotics/odrive) provides an implementation of ODrive Robotics' [ODrive S1](https://odriverobotics.com/shop/odrive-s1) motor driver as module defining two modular resources [extending](/extend/modular-resources/) the [motor API](/components/motor/#api) as new motor types. -[Install requirements](#requirements) and [configure](#configuration) the module to configure an `serial` or `canbus` [motor](/components/motor/) {{< glossary_tooltip term_id="resource" text="resource" >}} on your robot. +Viam provides a modular resource [extending](/extend/modular-resources/) the [camera API](/components/camera/#api) as a new `viam:camera:csi` model of [camera](/components/camera/). + +This module includes a simple wrapper around `GStreamer` and a control interface for the **control** tab of the [Viam app](https://app.viam.com) so you can utilize the hardware accelerated GST plugins and use the embedded CSI cameras on your `jetson` boards with Viam. + +The module is open-sourced and available on [GitHub](https://github.com/seanavery/viam-csi). + +[Install requirements](#requirements) and [configure](#configuration) the module to add an `viam:camera:csi` [camera](/components/camera/) {{< glossary_tooltip term_id="resource" text="resource" >}} to your robot. ## Requirements -On your robot's computer, download [the Viam `csi` appimage](https://github.com/viamrobotics/odrive) and make it executable: +On your robot's computer, download [the `viam:camera:csi` appimage](https://github.com/viamrobotics/odrive) and make it executable: ``` {class="command-line" data-prompt="$"} sudo wget https://github.com/seanavery/viam-csi/releases/download/v0.0.2/viam-csi-0.0.2-aarch64.AppImage -O /usr/local/bin/viam-csi @@ -25,22 +30,12 @@ sudo chmod 755 /usr/local/bin/viam-csi ### Module -{{< tabs name="Add the ODrive module">}} -{{% tab name="Config Builder" %}} - -Go to your robot's page on the [Viam app](https://app.viam.com/). -Navigate to the **Config** tab on your robot's page, and click on the **Modules** subtab. - -Copy and the csi module with a name of your choice. - -![The ODrive module with the name 'odrive' and executable path '~/desktop/odrive/odrive-motor/run.sh' added to a robot in the Viam app config builder](/extend/modular-resources/add-odrive/add-odrive-module-ui.png) - -{{% /tab %}} +{{< tabs name="Add the csi module">}} {{% tab name="JSON Template" %}} Go to your robot's page on the [Viam app](https://app.viam.com/). Navigate to the **Config** tab on your robot's page and select **Raw JSON** mode. -Copy and paste the following raw JSON to add a `csi` [camera](/components/camera) component with the name `my_test_csicam`: +Copy and paste the following raw JSON to add a `csi` [camera](/components/camera) component with the name `my_test_csi_cam`: ```json {class="line-numbers linkable-line-numbers"} { @@ -60,7 +55,7 @@ Copy and paste the following raw JSON to add a `csi` [camera](/components/camera "debug": true }, "depends_on": [], - "name": "my_test_csicam", + "name": "my_test_csi_cam", "namespace": "rdk", "type": "camera" } @@ -69,23 +64,19 @@ Copy and paste the following raw JSON to add a `csi` [camera](/components/camera ``` Save the config. +Edit and fill in the attributes as applicable. -{{% /tab %}} -{{< /tabs >}} - -Edit and fill in the attributes as applicable to your `csi` camera. +Check the [**Logs** tab](/program/debug/) of your robot in the Viam app to make sure your camera has connected and no errors are being raised. {{% /tab %}} {{< /tabs >}} -The following attributes are available for the `csi` camera resource made programmatically available in the `viam:camera:csi` module: +The following attributes are available for the `viam:camera:csi` model: | Name | Type | Inclusion | Description | | ---- | ---- | --------- | ----------- | -| `width_px` | int | Optional | .
Example: `0` | -| `height_px` | string | Optional | . | -| `frame__rate` | string | Optional | . | -| `debug` | string | Optional | .
Example: `"250k"` | - -Save the config. -Check the [**Logs** tab](/program/debug/) of your robot in the Viam app to make sure your `csi` camera has connected and no errors are being raised. +| `width_px` | int | Optional | Width of the image this camera captures in pixels.
Default: `1920` | +| `height_px` | int | Optional | Height of the image this camera captures in pixels.
Default: `1080` | +| `frame_rate` | int | Optional | The image capture frame rate this camera should use.
Default: `30` | +| `video_path` | string | Optional | The filepath to the input sensor of this camera on your board. If none is given, your robot will attempt to detect the video path automatically.
Default: `"0"` | +| `debug` | boolean | Optional | Whether or not you want debug input from this camera in your robot's logs.
Example: `true` | From c5f6c8e9f099e4a194ef848f18e3a676335d0346 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 29 Aug 2023 13:32:23 -0400 Subject: [PATCH 03/24] Update docs/components/board/jetson.md --- docs/components/board/jetson.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/components/board/jetson.md b/docs/components/board/jetson.md index 14ce77db7a..1b864ee64c 100644 --- a/docs/components/board/jetson.md +++ b/docs/components/board/jetson.md @@ -13,7 +13,7 @@ tags: ["board", "components"] Follow one of our Jetson [setup guides](/installation/) to prepare your board for running `viam-server` before configuring a `jetson` board. -If after configuring a `jetson` board you want to add your Orin Nano's CSI camera to your robot, you can with Viam's `csi` module. +If after configuring a `jetson` board you want to add your Orin Nano's CSI camera to your robot, you can with Viam's `viam:camera:csi` model. Follow [these instructions](/extend/modular-resources/examples/csi) to do so. {{% /alert %}} From 9490f172074c8717709e5c64f4c3533d98cf1568 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 29 Aug 2023 13:32:57 -0400 Subject: [PATCH 04/24] Update docs/extend/modular-resources/examples/csi.md --- docs/extend/modular-resources/examples/csi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index ef9cbf4c42..0570c5dd6b 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -5,7 +5,7 @@ weight: 40 type: "docs" description: "How to add a CSI Camera as a modular resource of your robot." tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Python", "python SDK", "nvidia", "jetson orin", "jetson orin nano", "nano", "camera"] -# SMEs: Kim, Martha, Rand +# SMEs: Sean --- From fc1fcea80347402980650f0a06d546ab8ea9b1bd Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 29 Aug 2023 13:43:22 -0400 Subject: [PATCH 05/24] Link fixup --- docs/components/board/jetson.md | 2 +- docs/extend/modular-resources/examples/csi.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/components/board/jetson.md b/docs/components/board/jetson.md index 1b864ee64c..e37de06b2f 100644 --- a/docs/components/board/jetson.md +++ b/docs/components/board/jetson.md @@ -14,7 +14,7 @@ tags: ["board", "components"] Follow one of our Jetson [setup guides](/installation/) to prepare your board for running `viam-server` before configuring a `jetson` board. If after configuring a `jetson` board you want to add your Orin Nano's CSI camera to your robot, you can with Viam's `viam:camera:csi` model. -Follow [these instructions](/extend/modular-resources/examples/csi) to do so. +Follow [these instructions](/extend/modular-resources/examples/csi/) to do so. {{% /alert %}} diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 0570c5dd6b..47e320d46a 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -35,7 +35,7 @@ sudo chmod 755 /usr/local/bin/viam-csi Go to your robot's page on the [Viam app](https://app.viam.com/). Navigate to the **Config** tab on your robot's page and select **Raw JSON** mode. -Copy and paste the following raw JSON to add a `csi` [camera](/components/camera) component with the name `my_test_csi_cam`: +Copy and paste the following raw JSON to add a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: ```json {class="line-numbers linkable-line-numbers"} { From ff5d2d16b7080796873d18f9b0226ca0c171190d Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 29 Aug 2023 15:59:08 -0400 Subject: [PATCH 06/24] Update docs/extend/modular-resources/examples/csi.md --- docs/extend/modular-resources/examples/csi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 47e320d46a..1019020f70 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -79,4 +79,4 @@ The following attributes are available for the `viam:camera:csi` model: | `height_px` | int | Optional | Height of the image this camera captures in pixels.
Default: `1080` | | `frame_rate` | int | Optional | The image capture frame rate this camera should use.
Default: `30` | | `video_path` | string | Optional | The filepath to the input sensor of this camera on your board. If none is given, your robot will attempt to detect the video path automatically.
Default: `"0"` | -| `debug` | boolean | Optional | Whether or not you want debug input from this camera in your robot's logs.
Example: `true` | +| `debug` | boolean | Optional | Whether or not you want debug input from this camera in your robot's logs.
Default: `false` | From e984fb55f45b943b35cf5c2e832128aa002142f2 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 29 Aug 2023 16:55:56 -0400 Subject: [PATCH 07/24] Apply suggestions from code review Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> --- docs/extend/modular-resources/examples/csi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 1019020f70..e5d39db03f 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -3,7 +3,7 @@ title: "Add a CSI Camera as a Modular Resource" linkTitle: "CSI Camera" weight: 40 type: "docs" -description: "How to add a CSI Camera as a modular resource of your robot." +description: "Use the viam:camera:csi model to add a CSI Camera to your robot." tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Python", "python SDK", "nvidia", "jetson orin", "jetson orin nano", "nano", "camera"] # SMEs: Sean --- From 7886ceacaa8a4f7720f44627520140cfb3c1faf4 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 29 Aug 2023 16:56:40 -0400 Subject: [PATCH 08/24] Apply suggestions remove tabs bc just raw json --- docs/extend/modular-resources/examples/csi.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index e5d39db03f..ee26ace69e 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -30,9 +30,6 @@ sudo chmod 755 /usr/local/bin/viam-csi ### Module -{{< tabs name="Add the csi module">}} -{{% tab name="JSON Template" %}} - Go to your robot's page on the [Viam app](https://app.viam.com/). Navigate to the **Config** tab on your robot's page and select **Raw JSON** mode. Copy and paste the following raw JSON to add a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: @@ -68,9 +65,6 @@ Edit and fill in the attributes as applicable. Check the [**Logs** tab](/program/debug/) of your robot in the Viam app to make sure your camera has connected and no errors are being raised. -{{% /tab %}} -{{< /tabs >}} - The following attributes are available for the `viam:camera:csi` model: | Name | Type | Inclusion | Description | From 707db27361470eeb8fa1b4b26ddcd92c3db584f9 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 29 Aug 2023 16:57:35 -0400 Subject: [PATCH 09/24] Apply suggestions from code review --- docs/extend/modular-resources/examples/csi.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index ee26ace69e..52cb40e322 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -9,6 +9,7 @@ tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Pytho --- +If after configuring a `jetson` board you want to add your Orin Nano's CSI camera to your robot, you can. Viam provides a modular resource [extending](/extend/modular-resources/) the [camera API](/components/camera/#api) as a new `viam:camera:csi` model of [camera](/components/camera/). This module includes a simple wrapper around `GStreamer` and a control interface for the **control** tab of the [Viam app](https://app.viam.com) so you can utilize the hardware accelerated GST plugins and use the embedded CSI cameras on your `jetson` boards with Viam. From 640e8553d02cef86bf399eb812bbac1bf47b7f58 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Wed, 30 Aug 2023 12:52:54 -0400 Subject: [PATCH 10/24] Apply suggestions from code review --- docs/extend/modular-resources/examples/csi.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 52cb40e322..23fff59174 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -9,6 +9,8 @@ tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Pytho --- +Many boards, like the Jetson Orin Nano, come with built-in Camera Serial Interface, or CSI, cameras. +These cameras are excellent for utilizing embedded vision systems like Viam's [vision service](/services/vision/). If after configuring a `jetson` board you want to add your Orin Nano's CSI camera to your robot, you can. Viam provides a modular resource [extending](/extend/modular-resources/) the [camera API](/components/camera/#api) as a new `viam:camera:csi` model of [camera](/components/camera/). From 22ce75d57725f21a4767b0fd67bcf483a7a35793 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Wed, 30 Aug 2023 13:48:56 -0400 Subject: [PATCH 11/24] Update csi.md remove trailing space --- docs/extend/modular-resources/examples/csi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 23fff59174..14e5783fc4 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -9,7 +9,7 @@ tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Pytho --- -Many boards, like the Jetson Orin Nano, come with built-in Camera Serial Interface, or CSI, cameras. +Many boards, like the Jetson Orin Nano, come with built-in Camera Serial Interface, or CSI, cameras. These cameras are excellent for utilizing embedded vision systems like Viam's [vision service](/services/vision/). If after configuring a `jetson` board you want to add your Orin Nano's CSI camera to your robot, you can. Viam provides a modular resource [extending](/extend/modular-resources/) the [camera API](/components/camera/#api) as a new `viam:camera:csi` model of [camera](/components/camera/). @@ -75,5 +75,5 @@ The following attributes are available for the `viam:camera:csi` model: | `width_px` | int | Optional | Width of the image this camera captures in pixels.
Default: `1920` | | `height_px` | int | Optional | Height of the image this camera captures in pixels.
Default: `1080` | | `frame_rate` | int | Optional | The image capture frame rate this camera should use.
Default: `30` | -| `video_path` | string | Optional | The filepath to the input sensor of this camera on your board. If none is given, your robot will attempt to detect the video path automatically.
Default: `"0"` | +| `video_path` | string | Optional | The filepath to the input sensor of this camera on your board. If none is given, your robot will attempt to detect the video path automatically
Default: `"0"`
| | `debug` | boolean | Optional | Whether or not you want debug input from this camera in your robot's logs.
Default: `false` | From 3002dda18f48cda6c35d06981b545313bc656402 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Fri, 1 Sep 2023 12:51:55 -0400 Subject: [PATCH 12/24] Apply naomi's inline suggestions from code review Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> --- docs/components/board/jetson.md | 3 +-- docs/extend/modular-resources/examples/csi.md | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/components/board/jetson.md b/docs/components/board/jetson.md index e37de06b2f..b04b9a1f00 100644 --- a/docs/components/board/jetson.md +++ b/docs/components/board/jetson.md @@ -13,8 +13,7 @@ tags: ["board", "components"] Follow one of our Jetson [setup guides](/installation/) to prepare your board for running `viam-server` before configuring a `jetson` board. -If after configuring a `jetson` board you want to add your Orin Nano's CSI camera to your robot, you can with Viam's `viam:camera:csi` model. -Follow [these instructions](/extend/modular-resources/examples/csi/) to do so. +If you have a CSI camera, follow [these instructions](/extend/modular-resources/examples/csi/) to configure it using the `viam:camera:csi` model. {{% /alert %}} diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 14e5783fc4..40b74b06b9 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -9,10 +9,10 @@ tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Pytho --- -Many boards, like the Jetson Orin Nano, come with built-in Camera Serial Interface, or CSI, cameras. +Many boards, like the Jetson Orin Nano, come with the option to use Camera Serial Interface (CSI) cameras. These cameras are excellent for utilizing embedded vision systems like Viam's [vision service](/services/vision/). -If after configuring a `jetson` board you want to add your Orin Nano's CSI camera to your robot, you can. -Viam provides a modular resource [extending](/extend/modular-resources/) the [camera API](/components/camera/#api) as a new `viam:camera:csi` model of [camera](/components/camera/). +Not all CSI cameras are supported by the [webcam camera model](/components/camera/webcam). +Instead, Viam supports CSI cameras by providing a {{< glossary_tooltip term_id="modular resource" text="modular resource" >}} for your CSI camera: `viam:camera:csi`. This module includes a simple wrapper around `GStreamer` and a control interface for the **control** tab of the [Viam app](https://app.viam.com) so you can utilize the hardware accelerated GST plugins and use the embedded CSI cameras on your `jetson` boards with Viam. From 7899941415b9c767e095a4a66c38b59e92b3300a Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Fri, 1 Sep 2023 13:01:18 -0400 Subject: [PATCH 13/24] Update docs/extend/modular-resources/examples/csi.md --- docs/extend/modular-resources/examples/csi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 40b74b06b9..f1fbf2c80c 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -12,7 +12,7 @@ tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Pytho Many boards, like the Jetson Orin Nano, come with the option to use Camera Serial Interface (CSI) cameras. These cameras are excellent for utilizing embedded vision systems like Viam's [vision service](/services/vision/). Not all CSI cameras are supported by the [webcam camera model](/components/camera/webcam). -Instead, Viam supports CSI cameras by providing a {{< glossary_tooltip term_id="modular resource" text="modular resource" >}} for your CSI camera: `viam:camera:csi`. +Instead, Viam supports CSI cameras by providing a [modular resource](/extend/modular-resources/) for your CSI camera: `viam:camera:csi`. This module includes a simple wrapper around `GStreamer` and a control interface for the **control** tab of the [Viam app](https://app.viam.com) so you can utilize the hardware accelerated GST plugins and use the embedded CSI cameras on your `jetson` boards with Viam. From 64c461099af2ddd13bd2898c61194bcf13ab21e1 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Fri, 1 Sep 2023 13:02:13 -0400 Subject: [PATCH 14/24] Apply suggestions from code review Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> --- docs/extend/modular-resources/examples/csi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index f1fbf2c80c..426ca0c2b0 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -18,9 +18,9 @@ This module includes a simple wrapper around `GStreamer` and a control interface The module is open-sourced and available on [GitHub](https://github.com/seanavery/viam-csi). -[Install requirements](#requirements) and [configure](#configuration) the module to add an `viam:camera:csi` [camera](/components/camera/) {{< glossary_tooltip term_id="resource" text="resource" >}} to your robot. +To use the CSI camera module, follow the [Installation](#installation) and [configuration](#configuration) steps. -## Requirements +## Installation On your robot's computer, download [the `viam:camera:csi` appimage](https://github.com/viamrobotics/odrive) and make it executable: From a432a3f4bf7124ea3771954c70dc85616e995c5e Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Fri, 1 Sep 2023 13:10:32 -0400 Subject: [PATCH 15/24] Update csi.md suggestions from code review, tab --- docs/extend/modular-resources/examples/csi.md | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 426ca0c2b0..42b6bc86e1 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -9,7 +9,7 @@ tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Pytho --- -Many boards, like the Jetson Orin Nano, come with the option to use Camera Serial Interface (CSI) cameras. +Many boards, like the Jetson Orin Nano, come with the option to use Camera Serial Interface (CSI) cameras, like [this camera from E-con Systems](https://www.e-consystems.com/nvidia-cameras/jetson-agx-orin-cameras/ar0230-fhd-gmsl2-hdr-camera.asp?utm_source=google-ads&utm_campaign=GMSL-Pmax&utm_agid=&utm_term=&creative=&device=c&placement=&gclid=Cj0KCQjwl8anBhCFARIsAKbbpySvlcUIdUMjRzv9WW_cajgV4zrZ8W_MQo3NZz0xHPDXzYFXc7uMWocaAo8OEALw_wcB) or [this camera from Seed Technologies](https://www.digikey.com/en/products/detail/seeed-technology-co.,-ltd/114992263/12396924?utm_adgroup=&utm_source=google&utm_medium=cpc&utm_campaign=PMax%20Shopping_Product_Low%20ROAS%20Categories&utm_term=&utm_content=&gclid=Cj0KCQjwl8anBhCFARIsAKbbpyTpIPUgyZ4JuJDRmDTX0gWfMpBmvbDFKP-uimxwqTKL7cOs8dIbtxQaAvF2EALw_wcB). These cameras are excellent for utilizing embedded vision systems like Viam's [vision service](/services/vision/). Not all CSI cameras are supported by the [webcam camera model](/components/camera/webcam). Instead, Viam supports CSI cameras by providing a [modular resource](/extend/modular-resources/) for your CSI camera: `viam:camera:csi`. @@ -31,12 +31,42 @@ sudo chmod 755 /usr/local/bin/viam-csi ## Configuration -### Module +{{< tabs name="Connect your CSI Module and Modular Resource">}} +{{% tab name="JSON Template" %}} Go to your robot's page on the [Viam app](https://app.viam.com/). Navigate to the **Config** tab on your robot's page and select **Raw JSON** mode. Copy and paste the following raw JSON to add a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: +```json {class="line-numbers linkable-line-numbers"} +{ + "modules": [ + { + "executable_path": "", + "name": "" + } + ], + "components": [ + { + "model": "viam:camera:csi", + "attributes": { + "width_px": , + "height_px": , + "frame_rate": , + "debug": "" + }, + "depends_on": [], + "name": "", + "namespace": "rdk", + "type": "camera" + } + ] +} +``` + +{{% /tab %}} +{{% tab name="JSON Example" %}} + ```json {class="line-numbers linkable-line-numbers"} { "modules": [ @@ -63,6 +93,9 @@ Copy and paste the following raw JSON to add a `csi` [camera](/components/camera } ``` +{{% /tab %}} +{{< /tabs >}} + Save the config. Edit and fill in the attributes as applicable. From f448729bf4ffe41fcbce5d0a00a63b87b5d8fb90 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Fri, 1 Sep 2023 14:04:50 -0400 Subject: [PATCH 16/24] Update csi.md --- docs/extend/modular-resources/examples/csi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 42b6bc86e1..104e9dae86 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -9,9 +9,9 @@ tags: ["board", "csi", "jetson", "serial", "module", "modular resources", "Pytho --- -Many boards, like the Jetson Orin Nano, come with the option to use Camera Serial Interface (CSI) cameras, like [this camera from E-con Systems](https://www.e-consystems.com/nvidia-cameras/jetson-agx-orin-cameras/ar0230-fhd-gmsl2-hdr-camera.asp?utm_source=google-ads&utm_campaign=GMSL-Pmax&utm_agid=&utm_term=&creative=&device=c&placement=&gclid=Cj0KCQjwl8anBhCFARIsAKbbpySvlcUIdUMjRzv9WW_cajgV4zrZ8W_MQo3NZz0xHPDXzYFXc7uMWocaAo8OEALw_wcB) or [this camera from Seed Technologies](https://www.digikey.com/en/products/detail/seeed-technology-co.,-ltd/114992263/12396924?utm_adgroup=&utm_source=google&utm_medium=cpc&utm_campaign=PMax%20Shopping_Product_Low%20ROAS%20Categories&utm_term=&utm_content=&gclid=Cj0KCQjwl8anBhCFARIsAKbbpyTpIPUgyZ4JuJDRmDTX0gWfMpBmvbDFKP-uimxwqTKL7cOs8dIbtxQaAvF2EALw_wcB). +Many boards, like the Jetson Orin Nano, come with the option to use Camera Serial Interface (CSI) cameras, like [these cameras from E-con Systems](https://www.e-consystems.com/nvidia-jetson-agx-orin-cameras.asp) or [this camera from Seed Technologies](https://www.digikey.com/en/products/detail/seeed-technology-co.,-ltd/114992263/12396924). These cameras are excellent for utilizing embedded vision systems like Viam's [vision service](/services/vision/). -Not all CSI cameras are supported by the [webcam camera model](/components/camera/webcam). +Not all CSI cameras are supported by the [webcam camera model](/components/camera/webcam/). Instead, Viam supports CSI cameras by providing a [modular resource](/extend/modular-resources/) for your CSI camera: `viam:camera:csi`. This module includes a simple wrapper around `GStreamer` and a control interface for the **control** tab of the [Viam app](https://app.viam.com) so you can utilize the hardware accelerated GST plugins and use the embedded CSI cameras on your `jetson` boards with Viam. From 995926d5c442eb2565fc6b26752e57d43551faff Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 5 Sep 2023 13:16:27 -0400 Subject: [PATCH 17/24] Split out modules and components example as suggested --- docs/extend/modular-resources/examples/csi.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 104e9dae86..c17b36332c 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -36,7 +36,8 @@ sudo chmod 755 /usr/local/bin/viam-csi Go to your robot's page on the [Viam app](https://app.viam.com/). Navigate to the **Config** tab on your robot's page and select **Raw JSON** mode. -Copy and paste the following raw JSON to add a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: + +Copy and paste the following raw JSON to add Viam's `csi-mr` module: ```json {class="line-numbers linkable-line-numbers"} { @@ -45,7 +46,14 @@ Copy and paste the following raw JSON to add a `csi` [camera](/components/camera "executable_path": "", "name": "" } - ], + ] +} +``` + +Next, add the following raw JSON to configure a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: + +```json {class="line-numbers linkable-line-numbers"} +{ // "modules": [ ...] , "components": [ { "model": "viam:camera:csi", From 0422070b2851e2aff456cb84d50136a2484efebc Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Tue, 5 Sep 2023 13:43:51 -0400 Subject: [PATCH 18/24] Update docs/extend/modular-resources/examples/csi.md --- docs/extend/modular-resources/examples/csi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index c17b36332c..10c4ff166f 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -37,7 +37,7 @@ sudo chmod 755 /usr/local/bin/viam-csi Go to your robot's page on the [Viam app](https://app.viam.com/). Navigate to the **Config** tab on your robot's page and select **Raw JSON** mode. -Copy and paste the following raw JSON to add Viam's `csi-mr` module: +Copy and paste the following raw JSON to add Viam's `csi-mr` module: ```json {class="line-numbers linkable-line-numbers"} { From 1dbfe66f96040454da19bc97b28ace52c6b85511 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Wed, 6 Sep 2023 06:40:49 -0400 Subject: [PATCH 19/24] Apply suggestions from code review add array specification Co-authored-by: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> --- docs/extend/modular-resources/examples/csi.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 10c4ff166f..6cc9eb4e60 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -37,7 +37,7 @@ sudo chmod 755 /usr/local/bin/viam-csi Go to your robot's page on the [Viam app](https://app.viam.com/). Navigate to the **Config** tab on your robot's page and select **Raw JSON** mode. -Copy and paste the following raw JSON to add Viam's `csi-mr` module: +Copy and paste the JSON object for the module into the modules array to add Viam's `csi-mr` module: ```json {class="line-numbers linkable-line-numbers"} { @@ -48,13 +48,10 @@ Copy and paste the following raw JSON to add Viam's `csi-mr` module: } ] } -``` -Next, add the following raw JSON to configure a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: +Next, add the following JSON object to your components array toconfigure a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: ```json {class="line-numbers linkable-line-numbers"} -{ // "modules": [ ...] , - "components": [ { "model": "viam:camera:csi", "attributes": { @@ -68,9 +65,6 @@ Next, add the following raw JSON to configure a `csi` [camera](/components/camer "namespace": "rdk", "type": "camera" } - ] -} -``` {{% /tab %}} {{% tab name="JSON Example" %}} From 2901c6a4113271e10211e71684009d4485d288f0 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Wed, 6 Sep 2023 06:43:59 -0400 Subject: [PATCH 20/24] suggestion add to examples page --- docs/extend/modular-resources/examples/_index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/extend/modular-resources/examples/_index.md b/docs/extend/modular-resources/examples/_index.md index ed582a4168..e9f5327bce 100644 --- a/docs/extend/modular-resources/examples/_index.md +++ b/docs/extend/modular-resources/examples/_index.md @@ -22,6 +22,7 @@ Once you have created a modular resource, you can test your custom resource usin {{< cards >}} {{% card link="/extend/modular-resources/examples/rplidar/" customTitle="Add an RPlidar camera as a Modular Resource" %}} {{% card link="/extend/modular-resources/examples/odrive/" customTitle="Add an ODrive motor as a Modular Resource" %}} + {{% card link="/extend/modular-resources/examples/csi/" customTitle="Add a CSI Camera as a Modular Resource" %}} {{% card link="/extend/modular-resources/examples/custom-arm/" %}} {{% card link="/extend/modular-resources/examples/tflite-module/" customTitle="Add a TensorFlow Lite Modular Service" %}} {{% card link="/tutorials/custom/custom-base-dog/" %}} From b930ad02f8ffccbe2945db34134012b95eb09ed0 Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Wed, 6 Sep 2023 09:51:16 -0400 Subject: [PATCH 21/24] Apply suggestions from code review --- docs/extend/modular-resources/examples/csi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 6cc9eb4e60..cc766d08dd 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -110,5 +110,5 @@ The following attributes are available for the `viam:camera:csi` model: | `width_px` | int | Optional | Width of the image this camera captures in pixels.
Default: `1920` | | `height_px` | int | Optional | Height of the image this camera captures in pixels.
Default: `1080` | | `frame_rate` | int | Optional | The image capture frame rate this camera should use.
Default: `30` | -| `video_path` | string | Optional | The filepath to the input sensor of this camera on your board. If none is given, your robot will attempt to detect the video path automatically
Default: `"0"`
| +| `video_path` | string | Optional | The filepath to the input sensor of this camera on your board. If none is given, your robot will attempt to detect the video path automatically.
Default: `"0"`
| | `debug` | boolean | Optional | Whether or not you want debug input from this camera in your robot's logs.
Default: `false` | From 8ab21a98dac162a1fecef5ea64b454cced135d2b Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Wed, 6 Sep 2023 09:51:42 -0400 Subject: [PATCH 22/24] Update csi.md wrap json code properly --- docs/extend/modular-resources/examples/csi.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index cc766d08dd..4aa91dd831 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -48,6 +48,7 @@ Copy and paste the JSON object for the module into the modules array to add Viam } ] } +``` Next, add the following JSON object to your components array toconfigure a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: @@ -65,6 +66,7 @@ Next, add the following JSON object to your components array toconfigure a `csi` "namespace": "rdk", "type": "camera" } +``` {{% /tab %}} {{% tab name="JSON Example" %}} From 81f10bb66fc65f4bf9f9569df8aec738cc250c1a Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Wed, 6 Sep 2023 09:52:44 -0400 Subject: [PATCH 23/24] fixup typo --- docs/extend/modular-resources/examples/csi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 4aa91dd831..9fa11f9302 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -50,7 +50,7 @@ Copy and paste the JSON object for the module into the modules array to add Viam } ``` -Next, add the following JSON object to your components array toconfigure a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: +Next, add the following JSON object to your components array to configure a `csi` [camera](/components/camera/) component with the name `my_test_csi_cam`: ```json {class="line-numbers linkable-line-numbers"} { From 6d809ef1483bfb10f0e3a3a208238824bcf8171d Mon Sep 17 00:00:00 2001 From: Sierra Guequierre Date: Wed, 6 Sep 2023 09:53:18 -0400 Subject: [PATCH 24/24] Update docs/extend/modular-resources/examples/csi.md --- docs/extend/modular-resources/examples/csi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extend/modular-resources/examples/csi.md b/docs/extend/modular-resources/examples/csi.md index 9fa11f9302..c0e15f8cec 100644 --- a/docs/extend/modular-resources/examples/csi.md +++ b/docs/extend/modular-resources/examples/csi.md @@ -18,7 +18,7 @@ This module includes a simple wrapper around `GStreamer` and a control interface The module is open-sourced and available on [GitHub](https://github.com/seanavery/viam-csi). -To use the CSI camera module, follow the [Installation](#installation) and [configuration](#configuration) steps. +To use the CSI camera module, follow the [installation](#installation) and [configuration](#configuration) steps. ## Installation