Hardware-Specific Adapter Setup#
We will be copying some code from your specific hardware’s webpage. Find it in the list in Supported Equipment and leave it open in a browser tab.
Open your adapter’s git repository in Visual Studio Code. Make sure you open it in the container.
In the packages section, run the command listed on your specific hardware’s page in the
pyproject.toml
section.In your adapter repository, within the
configs
folder, you will find one or more subfolders–each corresponding to a different configuration context. Create a new folder in theconfigs
folder namedtutorial
.Inside that folder, make sure to place the
secrets.yaml
you created in the guide for Set Up a Local Dev Container.Also inside that folder, copy the
config.yaml
exactly as listed on your specific hardware’s page and follow any instructions given for that specific hardware’sconfig.yaml
customization.- For the
config.yaml
, you also need to customize: - The entire
artificial
section needs to be set to the correct instance. You can get the entire deployment config from your Artificial’s settings page by following these steps: Go to your instance in Artificial.
Click on the Settings icon.
Select the correct lab under the Labs section.
Scroll down to the Deployment Config section and copy the entire
artificial
section there into your yaml file in place of the existingartificial
section.
- The entire
- In the
asset_sync
section, update the rid guid to the one matching your device. The rid can be obtained by: logging into your instance and selecting the correct Lab.
Click on the equipment to select it and click on the
Edit asset details
icon on the far right.In the right pane, under
Debug
copy the instance ID (this is the rid) and copy it into the adapter’sconfig.yaml
file.
- In the
For more advanced use cases, consult Adapter Configuration.
- For the
Next, replace the entire contents of the
adapter/main/plugin.py
file with those listed on your specific hardware’s page.Then, update the actors list in the
adapter/main/__main__.py
file with those listed on your specific hardware’s page.- Set this as the active context by replacing the
configs/context.yaml
file with the one below. activeContext: tutorial
- Set this as the active context by replacing the
This should successfully set up the driver-specific portions of the adapter. You should continue following the guide that sent you here.