forked from automata-tech/eva_python_sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
charlie
committed
Mar 11, 2019
0 parents
commit 0dc17ed
Showing
18 changed files
with
1,252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__pycache__ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright 2018 Automata Technologies Ltd | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
requests = "*" | ||
websockets = "*" | ||
|
||
[dev-packages] | ||
pylint = "*" | ||
|
||
[requires] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Eva Python SDK | ||
|
||
The eva_python_sdk provides convenient access to the Automata Eva API from applications written in Python 3. | ||
|
||
__* This SDK is currently in beta, any breaking changes during development will be comunicated via changelog__ | ||
|
||
## automata.Eva | ||
|
||
The Eva object allows you to directly control an Eva robot. It provides lots of useful helper function for interacting with the robot. | ||
|
||
### Usage | ||
|
||
**Connecting** | ||
```python | ||
host = '<your_eva_IP_here>' | ||
token = '<your_token_here>' | ||
|
||
eva = Eva(host, token) | ||
``` | ||
|
||
**GoTo movement** | ||
```python | ||
eva = Eva(host_ip, token) | ||
|
||
with eva.lock(): | ||
eva.control_wait_for_ready() | ||
eva.control_go_to([0, 0, 0, 0, 0, 0]) | ||
``` | ||
|
||
**Toolpath create and run** | ||
```python | ||
toolpath = { | ||
"metadata":{ | ||
"default_velocity":0.7, | ||
"next_label_id":5, | ||
"analog_modes":{ "i0":"voltage", "i1":"voltage", "o0":"voltage", "o1":"voltage" } | ||
}, | ||
"waypoints":[ | ||
{ "joints":[-0.68147224, 0.3648368, -1.0703622, 9.354615e-05, -2.4358354, -0.6813218], "label_id":3 }, | ||
{ "joints":[-0.6350288, 0.25192022, -1.0664424, 0.030407501, -2.2955494, -0.615318], "label_id":2 }, | ||
{ "joints":[-0.13414459, 0.5361486, -1.280493, -6.992453e-08, -2.3972468, -0.13414553], "label_id":1 }, | ||
{ "joints":[-0.4103904, 0.33332264, -1.5417944, -5.380291e-06, -1.9328799, -0.41031334], "label_id":4 } | ||
], | ||
"timeline":[ | ||
{ "type":"home", "waypoint_id":2 }, | ||
{ "type":"trajectory", "trajectory":"joint_space", "waypoint_id":1 }, | ||
{ "type":"trajectory", "trajectory":"joint_space", "waypoint_id":0 }, | ||
{ "type":"trajectory", "trajectory":"joint_space", "waypoint_id":2 } | ||
] | ||
} | ||
|
||
eva = Eva(host, token) | ||
|
||
with eva.lock(): | ||
eva.control_wait_for_ready() | ||
eva.toolpaths_use(toolpath) | ||
eva.control_home() | ||
eva.control_run(loop=1) | ||
``` | ||
|
||
Please refer to the examples directory for more SDK usage examples. | ||
|
||
|
||
## automata.eva_http and automata.eva_ws | ||
|
||
These can be used to interact directly with the HTTP and Websocket APIs. Useful when you don't want the managed websocket connection provided by the automata.Eva object. | ||
|
||
## Logging | ||
|
||
The SDK uses Debug and Error level logging exclusively. Each Eva instance will log using the name `automata.Eva:<host_name_here>`. If you wish to enable the debug logging: | ||
|
||
```python | ||
logging.basicConfig(level=logging.DEBUG) | ||
``` | ||
|
||
## Bugs and feature requests | ||
|
||
Please raise any bugs or feature requests as a Github issues. We also greatfully accept pull requests for features and bug fixes. | ||
|
||
## License | ||
|
||
This code is free to use under the terms of the Apache 2 license. Please refer to LICENSE for more information. |
Oops, something went wrong.