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
Copy file name to clipboardExpand all lines: README.md
+23-8Lines changed: 23 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,16 +16,20 @@ pip install navabilitysdk
16
16
-**Why is the SDK camel-cased?** True, Python code should be snake-cased. This was a design decision to align all the SDKS. All the functions and fields should look the same, so you can easily switch from one language to another without having to read documentation. This may change in the future as we grow the SDKs.
17
17
-**Which user should I use?** The Guest user is open and free for everyone to use. We recommend testing with this user, because it doesn't require any authentication. Note though, that the data is cleared on a regular basis, and that everyone can see your test data (all Guest users are created equal), so don't put anything in there that that is sensitive.
18
18
-**I have sensitive data, how do I create a user?** Great question, the NavAbility services completely isolate data per user and you can create a user at any point. At the moment we create users on demand because the services are changing as we develop them, and we want to make sure we can let everyone know as they do. Send us an email at [[email protected]](mailto:[email protected]) and we'll create a user for you right away.
19
+
-**Why Asyncio?** We're working on integrating these into [Example Jupyter Notebooks](https://github.com/NavAbility/BinderNotebooks) which only support asynchronous GQL calls in the `gql` library. This design decision will be standardized in all our SDKs in the next release. Overally it's been a good call, and we'll expand on more asynchronous functionality as these SDKs develop.
19
20
- Otherwise for any questions, comments, or feedback please feel free to email us at [[email protected]](mailto:[email protected]) or write an issue on the repo.
20
21
# Example
21
22
22
23
This script will create variables and factors, list the graph, and solve the session for SLAM estimates.
23
24
24
-
NOTE: You'll need numpy to run it.
25
+
> NOTES:
26
+
> * You'll need to start Python using `python -m asyncio` to support the `await` command.
27
+
> * You'll need numpy to run the example.
25
28
26
29
```python
27
30
from uuid import uuid4
28
31
import numpy as np
32
+
import json
29
33
from navability.entities import (
30
34
Client,
31
35
Factor,
@@ -96,23 +100,34 @@ factors = [
96
100
]
97
101
98
102
# Get the result IDs so we can check on their completion
99
-
result_ids = [addVariable(navability_client, client, v)["addVariable"] for v in variables] + [addFactor(navability_client, client, f)["addFactor"] for f in factors]
103
+
print("Adding variables and factors..\r\n")
104
+
variable_results = [await addVariable(navability_client, client, v) for v in variables]
105
+
factor_results = [await addFactor(navability_client, client, f) for f in factors]
106
+
result_ids = variable_results + factor_results
100
107
101
108
# Wait for them to be inserted if they havent already
# There's some pretty neat functionality with searching, but we'll save that for more comprehensive tutorials
110
121
111
122
# Request a SLAM multimodal solve and wait for the response
112
123
# Note: Guest sessions solve a little slower than usual because they're using some small hardware we put down for community use. Feel free to reach out if you want faster solving.
0 commit comments