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

Refactor factor constructor arguments #290

Closed
wants to merge 2 commits into from

Conversation

gchenfc
Copy link
Member

@gchenfc gchenfc commented Oct 15, 2021

This is basically a continuation of #217

Previously, factors took raw keys as arguments. However, the correct keys can be extracted from the joint object passed in. I believe allowing these raw key constructors is unsafe and this PR is being a little bit Nazi-like in banning this construction. For example,

// TwistFactor factor(example::twist_p_key, example::twist_c_key, example::qKey,
//                    example::qVelKey, example::cost_model, joint);
TwistFactor factor(example::cost_model, joint, 777);

I propose we ban the first (commented out) version to force users to use the proper DynamicsSymbol system.

I also took out the private constructors since I don't really see what utility they offer besides just making the reader jump back and forth more, but I can add them back if desired.

I know @varunagrawal took issue with removing the old constructors in #286, opting instead to keep the old constructors in addition to the new constructors, but I believe (1) this is more thematic with #217 and (2) explicitly disallowing the "raw key" versions should make things safer and less bug-prone.

@varunagrawal
Copy link
Collaborator

Simple reason why I disapprove: I need to be able to mix GTSAM and GTD keys. The IMU factors need GTSAM keys and they don't have time information built into them. :)

@varunagrawal
Copy link
Collaborator

Yeah this PR is closing off GTD to integration with other libraries. Not a good idea :(

@dellaert
Copy link
Member

dellaert commented Oct 16, 2021

Yeah this PR is closing off GTD to integration with other libraries. Not a good idea :(

Agreed for now. Please let’s discuss it in our meeting before doing anything about this. @gchenfc Please stick with the PR that we discussed without adding other elements into it?

@dellaert
Copy link
Member

Yeah this PR is closing off GTD to integration with other libraries. Not a good idea :(

Agreed for an hour. Please let’s discuss it in our meeting before doing anything about us. @gchenfc Please stick with the PR that we discussed without adding other elements into it?

By the way, I am not saying this is a bad idea, I’d like to learn more about the whole discussion before Doing anything. I can provide Context with respect to GTSAM and help evaluate @varunagrawal ’s concerns.

@dellaert
Copy link
Member

Yeah this PR is closing off GTD to integration with other libraries. Not a good idea :(

Agreed for an hour. Please let’s discuss it in our meeting before doing anything about us. @gchenfc Please stick with the PR that we discussed without adding other elements into it?

By the way, I am not saying this is a bad idea, I’d like to learn more about the whole discussion before Doing anything. I can provide Context with respect to GTSAM and help evaluate @varunagrawal ’s concerns.

PS PS should be “agreed for now” :-)

@gchenfc
Copy link
Member Author

gchenfc commented Oct 16, 2021

Yes we can discuss this later.

I just created this PR because I was halfway through a big rebase off #286 separating out changes that weren't relevant to that PR so I decided to finish that rebase and create this PR with it.

Then basing #291 off this branch was a mistake but I can fix that later.

@varunagrawal
Copy link
Collaborator

I merged master and looks like all the changes here have already been pushed into the master branch. Hence closing.

@varunagrawal varunagrawal deleted the refactor/factor_constructor_arguments branch October 18, 2023 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants