Skip to content

Commit

Permalink
Removing Caesar.initfg old API
Browse files Browse the repository at this point in the history
  • Loading branch information
GearsAD committed Jun 24, 2019
1 parent c8b58a1 commit b2c9b8c
Show file tree
Hide file tree
Showing 42 changed files with 59 additions and 69 deletions.
2 changes: 1 addition & 1 deletion docs/src/concepts/multilang.md
Expand Up @@ -37,7 +37,7 @@ Then run the following commands, and note these steps have also been [scripted h
using Caesar, Caesar.ZmqCaesar

# create empty factor graph and config objects
fg = Caesar.initfg()
fg = initfg()
config = Dict{String, String}()
zmqConfig = ZmqServer(fg, config, true, "tcp://*:5555");

Expand Down
2 changes: 1 addition & 1 deletion examples/database/0_HexagonalSlam2d.jl
Expand Up @@ -14,7 +14,7 @@ addrdict["robotId"] = "TestRobot"

# Start with an empty graph (local dictionary version) # fg = initfg(sessionname="SLAM2D_TUTORIAL")
## TODO -- ISSUE Julia 0.6.0-0.6.2 dives into some StackOverflow problem using the functions, but fine when called separately.
fg = Caesar.initfg(sessionname=user_config["session"], robotname=addrdict["robotId"], cloudgraph=backend_config)
fg = initfg(sessionname=user_config["session"], robotname=addrdict["robotId"], cloudgraph=backend_config)

# fg = RoME.initfg(sessionname=addrdict["session"])
# fg = IncrementalInference.emptyFactorGraph()
Expand Down
4 changes: 2 additions & 2 deletions examples/database/1_subGraphCopy.jl
Expand Up @@ -12,7 +12,7 @@ addrdict["robotId"] = "PixieBot"


# 2. Create a local empty factor graph object
fg = Caesar.initfg(sessionname=addrdict["sessionId"], robotname=addrdict["robotId"], cloudgraph=cg)
fg = initfg(sessionname=addrdict["sessionId"], robotname=addrdict["robotId"], cloudgraph=cg)
# fg.stateless = true # so that we don't update local elements


Expand All @@ -26,7 +26,7 @@ Graphs.plot(fg.g)

# ===========ALTERNATIVE========================================================

fg = Caesar.initfg(sessionname=addrdict["sessionId"], robotname=addrdict["robotId"], cloudgraph=cg)
fg = initfg(sessionname=addrdict["sessionId"], robotname=addrdict["robotId"], cloudgraph=cg)
# 3.b Or fetch the entire factor graph
Caesar.fullLocalGraphCopy!(fg, reqbackendset=false, reqready=false)

Expand Down
2 changes: 1 addition & 1 deletion examples/database/RandomCloudGraphsInteraction.jl
Expand Up @@ -15,7 +15,7 @@ include(joinpath(dirname(@__FILE__),"blandauthremote.jl"))



fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)
fullLocalGraphCopy!(fg)

@show usrf = getData(fg.g.vertices[100003]).fnc.usrfnc!
Expand Down
2 changes: 1 addition & 1 deletion examples/database/ReadAcousticTest.jl
Expand Up @@ -22,7 +22,7 @@ include(joinpath(dirname(@__FILE__),"blandauthremote.jl"))



fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)


updatenewverts!(fg, N=Nparticles)
Expand Down
4 changes: 2 additions & 2 deletions examples/database/ReadNewData.jl
Expand Up @@ -23,7 +23,7 @@ include(joinpath(dirname(@__FILE__),"blandauthremote.jl"))
# fieldnames(fg.cg.neo4j)

N=Nparticles
fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)

# setBackendWorkingSet!(conn, session)
fullLocalGraphCopy!(fg)
Expand All @@ -45,7 +45,7 @@ writeGraphPdf(fg)


# Okay now solve locally, or start MM-iSAMCloudSolve.jl
fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)

setDBAllReady!(fg)
setBackendWorkingSet!(conn, session)
Expand Down
2 changes: 1 addition & 1 deletion examples/database/dbgFullLocalGraphCopy.jl
Expand Up @@ -20,7 +20,7 @@ Nparticles = 100
include(joinpath(dirname(@__FILE__),"blandauthremote.jl"))


fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)


# setDBAllReady!(fg)
Expand Down
2 changes: 1 addition & 1 deletion examples/database/dbg_packedtype_conversions.jl
Expand Up @@ -16,7 +16,7 @@ addrdict["robotId"] = "TestRobot"


# Start with an empty graph (local dictionary version) # fg = initfg(sessionname="SLAM2D_TUTORIAL")
fg = Caesar.initfg(sessionname=user_config["session"], robotname=addrdict["robotId"], cloudgraph=backend_config)
fg = initfg(sessionname=user_config["session"], robotname=addrdict["robotId"], cloudgraph=backend_config)


# first pose :x0
Expand Down
4 changes: 2 additions & 2 deletions examples/database/dev/BasicCloudGraphsSLAM.jl
Expand Up @@ -18,7 +18,7 @@ include(joinpath(dirname(@__FILE__),"blandauthremote.jl"))



fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)
println("Working with session $(fg.sessionname)...")


Expand Down Expand Up @@ -52,7 +52,7 @@ neighs = CloudGraphs.get_neighbors(fg.cg, cv1r)


# now solve using separate variable
fgs = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fgs = initfg(sessionname=session, cloudgraph=cloudGraph)

setBackendWorkingSet!(conn, session)
fullLocalGraphCopy!(fgs)
Expand Down
2 changes: 1 addition & 1 deletion examples/database/dev/BuildCloudFactorGraph.jl
Expand Up @@ -17,7 +17,7 @@ Nparticles = parse(Int,addrdict["num particles"])
N=Nparticles profroot
profroot

fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)


# Robot navigation and inference type stuff
Expand Down
6 changes: 3 additions & 3 deletions examples/database/dev/MM-iSAMCloudSolve.jl
Expand Up @@ -17,14 +17,14 @@ Nparticles = parse(Int, addrdict["num particles"])
println("Attempting to solve session $(session) with $(Nparticles) particles per marginal...")


fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)

setBackendWorkingSet!(fg.cg.neo4j.connection, session)

# TODO -- incremental graph and subgraphs are works in progress
while true
println("=================================================")
fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)

setBackendWorkingSet!(fg.cg.neo4j.connection, session)

Expand All @@ -49,7 +49,7 @@ end



# fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
# fg = initfg(sessionname=session, cloudgraph=cloudGraph)
# fullLocalGraphCopy!(fg, conn)
#
# ls(fg)
Expand Down
2 changes: 1 addition & 1 deletion examples/database/dev/convertmongokeys.jl
Expand Up @@ -41,7 +41,7 @@ db = client[:CloudGraphs]



fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)


# totally reset to frontend built state in DB
Expand Down
2 changes: 1 addition & 1 deletion examples/database/dev/convertslamindb.jl
Expand Up @@ -20,7 +20,7 @@ segment = ""
info("remember to set n.ready=1")
if !clearslamindbdata
println("converting front end data")
fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)
Nparticles = parse(Int, addrdict["num particles"])
updatenewverts!(fg, N=Nparticles)
else
Expand Down
Expand Up @@ -46,7 +46,7 @@ plotKDE(prp2.belief)

# setBackendWorkingSet!(fg.cg.neo4j.connection, session)
# get full graph copy
fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)
fullLocalGraphCopy!(fg)

# import IncrementalInference: saveplot
Expand Down
Expand Up @@ -51,7 +51,7 @@ for ANAITER in Int[1;2;3;4;5]
sfg, lms = getLocalSubGraphMultisession(cloudGraph, lm2others,
session=session, numneighbors=1)

fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)
fullLocalGraphCopy!(fg)

jldfile = string(resultsfolder,"/", session, "_$(ANAITER).jld")
Expand Down
2 changes: 1 addition & 1 deletion examples/database/templatedbinteraction.jl
Expand Up @@ -10,7 +10,7 @@ addrdict["user"] = "user"
cloudGraph, addrdict = standardcloudgraphsetup(addrdict=addrdict)


fg = Caesar.initfg(cloudgraph=cloudGraph, sessionname=addrdict["session"])
fg = initfg(cloudgraph=cloudGraph, sessionname=addrdict["session"])
fullLocalGraphCopy!(fg)
savejld(fg, file="somefg.jld")

Expand Down
Expand Up @@ -80,7 +80,7 @@ poseswithdepth["x1"] = 0 # skip this pose -- there is no big data before ICRA
while true

# this is being replaced by cloudGraph, added here for development period
fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)

IDs = getPoseExVertexNeoIDs(fg.cg.neo4j.connection, session=session, reqbackendset=false);

Expand Down
Expand Up @@ -10,7 +10,7 @@ addrdict["user"] = "user"
cloudGraph, addrdict = standardcloudgraphsetup(addrdict=addrdict)


fg = Caesar.initfg(cloudgraph=cloudGraph, sessionname=addrdict["session"])
fg = initfg(cloudgraph=cloudGraph, sessionname=addrdict["session"])
fullLocalGraphCopy!(fg)
savejld(fg, file="sandshark_testing_seg417_iNA.jld")

Expand Down
2 changes: 1 addition & 1 deletion examples/database/visualizations/plotpose2.jl
Expand Up @@ -16,7 +16,7 @@ Nparticles = parse(Int,addrdict["num particles"])

# fieldnames(fg.cg.neo4j)

fg = Caesar.initfg(sessionname=session, cloudgraph=cloudGraph)
fg = initfg(sessionname=session, cloudgraph=cloudGraph)

# setBackendWorkingSet!(conn, session)
fullLocalGraphCopy!(fg)
Expand Down
2 changes: 1 addition & 1 deletion examples/dev/FreezeVariables.jl
Expand Up @@ -3,7 +3,7 @@ using Caesar
robotId = "Munster"
sessionId = "Test"

fg = Caesar.initfg(sessionname=sessionId, robotname=robotId)
fg = initfg(sessionname=sessionId, robotname=robotId)

# also add a PriorPose2 to pin the first pose at a fixed location
addVariable!(fg, :x0, Pose2) # , labels=["POSE"]
Expand Down
2 changes: 1 addition & 1 deletion examples/dfg/HexagonalDFG_PoC.jl
Expand Up @@ -22,7 +22,7 @@ info(dfg)
####### ---- MAIN Example

# ... And away we go!
# fg = Caesar.initfg()
# fg = initfg()

# Add a first pose variable - x0
addV!(dfg, :x0, Pose2()) # , labels=["POSE"]
Expand Down
2 changes: 1 addition & 1 deletion examples/marine/rov/asfm/ASfMExample.jl
Expand Up @@ -63,7 +63,7 @@ vc = startdefaultvisualization()


N = 200
fg = Caesar.initfg()
fg = initfg()

sqrtinv = [[10;0;0;0;0;0]';
[0;10;0;0;0;0]';
Expand Down
2 changes: 1 addition & 1 deletion examples/marine/rov/highend/lcmserver/drawtoolsfromdb.jl
Expand Up @@ -10,7 +10,7 @@ addrdict["user"] = "user"
cloudGraph, addrdict = standardcloudgraphsetup(addrdict=addrdict)


fg = Caesar.initfg(cloudgraph=cloudGraph, sessionname=addrdict["session"])
fg = initfg(cloudgraph=cloudGraph, sessionname=addrdict["session"])
fullLocalGraphCopy!(fg)
# savejld(fg, file="somefg.jld")

Expand Down
Expand Up @@ -63,7 +63,7 @@ end
# fetch and study the graph as built by server.jl

# setBackendWorkingSet!(fg.cg.neo4j.connection, user_config["session"])
fg = Caesar.initfg(cloudgraph=backend_config, sessionname=user_config["session"])
fg = initfg(cloudgraph=backend_config, sessionname=user_config["session"])
fullLocalGraphCopy!(fg, reqbackendset=true)
writeGraphPdf(fg)
run(`evince fg.pdf`)
Expand Down Expand Up @@ -167,7 +167,7 @@ zpr5 = veeEuler(wTx5)[[3;4;5]]

# build a new factor graph from this info
N = 100
fgnew = Caesar.initfg(cloudgraph=backend_config, sessionname="SESSHAUVCODED")
fgnew = initfg(cloudgraph=backend_config, sessionname="SESSHAUVCODED")


addVariable!(fgnew,:x1,N=N,labels=["POSE"], dims=6)
Expand Down
2 changes: 1 addition & 1 deletion examples/marine/rov/highend/lcmserver/lcmdbservice.jl
Expand Up @@ -238,7 +238,7 @@ end

function setupSLAMinDB(;cloudGraph=nothing, addrdict=nothing)
if cloudGraph != nothing
return SLAMWrapper(Caesar.initfg(sessionname=addrdict["session"], cloudgraph=cloudGraph), nothing, 0)
return SLAMWrapper(initfg(sessionname=addrdict["session"], cloudgraph=cloudGraph), nothing, 0)
else
return SLAMWrapper(RoME.initfg(), nothing, 0)
end
Expand Down
2 changes: 1 addition & 1 deletion examples/marine/rov/highend/lcmserver/lcmpose3server.jl
Expand Up @@ -125,7 +125,7 @@ function runlistener(
end

function setupSLAMinDB(cloudGraph, addrdict)
SLAMWrapper(Caesar.initfg(sessionname=addrdict["session"], cloudgraph=cloudGraph), nothing, 0)
SLAMWrapper(initfg(sessionname=addrdict["session"], cloudgraph=cloudGraph), nothing, 0)
end

function lcmsendpose(lc, vert::Graphs.ExVertex, usrid::Int)
Expand Down
2 changes: 1 addition & 1 deletion examples/marine/rov/highend/lcmserver/pointclouddev.jl
Expand Up @@ -48,7 +48,7 @@ end
# this function is on notice!
function setupSLAMinDB(;cloudGraph=nothing, addrdict=nothing)
if cloudGraph != nothing
return SLAMWrapper(Caesar.initfg(sessionname=addrdict["session"], cloudgraph=cloudGraph), nothing, 0)
return SLAMWrapper(initfg(sessionname=addrdict["session"], cloudgraph=cloudGraph), nothing, 0)
else
return SLAMWrapper(RoME.initfg(), nothing, 0)
end
Expand Down
2 changes: 1 addition & 1 deletion examples/marine/rov/highend/lcmserver/server.jl
Expand Up @@ -32,7 +32,7 @@ println("[Caesar.jl] Importing LCM message types")
function initialize!(backend_config,
user_config)
println("[Caesar.jl] Setting up factor graph")
fg = Caesar.initfg(sessionname=user_config["session"], cloudgraph=backend_config)
fg = initfg(sessionname=user_config["session"], cloudgraph=backend_config)
println("[Caesar.jl] Creating SLAM client/object")
return SLAMWrapper(fg, nothing, 0)
end
Expand Down
2 changes: 1 addition & 1 deletion examples/visualization/dbposevisualization.jl
Expand Up @@ -15,7 +15,7 @@ cloudGraph, addrdict = standardcloudgraphsetup(addrdict=addrdict)

session = ddrdict["session"]

# fg = Caesar.initfg(sessionname=addrdict["session"], cloudgraph=cloudGraph)
# fg = initfg(sessionname=addrdict["session"], cloudgraph=cloudGraph)

IDs = getPoseExVertexNeoIDs(cloudGraph.neo4j.connection, session=addrdict["session"], reqbackendset=false);

Expand Down
8 changes: 4 additions & 4 deletions examples/wheeled/vicprk_dev.jl
Expand Up @@ -23,7 +23,7 @@ include(joinpath(Pkg.dir("Caesar"),"examples","wheeled","loadVicPrkData.jl"))
# # Start new session
# addrdict["sessionId"] = "VICPRK_VID"
# addrdict["robotId"] = "Ute"
# fg = Caesar.initfg(sessionname=user_config["sessionId"], robotname=user_config["robotId"], cloudgraph=backend_config)
# fg = initfg(sessionname=user_config["sessionId"], robotname=user_config["robotId"], cloudgraph=backend_config)
# deleteServerSession!(fg.cg, user_config["sessionId"])


Expand All @@ -43,7 +43,7 @@ lsrNoise=diagm([0.1;1.0])

# start factor graph
N=100
fg = Caesar.initfg()
fg = initfg()
lmoccur = Dict{Symbol, Int}()

# init pose
Expand Down Expand Up @@ -201,7 +201,7 @@ end

# fetch a local copy

fg = Caesar.initfg(sessionname=user_config["sessionId"], cloudgraph=backend_config) #, robotname=user_config["robotId"]
fg = initfg(sessionname=user_config["sessionId"], cloudgraph=backend_config) #, robotname=user_config["robotId"]
fullLocalGraphCopy!(fg)
# pl1=drawPosesLandms(fg)

Expand Down Expand Up @@ -244,7 +244,7 @@ for l1 in L
j+=1
end
#run Server Code
fg = Caesar.initfg(sessionname=user_config["sessionId"], cloudgraph=backend_config)
fg = initfg(sessionname=user_config["sessionId"], cloudgraph=backend_config)
fullLocalGraphCopy!(fg)
pl2=drawPosesLandms(fg)
draw(PDF("daniel.pdf",20cm,20cm),pl2)
Expand Down
4 changes: 2 additions & 2 deletions examples/wheeled/vicprk_full_visual.jl
Expand Up @@ -24,7 +24,7 @@ include(joinpath(Pkg.dir("Caesar"),"examples","wheeled","loadVicPrkData.jl"))
# # Start new session
# addrdict["sessionId"] = "VICPRK_VID"
# addrdict["robotId"] = "Ute"
# fg = Caesar.initfg(sessionname=user_config["sessionId"], robotname=user_config["robotId"], cloudgraph=backend_config)
# fg = initfg(sessionname=user_config["sessionId"], robotname=user_config["robotId"], cloudgraph=backend_config)
# deleteServerSession!(fg.cg, user_config["sessionId"])


Expand All @@ -50,7 +50,7 @@ function mainrun(dd,ff; frames=3, coord=Coord.Cartesian(xmin=-100,xmax=100,ymin=

# start factor graph
N=75
fg = Caesar.initfg()
fg = initfg()
lmoccur = Dict{Symbol, Int}()

# init pose
Expand Down
6 changes: 3 additions & 3 deletions examples/wheeled/victoriapark_onserver.jl
Expand Up @@ -43,7 +43,7 @@ addrdict["robotId"] = "Ute"

# Graphs.plot(fg.g)

fg = Caesar.initfg(sessionname=user_config["sessionId"], robotname=user_config["robotId"], cloudgraph=backend_config)
fg = initfg(sessionname=user_config["sessionId"], robotname=user_config["robotId"], cloudgraph=backend_config)

# deleteServerSession!(fg.cg, user_config["session"])

Expand Down Expand Up @@ -93,7 +93,7 @@ Gadfly.draw(PDF("/tmp/before.pdf",20cm,20cm),pl)

# fetch a local copy

fg = Caesar.initfg(sessionname=user_config["sessionId"], cloudgraph=backend_config) #, robotname=user_config["robotId"]
fg = initfg(sessionname=user_config["sessionId"], cloudgraph=backend_config) #, robotname=user_config["robotId"]
fullLocalGraphCopy!(fg)
pl1=drawPosesLandms(fg)

Expand Down Expand Up @@ -133,7 +133,7 @@ for l1 in L
j+=1
end
#run Server Code
fg = Caesar.initfg(sessionname=user_config["session"], cloudgraph=backend_config)
fg = initfg(sessionname=user_config["session"], cloudgraph=backend_config)
fullLocalGraphCopy!(fg)
pl2=drawPosesLandms(fg)
draw(PDF("daniel.pdf",20cm,20cm),pl2)
Expand Down

0 comments on commit b2c9b8c

Please sign in to comment.