Skip to content

Commit 5af51e6

Browse files
authored
Update docs (#205)
1 parent 7c68a23 commit 5af51e6

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ To create a client application, to navigate to [app.viam.com](https://app.viam.c
6565
sudo systemctl restart viam-server
6666
```
6767
68-
Next, select the `CONNECT` tab in the Viam Web UI, and copy the boilerplate code from the section labeled `Python SDK`.
68+
Next, select the `CODE SAMPLE` tab in the Viam Web UI, and copy the boilerplate code from the section labeled `Python SDK`.
6969
7070
To ensure the installation succeeded and the systems are functional, save and run this simple program. If the program runs successfully, the python-sdk is properly installed, the `viam-server` instance on your robot is alive, and the computer running the program is able to connect to that instance.
7171

docs/examples/example.ipynb

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@
232232
]
233233
},
234234
{
235+
"attachments": {},
235236
"cell_type": "markdown",
236237
"metadata": {},
237238
"source": [
@@ -240,9 +241,9 @@
240241
"While the main RDK is written in golang, you can create custom components in python and connect them to a robot as a `remote` component. This allows you to extend the functionality of a robot, or even create an entire robot exclusively in python.\n",
241242
"\n",
242243
"The steps required in creating a custom component and connecting it to the RDK are\n",
243-
"1. Subclass a component and implement desired functions\n",
244-
"2. Create an `rpc.server.Server` instance and register the custom component\n",
245-
"3. Start the `Server` and register the running server as a remote\n",
244+
"1. **Subclass a component and implement desired functions**. This will be your custom component.\n",
245+
"1. **Create an `rpc.server.Server` instance and register the custom component**. This is the `RPC` server that enables communication with your custom component.\n",
246+
"1. **Start the `Server` and register the running server as a remote**. Registering this `RPC` server as a remote allows the RDK to communicate with the server.\n",
246247
"\n",
247248
"But before we start, we need to cover one additional topic: Operations.\n",
248249
"\n",
@@ -457,14 +458,15 @@
457458
]
458459
},
459460
{
461+
"attachments": {},
460462
"cell_type": "markdown",
461463
"metadata": {},
462464
"source": [
463465
"### 2. Register the custom component\n",
464466
"\n",
465-
"Now that we've created the custom component, we must register it with a server so that it will be visible to any robots connecting to it.\n",
467+
"Now that we've created the custom component, we must register it so that it will be visible to any robots connecting to it. This is done by creating an `RPC` server and adding `MyCoolArm` as a connected component. This `RPC` server will receive gRPC requests from the Viam Server or any other connections and forward those requests to your custom component.\n",
466468
"\n",
467-
"In the same `my-python-robot` directory, create a new file called `python_server.py`."
469+
"In the same `my-python-robot` directory, create a new file called `main.py`."
468470
]
469471
},
470472
{
@@ -483,7 +485,7 @@
483485
}
484486
],
485487
"source": [
486-
"# my-python-robot/python_server.py\n",
488+
"# my-python-robot/main.py\n",
487489
"\n",
488490
"import asyncio\n",
489491
"from viam.rpc.server import Server\n",
@@ -502,6 +504,7 @@
502504
]
503505
},
504506
{
507+
"attachments": {},
505508
"cell_type": "markdown",
506509
"metadata": {},
507510
"source": [
@@ -510,7 +513,7 @@
510513
"Now that we have a server that knows about our custom Arm component, we need to start the server so it can receive gRPC calls. Once it's started, we can then register this server as a remote.\n",
511514
"\n",
512515
"```python3\n",
513-
"# my-python-robot/python_server.py\n",
516+
"# my-python-robot/main.py\n",
514517
"\n",
515518
"async def main():\n",
516519
" ...\n",
@@ -537,7 +540,7 @@
537540
" \"log\": true,\n",
538541
" \"name\": \"python\",\n",
539542
" \"args\": [\n",
540-
" \"/home/pi/my-python-robot/python_server.py\"\n",
543+
" \"/home/pi/my-python-robot/main.py\"\n",
541544
" ]\n",
542545
" }\n",
543546
"]\n",
@@ -554,7 +557,7 @@
554557
" \"-u\",\n",
555558
" \"pi\",\n",
556559
" \"python\",\n",
557-
" \"/home/pi/my-python-robot/python-server.py\"\n",
560+
" \"/home/pi/my-python-robot/main.py\"\n",
558561
" ]\n",
559562
" }\n",
560563
"]\n",

0 commit comments

Comments
 (0)