Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK v0.6 #221

Merged
merged 39 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
8b5e4c4
WIP on updated SDK
GearsAD Mar 9, 2023
a6e878d
Update Project.toml
dehann Mar 12, 2023
bd0a6f3
Merge pull request #214 from NavAbility/23Q1/compat/json3
dehann Mar 12, 2023
e4cff4d
Merge branch 'main' into feature/v0_6_breaking_changes
dehann Mar 13, 2023
91ed772
drop depr file include
dehann Mar 13, 2023
ce176c3
Basic blocking calls on add and get for v4
Affie Mar 22, 2023
d0bf7f5
Can now add variable's satellites
Affie Mar 22, 2023
ddfa421
More CRUD, list, get, update (ppe vnd)
Affie Mar 23, 2023
8e4b0b5
add some delete functions
Affie Mar 23, 2023
30bcbc8
getNeighbors
Affie Mar 24, 2023
08fb255
exists by variable or factor label
Affie Mar 24, 2023
343cca1
Fix getVariables and better naming
Affie Mar 24, 2023
b6e41ac
getFactors working
Affie Mar 24, 2023
7be14d1
better return on listFators
Affie Mar 24, 2023
a24dd4b
Better Factors
Affie Mar 24, 2023
b134560
user::EmailAdress, nstime::String, delete, cleanup
Affie Mar 26, 2023
0be905d
Change to Label and cleanup
Affie Mar 28, 2023
3d05ef0
Split PPE.jl and SolverData.jl from Variable.jl
Affie Mar 29, 2023
8dd61f3
comparing variables vs user-robot-session-variables and other updates
Affie Mar 29, 2023
271b5c5
Merge branch 'main' into develop
Affie Mar 31, 2023
85b1b12
Merge branch 'main' into develop
Affie Mar 31, 2023
a7f54a2
Work on tests, lots more needed
Affie Mar 31, 2023
79a3b70
start julia gql toml loader
Affie Apr 14, 2023
e98552e
More tests and minor fixes
Affie Apr 14, 2023
66a3cee
covar in SolverData Fragment
Affie Apr 16, 2023
4225682
DFG and julia compat
Affie Apr 16, 2023
07efa06
rn PackedVariable -> Variable
Affie Apr 16, 2023
5cd4ccb
skip broken tests
Affie Apr 16, 2023
1c69872
More tests and exports
Affie Apr 17, 2023
9a1d0b7
More tests and Fixes
Affie Apr 17, 2023
21c0a29
Add codecov (#222)
Affie Apr 17, 2023
86e6cdc
Delete variable by label
Affie Apr 17, 2023
fc40aa6
Update BlobStore, new API and delete
Affie Apr 18, 2023
d12f7b5
Export and test some SessionBlobEntries functions
Affie Apr 18, 2023
d55c7d6
Fix export typo
Affie Apr 18, 2023
06dad53
some user robot session tests
Affie Apr 18, 2023
cc5591d
improve services/Variabe.jl tests
Affie Apr 19, 2023
a8f527f
More blobstore tests including cached store
Affie Apr 19, 2023
1158f72
listRobots and listSessions
Affie Apr 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
indent = 4 #
always_for_in = false #
whitespace_typedefs = true
whitespace_ops_in_indices = true
remove_extra_newlines = true
import_to_using = false #
pipe_to_function_call = false #
short_to_long_function_def = true
long_to_short_function_def = true
always_use_return = false
whitespace_in_kwargs = true #
annotate_untyped_fields_with_any = true #
conditional_to_if = true
separate_kwargs_with_semicolon = true
format_docstrings = true
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ on:
tags:
- v**
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version:
- '1.6'
- '1.8'
- '~1.9.0-0'
julia-arch: [x64]
os: [ubuntu-latest]

Expand All @@ -28,6 +29,10 @@ jobs:
arch: ${{ matrix.julia-arch }}
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v2
with:
files: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
Expand Down
19 changes: 11 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,35 @@ uuid = "f3e6a059-199c-4ada-8143-fcefb97e6165"
keywords = ["navability", "navigation", "slam", "sdk", "robotics", "robots"]
desc = "NavAbility SDK: Access NavAbility Cloud factor graph features. Note that this SDK and the related API are still in development. Please let us know if you have any issues at [email protected]."
authors = ["NavAbility <[email protected]>"]
version = "0.5.1"
version = "0.6.0"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Diana = "070d9d8b-17a7-5814-83fa-42438ba5c6e0"
DistributedFactorGraphs = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
GraphQLClient = "09d831e3-9c21-47a9-bfd8-076871817219"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StructTypes = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
Diana = "0.2, 0.3"
DistributedFactorGraphs = "0.21"
DocStringExtensions = "0.8, 0.9"
Downloads = "1"
HTTP = "^1.7"
JSON = "0.21"
HTTP = "1.7"
JSON3 = "1"
TensorCast = "0.4"
julia = "1.6"
julia = "1.8"

[extras]
TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["TensorCast","Test"]
test = ["TensorCast", "Test"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ end
@nvaZInferenceType PriorPose2
@nvaZInferenceType Pose2Pose2

@nvaZInferenceType PriorPoint3
@nvaZInferenceType PriorPose3
@nvaZInferenceType Pose3Pose3
@nvaZInferenceType Pose3Pose3Rotation
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mutation sdk_adddataentry(\$userId: ResourceId!, \$robotId: ResourceId!, \$sessi
robotId: \$robotId,
sessionId: \$sessionId
},
blobStoreEntry: {
blobEntry: {
id: \$dataId,
label: \$dataLabel
mimetype: \$mimeType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
GQL_FRAGMENT_FACTORS = """
fragment blobEntry_fields on BlobEntry {
id
blobId
originId
label
description
hash
mimeType
blobstore
origin
metadata
timestamp
_type
_version
createdTimestamp
lastUpdatedTimestamp
}
fragment factor_skeleton_fields on Factor {
id
label
tags
_variableOrderSymbols
}
fragment factor_summary_fields on Factor {
timestamp
nstime
_version
blobEntries {
...blobEntry_fields
}
createdTimestamp
lastUpdatedTimestamp
}
fragment factor_full_fields on Factor {
fnctype
Expand Down Expand Up @@ -89,6 +113,22 @@ query sdk_get_factors(
}
"""

GQL_ADD_FACTOR_PACKED = """
mutation sdk_add_factor_packed(
\$factorPackedInput: AddFactorPackedInput!,
\$options: AddFactorPackedOptionsInput
) {
addFactorPacked(factor: \$factorPackedInput, options:\$options) {
context {
eventId
}
status {
state
progress
}
}
}"""

GQL_DELETEFACTOR = """
mutation sdk_delete_factor(
\$factor: DeleteFactorInput!,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
GQL_FRAGMENT_VARIABLES = """
fragment ppe_fields on Ppe {
id
solveKey
suggested
max
mean
_type
_version
createdTimestamp
lastUpdatedTimestamp
}
fragment solverdata_fields on SolverData {
id
solveKey
BayesNetOutVertIDs
BayesNetVertID
Expand All @@ -27,33 +32,46 @@ GQL_FRAGMENT_VARIABLES = """
vecval
_version
}
fragment dataEntry_fields on DataEntry {
label
fragment blobEntry_fields on BlobEntry {
id
blobstore
hash
origin
blobId
originId
label
description
hash
mimeType
# createdTimestamp
blobstore
origin
metadata
timestamp
_type
_version
createdTimestamp
lastUpdatedTimestamp
}
fragment variable_skeleton_fields on Variable {
id
label
tags
}
fragment variable_summary_fields on Variable {
timestamp
nstime
variableType
ppes {
...ppe_fields
}
dataEntry: data {
...dataEntry_fields
blobEntries {
...blobEntry_fields
}
variableType
_version
_type
_version
createdTimestamp
lastUpdatedTimestamp
}
fragment variable_full_fields on Variable{
smallData
fragment variable_full_fields on Variable {
metadata
solvable
solverData
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@

function addPackedFactor(navAbilityClient::NavAbilityClient, client::Client, factor)::String
function addFactorPackedEvent(navAbilityClient::NavAbilityClient, client::Client, factor::Dict; options=Dict{String, Any}())::String
data = Dict(
"factorPackedInput" => Dict(
"session" => Dict(
"key" => client
),
"packedData" => base64encode(json(factor))
),
"options" => options
)
response = navAbilityClient.mutate(MutationOptions(
"addFactor",
MUTATION_ADDFACTOR,
Dict(
"factor" => Dict(
"client" => client,
"packedData" => json(factor)
)
)
"sdk_add_factor_packed",
GQL_ADD_FACTOR_PACKED,
data
)) |> fetch

rootData = JSON.parse(response.Data)
if haskey(rootData, "errors")
@error response
throw("Error: $(rootData["errors"])")
end
data = get(rootData,"data",nothing)
if data === nothing return "Error" end
addFactor = get(data,"addFactor","Error")
return addFactor
return data["addFactorPacked"]["context"]["eventId"]
end

function addFactorPacked(navAbilityClient::NavAbilityClient, client::Client, factor::Dict; options::Dict=Dict{String,Any}("force" => false))
return @async addFactorPackedEvent(navAbilityClient, client, factor; options)
end

function addFactor(navAbilityClient::NavAbilityClient, client::Client, factor::Factor)
return @async addPackedFactor(navAbilityClient, client, factor)
function addFactor(navAbilityClient::NavAbilityClient, client::Client, factor::Variable)
@warn "This function signature will change during 0.6, please use addFactorPacked."
return @async addVariablePackedEvent(navAbilityClient, client, factor; options)
end

function _getFactorEvent(navAbilityClient::NavAbilityClient, client::Client, label::String)::Dict{String,Any}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Variable(
return result
end

function addPackedVariableEvent(navAbilityClient::NavAbilityClient, client::Client, variable::Dict; options=Dict{String, Any}())::String
function addVariablePackedEvent(navAbilityClient::NavAbilityClient, client::Client, variable::Dict; options=Dict{String, Any}())::String
data = Dict(
"variablePackedInput" => Dict(
"session" => Dict(
Expand Down Expand Up @@ -50,43 +50,21 @@ end


function addVariablePacked(navAbilityClient::NavAbilityClient, client::Client, variable::Dict; options::Dict=Dict{String,Any}("force" => false))
return @async addPackedVariableEvent(navAbilityClient, client, variable; options)
return @async addVariablePackedEvent(navAbilityClient, client, variable; options)
end

function updateVariablePacked(navAbilityClient::NavAbilityClient, client::Client, variable::Dict; options::Dict=Dict{String,Any}("force" => true))
return @async addPackedVariableEvent(navAbilityClient, client, variable; options)
end

function addPackedVariableOld(navAbilityClient::NavAbilityClient, client::Client, variable)::String
response = navAbilityClient.mutate(MutationOptions(
"addVariable",
MUTATION_ADDVARIABLE,
Dict(
"variable" => Dict(
"client" => client,
"packedData" => json(variable)
)
)
)) |> fetch
rootData = JSON.parse(response.Data)
if haskey(rootData, "errors")
@error response
throw("Error: $(rootData["errors"])")
end
data = get(rootData,"data",nothing)
if data === nothing return "Error" end
addVariable = get(data,"addVariable","Error")
return addVariable
return @async addVariablePackedEvent(navAbilityClient, client, variable; options)
end

function addVariable(navAbilityClient::NavAbilityClient, client::Client, variable::Variable)
# TODO: Use new
# return @async addPackedVariable(navAbilityClient, client, json(variable))
return @async addPackedVariableOld(navAbilityClient, client, variable)
@warn "This function signature will change during 0.6, please use addVariablePacked."
return @async addVariablePackedEvent(navAbilityClient, client, JSON3.read(JSON3.write(variable), Dict{string, Any}); options)
end

function updateVariable(navAbilityClient::NavAbilityClient, client::Client, variable::Variable)
return @async updatePackedVariable(navAbilityClient, client, json(variable))
@warn "This function signature will change during 0.6, please use updateVariablePacked."
return @async updateVariablePacked(navAbilityClient, client, json(variable))
end

function getVariableEvent(
Expand Down
26 changes: 11 additions & 15 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ using Documenter

const NvaSDK = NavAbilitySDK


DocMeta.setdocmeta!(NavAbilitySDK, :DocTestSetup, :(using NavAbilitySDK); recursive=true)
DocMeta.setdocmeta!(NavAbilitySDK, :DocTestSetup, :(using NavAbilitySDK); recursive = true)

makedocs(;
modules=[NavAbilitySDK],
authors="NavAbility",
repo="https://github.com/NavAbility/NavAbilitySDK.jl/blob/{commit}{path}#{line}",
sitename="NavAbilitySDK.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://NavAbility.github.io/NavAbilitySDK.jl",
assets=String[],
modules = [NavAbilitySDK],
authors = "NavAbility",
repo = "https://github.com/NavAbility/NavAbilitySDK.jl/blob/{commit}{path}#{line}",
sitename = "NavAbilitySDK.jl",
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
canonical = "https://NavAbility.github.io/NavAbilitySDK.jl",
assets = String[],
),
pages=[
pages = [
"Home" => "index.md",
"Getting Started" => "start.md",
"Variables" => "variables.md",
Expand All @@ -27,7 +26,4 @@ makedocs(;
],
)

deploydocs(;
repo="github.com/NavAbility/NavAbilitySDK.jl",
devbranch="main",
)
deploydocs(; repo = "github.com/NavAbility/NavAbilitySDK.jl", devbranch = "main")
Loading