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.
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:
Name | Type | Required? | Description |
---|---|---|---|
width | int | Optional | The width of the image in pixels. The maximum width is 10000. Default: 1280 |
height | int | Optional | The height of the image in pixels. The maximum height is 10000. Default: 720 |
animated | bool | Optional | If 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.
Troubleshooting
If your camera is not working as expected, follow these steps:
- Check your machine logs on the LOGS tab to check for errors.
- Review this camera model’s documentation to ensure you have configured all required attributes.
- Click on the TEST panel on the CONFIGURE or CONTROL tab and test if you can use the camera there.
If none of these steps work, reach out to us on the Community Discord and we will be happy to help.
Common errors
Next steps
For more configuration and usage info, see:
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.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!