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

Changing radar factor to use a correct serialization strategy #611

Closed
wants to merge 1 commit into from

Conversation

GearsAD
Copy link
Collaborator

@GearsAD GearsAD commented Sep 2, 2020

No description provided.

end

function string2image(stringdata::String)::Array{Float64, 2}
io = IOBuffer(base64decode(stringdata))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to help string together all the different image encoding methods -- here is a binary store via png (ImageMagick.jl):
https://juliarobotics.org/Caesar.jl/latest/concepts/interacting_fgs/#Adding-Data-Blobs

I also created this in Caesar.jl

function fetchDataImage(dfg::AbstractDFG,

@dehann
Copy link
Member

dehann commented Jan 11, 2021

This should be much easier to do now the the new CalcFactor metadata approach:
https://juliarobotics.org/Caesar.jl/latest/examples/basic_definingfactors/#Metadata

@dehann
Copy link
Member

dehann commented Oct 8, 2021

Now that residual functions use CalcFactor we have a much better way of handling meta / additional data for problems like these. Will update accordingly

@dehann dehann added this to the v0.11.1 milestone Oct 8, 2021
@dehann dehann modified the milestones: v0.11.1, v0.11.2 Dec 4, 2021
@dehann dehann modified the milestones: v0.12.0, v0.12.1 Feb 22, 2022
@dehann
Copy link
Member

dehann commented Feb 22, 2022

I'd like to update this to use data blobs and the new approach, we just overload for the factor:

# for overloading
import IncrementalInference: preambleCache

function IIF.preambleCache(dfg::AbstractDFG, vars::AbstractVector{<:DFGVariable}, fct::ScatterAlignPose2)
  # load image from blog store
  #   see https://juliarobotics.org/Caesar.jl/latest/concepts/entry_data/#Retrieving-a-Data-Blob
  img1 = fetchData(dfg, getLabel(vars[1]), :image_store, :radar_sweep) 

  # lazy approach is just to have `typeof(CalcFactor{<:ScatterAlignPose2})` be `NamedTuple{(:img1,:img2),Tuple{Matrix{Gray{...}}, Matrix{Gray{...}}}`
  return (;img1, img2)
end

So then in the samping and residual functions, you can just do:

function (sap::CalcFactor{<:ScatterAlignPose2})(wPi, wPj)
  img1 = sap.cache.img1
  img2 = sap.cache.img2
  # ...
end

@dehann
Copy link
Member

dehann commented Apr 20, 2022

Replaced by much improved ScatterAlignPose2, and standardized serialization in:

Closing this for now, but will keep the branch in case we revive AlignRadarPose2 in the future

1 similar comment
@dehann
Copy link
Member

dehann commented Apr 20, 2022

Replaced by much improved ScatterAlignPose2, and standardized serialization in:

Closing this for now, but will keep the branch in case we revive AlignRadarPose2 in the future

@dehann dehann closed this Apr 20, 2022
@dehann dehann closed this Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

2 participants