-
Notifications
You must be signed in to change notification settings - Fork 13
Make Values.TangentVector == VectorValues #49
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
Make Values.TangentVector == VectorValues #49
Conversation
Nice! However I think I am missing some pieces in merging the previous PR into the generic NLFG in #44, specifically, differentiability on |
My quick guess is that all you need to do is add this where clause to the factor declarations:
I don't have time to actually try it out in code today, so if you haven't gotten it yet, I'll try it out tomorrow and figure out if it actually works. |
@marcrasi I pushed the WIP on #44, the error being:
I tried some tweaking on the generated code to add |
Thanks, I'm starting to look now! |
I'll rebase this on feature/nlfg_with_manifold so that you do not have to do that. I'll open a new PR once that is ready. |
Ok, the rebased version is #50. |
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).