You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your system is not supported, read further on how to install from source.
24
17
25
18
### Upgrading
26
19
27
20
> **Note**
28
-
> Because the SDK is under active development, we suggest that you upgrade the package frequently.
29
-
21
+
> Because the SDK is under active development, we suggest that you upgrade the package frequently.
22
+
30
23
To upgrade, simply run the `pip install` command with the `-U` option:
24
+
`pip install -U viam-sdk`
25
+
26
+
### Installing from Source
27
+
The Viam Python SDK uses native libraries to support communication over WebRTC, which will allow you to connect to robots that are not on the same network. In order to facilitate that communication, there is a [Rust SDK](https://github.com/viamrobotics/viam-rust-sdk) that contains the necessary protocols. Therefore, to build from source, you will need both the Rust SDK and the Rust compiler.
28
+
29
+
1. Download/clone this repository
30
+
1. Download/clone the [Rust SDK](https://github.com/viamrobotics/viam-rust-sdk)
31
+
1.[Install Rust](https://www.rust-lang.org/tools/install) if not already available
32
+
1. From the `viam-rust-sdk` directory, run `cargo build`
33
+
* You can optionally provide the `--release` flag: `cargo build --release`
34
+
1. Find the compiled library in `viam-rust-sdk/target/debug/libviam.*`
35
+
* If you provided the `--release` flag, the enclosing directory will be `release`: `viam-rust-sdk/target/release/libviam.*`
36
+
* The extension of the executable will depend on your operating system. For example, on macOS it will be `libviam.dylib`, whereas on Linux it will be `libviam.so`
37
+
1. Copy the compiled library to the directory `viam-python-sdk/src/viam/rpc/`
38
+
1. From the `viam-python-sdk` directory, run `poetry build` to create an installable package
39
+
1. Find the newly created installable package located in `viam-python-sdk/dist/` and pip install it directly, e.g.: `pip install viam-python-sdk/dist/viam_sdk-0.1.0-py3-none-any.whl`
If you do **NOT** need communication over WebRTC (and thus, do not need the native library), the steps are:
43
+
44
+
1. Download/clone this repository
45
+
1. Run `poetry build` from the `viam-python-sdk` directory
46
+
1. Find the newly created installable package located in `viam-python-sdk/dist/` and pip install it directly, e.g.: `pip install viam-python-sdk/dist/viam_sdk-0.1.0-py3-none-any.whl`
47
+
1. Ensure that every connection has the option `disable_webrtc` set to `True`: `viam.rpc.dial.DialOptions(disable_webrtc=True)`
48
+
* For more information about connecting to a robot, see the [documentation](https://python.viam.dev) and [example usage](https://python.viam.dev/examples/example.html)
35
49
36
50
## Configure a client application at [app.viam.com](https://app.viam.com)
37
51
@@ -47,7 +61,7 @@ To create a client application, to navigate to [app.viam.com](https://app.viam.c
47
61
3. Wait until the robot shows as connected. If this doesn't happen try restarting the viam-server:
48
62
```
49
63
sudo systemctl restart viam-server
50
-
```
64
+
```
51
65
52
66
Next, select the `CONNECT` tab in the Viam Web UI, and copy the boilerplate code from the section labeled `Python SDK`.
0 commit comments