Make Values.TangentVector == VectorValues #50
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(This is #49, rebased to feature/nlfg_with_manifold. I'm pasting the same description below.)
This sets
Values.TangentVector
toVectorValues
, which allows a few nice improvements to the APIs:Value
using aVectorValues
, now all you need isvals.move(along: vectorval)
instead of needing to loop over all the components and cast them.JacobianFactor
initializer that linearizes any error function, which simplifies the implementation oflinearize
.Other API changes:
vals[key, as: Pose2.self]
instead ofvals[key].baseAs(Pose2.self)
. This is necessary so thatValues
knows what type you are accessing and therefore knows how to convert its tangent vector to aVector
suitable for inclusion inVectorValues
.vals.insert(key, value)
instead ofvals.insert(key, AnyDifferentiable(value)
. (It still gets stored as a type-erasedAnyDifferentiable
though).