-
Notifications
You must be signed in to change notification settings - Fork 32
update docs w sampling data formats #895
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,17 @@ end | |
``` | ||
New relative factors should either inheret from `<:AbstractManifoldMinimize`, `<:AbstractRelativeMinimize`, or `<:AbstractRelativeRoots`. These are all subtypes of `<:AbstractRelative`. There are only two abstract super types, `<:AbstractPrior` and `<:AbstractRelative`. | ||
|
||
## Summary of Sampling Data Representation | ||
|
||
| Usage | `<:AbstractPrior` | `<:AbstractRelative` | | ||
|-------------|--------------------|-----------------------| | ||
| `getSample` | point `p` on Manifold | tangent `X` at some `p` (e.g. identity) | | ||
|
||
| Usage | | | ||
|-------------------|----| | ||
| `sampleTangent` | tangent at point `p` or the identity element for groups | | ||
| `rand` / `sample` | coordinates | | ||
|
||
## Specialized Dispatch (`getManifold`, `getSample`) | ||
|
||
Relative factors involve computaton, these computations must be performed on some manifold. Custom relative factors require that the [`getManifold`](@ref) function be overridded. Here two examples are given for reference: | ||
|
@@ -47,7 +58,7 @@ function getSample(cf::CalcFactor{<:Pose2Pose2}) | |
end | ||
``` | ||
|
||
The return type for `getSample` is unrestricted, and will be passed to the residual function "as-is". | ||
The return type for `getSample` is unrestricted, and will be passed to the residual function "as-is", but must return values representing a tangent vector for `<:AbstractRelative` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this might be the other way around, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tangent on relative factors -- that's what the PR already has, no? "a tangent vector for |
||
|
||
!!! note | ||
Default dispatches in `IncrementalInference` will try use `cf.factor.Z` to `samplePoint` on manifold (for `<:AbstractPrior`) or `sampleTangent` (for `<:AbstractRelative`), which simplifies new factor definitions. If, however, you wish to build more complicated sampling processes, then simply define your own `getSample(cf::CalcFactor{<:MyFactor})` function. | ||
|
@@ -70,11 +81,11 @@ function (cf::CalcFactor{<:Pose2Pose2})(X, p, q) | |
end | ||
``` | ||
|
||
It is recommended to leave the incoming types unrestricted. If you must define the types, make sure to allow sufficient dispatch freedom (i.e. dispatch to concrete types) and not force operations to "non-concrete" types. Usage can be very case specific, and hence better to let Julia type-inference automation do the hard work of inferring the concrete types. | ||
|
||
!!! note | ||
At present (2021) the residual function should return the residual value as a coordinate (not as tangent vectors or manifold points). Ongoing work is in progress, and likely to return residual values as manifold tangent vectors instead. | ||
|
||
It is recommended to leave the incoming types unrestricted. If you must define the types, make sure to allow sufficient dispatch freedom (i.e. dispatch to concrete types) and not force operations to "non-concrete" types. Usage can be very case specific, and hence better to let Julia type-inference automation do the hard work of inferring the concrete types. | ||
|
||
### Serialization | ||
|
||
Serialization of factors is also discussed in more detail at [Standardized Factor Serialization](@ref factor_serialization). |
Uh oh!
There was an error while loading. Please reload this page.