A Viam Module for CSI Cameras
Easily integrate CSI Cameras into your Viam projects using this camera module.
- Nvidia Jetson: Use the
csi-cammodule. More Info - Raspberry Pi: Use the
csi-cam-pimodule for Raspberry Pi CSI camera v1.3, v2.0, and v3.0. More Info
The csi-cam module is distributed as an AppImage. AppImages require FUSE version 2 to run. See FUSE troubleshooting for instructions on installing FUSE 2 on your system if it is not already installed. On Debian and Ubuntu systems, the libfuse2 library is automatically installed before the module starts.
Currently, the csi-cam module supports the Linux arm64 platforms only.
To use this module, follow these instructions to add a module from the Viam Registry and select the viam:camera:csi model from the csi-cam module.
Note
Before configuring your camera, you must create a robot.
Navigate to the Config tab of your robot’s page in the Viam app. Click on the Components subtab and click Create component. Select the camera type, then select the csi model. Enter a name for your camera and click Create.
On the new component panel, copy and paste the following attribute template into your camera's Attributes box.
{
"width_px": <int>,
"height_px": <int>,
"frame_rate": <int>,
"video_path": <string>
}The following attributes are available for viam:camera:csi cameras:
| Name | Type | Inclusion | Description |
|---|---|---|---|
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" |
Once configured, check the Logs tab of your robot in the Viam app to make sure your camera has connected and no errors are being raised.
{
"modules": [
{
"type": "registry",
"name": "viam_csi-cam",
"module_id": "viam:csi-cam",
"version": "0.3.0"
}
],
"components": [
{
"model": "viam:camera:csi",
"attributes": {
"width_px": 1920,
"height_px": 1080,
"frame_rate": 30
},
"depends_on": [],
"name": "csicam_test",
"namespace": "rdk",
"type": "camera"
}
]
}View DEVELOP.md for more information on how to build and run the module locally or in Docker. Pull Requests and Issues are welcome!
See PI.md for dependency information and tested setups.
To use this module, follow these instructions to add a module from the Viam Registry and select the viam:camera:csi-pi model from the csi-cam-pi module.
Note
Before configuring your camera, you must create a robot.
Navigate to the Config tab of your robot’s page in the Viam app. Click on the Components subtab and click Create component. Select the camera type, then select the csi-pi model. Enter a name for your camera and click Create.
On the new component panel, copy and paste the following attribute template into your camera's Attributes box.
{
"width_px": <int>,
"height_px": <int>,
"frame_rate": <int>
}Note
For more information, see Configure a Robot.
Edit the attributes as applicable and save your config. In the Control tab of the Viam app, you can now view the camera feed. If you do not see anything, check the logs tab for errors.
The following attributes are available for viam:camera:csi cameras:
| Name | Type | Inclusion | Description |
|---|---|---|---|
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 |
Once configured, check the Logs tab of your robot in the Viam app to make sure your camera has connected and no errors are being raised.
{
"modules": [
{
"type": "registry",
"name": "viam_csi-cam-pi",
"module_id": "viam:csi-cam-pi",
"version": "0.3.0"
}
],
"components": [
{
"name": "your-csi-cam",
"model": "viam:camera:csi-pi",
"type": "camera",
"namespace": "rdk",
"attributes": {
"width_px": 1920,
"height_px": 1080,
"frame_rate": 30,
"debug": true
},
"depends_on": []
}
]
}Interested in contributing? Check out DEVELOP.md for guidelines on how to build and run the module locally or using docker. We welcome Pull Requests and Issues!
