Configure a Fake Input Controller for Testing
Configuring a fake
input controller allows you to test an input controller communicating with your machine, without any physical hardware.
This controller can have Controls defined in attributes
, as seen in the “JSON Template” tab below.
However, these Controls only ever return a single PositionChangeAbs
event on the X axis, with the Event.value stuck at 0.7.
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 input_controller
type, then select the fake
model.
Enter a name or use the suggested name for your input controller and click Create.
Edit the attributes as applicable.
{
"components": [
{
"name": "<your-fake-input-controller>",
"model": "fake",
"type": "input_controller",
"namespace": "rdk",
"attributes": {
"controls": [
"AbsoluteX",
"AbsoluteY",
"AbsoluteZ"
],
"event_value": <float>,
"callback_delay_sec": <float>
}
}
}
The following attributes are available for fake
input controllers:
Name | Type | Inclusion | Description |
---|---|---|---|
callback_delay_sec | float | Required | The number of seconds between callbacks getting triggered. Random between 1 and 2 if not specified. 0 is not valid and will be overwritten by a random delay. |
event_value | float | Optional | Set the value of events returned. Random between -1 and 1 if not specified. |
controls | array | Optional | Set the Controls that are present on the controller. |
Test the input controller
After you configure your input controller, navigate to the Control tab and select the dropdown panel dedicated to the input controller. View the current value of each input on your controller.
Troubleshooting
You can find additional assistance in the Troubleshooting section.
You can also ask questions in the Community Discord and we will be happy to help.
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!