Create a fake Sensor
Use a fake
sensor to test implementing a sensor component on your robot without any physical hardware.
Configure a fake
sensor as follows:
Navigate to the Config tab of your robot’s page in the Viam app.
Click on the Components subtab and navigate to the Create component menu.
Enter a name for your sensor, select the type sensor
, and select the fake
model.
Click Create component.
{
"name": "<your-sensor-name>",
"type": "sensor",
"model": "fake",
"attributes": {}
}
No attributes are available for fake
sensors.
Note
A call to Readings()
on a fake
sensor always returns readings of {"a":1, "b":2, "c":3}
.
Have questions, or want to meet other people working on robots? Join our Community Discord.
Was this page helpful?
Glad to hear it! If there is anything we could be doing better, please create an issue.
We're sorry about that. If you'd like to talk to us for help, please join the Community Discord. To ensure we know what's wrong with this page, you can also open an issue.