Configure a Fake Camera

A fake camera is a camera model for testing. The camera always returns the same image, which is an image of a gradient. This camera also returns a point cloud.

You can optionally specify a height and width.

Navigate to the CONFIGURE tab of your machine’s page in the Viam app. Click the + icon next to your machine part in the left-hand menu and select Component. Select the camera type, then select the fake model. Enter a name or use the suggested name for your camera and click Create.

Configuration of a fake camera in the Viam app config builder.

Edit the attributes as applicable to your camera, according to the table below.

{
  "name": "<your-camera-name>",
  "model": "fake",
  "type": "camera",
  "namespace": "rdk",
  "attributes": {
    "width": <int>,
    "height": <int>
  }
}

The following attributes are available for fake cameras:

NameTypeInclusionDescription
widthintOptionalThe width of the image in pixels. The maximum width is 10000.
Default: 1280
heightintOptionalThe height of the image in pixels. The maximum height is 10000.
Default: 720
animatedboolOptionalIf you want the camera stream visible on the CONTROL tab to be animated.
Default: False

View the camera stream

Once your camera is configured, go to the CONTROL tab, and click on the camera’s dropdown menu. Then toggle the camera or the Point Cloud Data view to ON. You will see the live video feed from your camera. You can change the refresh frequency as needed to change bandwidth.

Fake Camera View

Next steps



Have questions, or want to meet other people working on robots? Join our Community Discord.

If you notice any issues with the documentation, feel free to file an issue or edit this file.