-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fixed horizon and other bugs in examples #100
Conversation
Fixed DynamicsGraph call to reflect update in constructor following discussion w/ @varunagrawal |
I will also fix an error due to TorqueKey, JointAngleKey and JointVelKey that arises in two of the examples |
@varunagrawal please review this before we merge #111 as some conflict... |
@dellaert Sorry for that, will do from now on! Yes I think so - these changes resolved the errors I was getting in building and executing the examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need references so we can cross verify the math.
Ah I get it now. Also, do you want me to handle the matrix multiplication? I have an idea to really simplify this code. |
Yes that will be great! |
I also think there's a bug in the CsvWriter since my traj.csv is empty. Does it work for you @scharalambous3? |
Yes that's right, mine is empty too |
Looks like @dellaert introduced the bug in line 232. There is an extra |
@scharalambous3 I just pushed up my update. Check out how clean the new code is (plus lines up perfectly with the math)! I verified the result by running a diff on the two |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great opportunity to get rid of copy/pasta, maybe make a new function in initialization utils. But make sure it does not already exist...
graph.addPrior(JointVelKey(j0_id, 0), X_i[1], dynamics_model); | ||
graph.addPrior(JointAngleKey(j1_id, 0), X_i[3], dynamics_model); | ||
graph.addPrior(JointVelKey(j1_id, 0), X_i[4], dynamics_model); | ||
graph.addPrior(internal::JointAngleKey(j0_id, 0), X_i[0], dynamics_model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/pasta
I think there must be a function already to do this, and if not, there should be
|
||
// Add initial conditions to trajectory factor graph. | ||
graph.addPrior(JointAngleKey(j1_id, 0), theta_i, dynamics_model); | ||
graph.addPrior(JointVelKey(j1_id, 0), dtheta_i, dynamics_model); | ||
graph.addPrior(internal::JointAngleKey(j1_id, 0), theta_i, dynamics_model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same copy/pasta!!!!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am approving this since the code seems satisfactory now. Thanks for the PR @scharalambous3!!
@scharalambous3 will leave you to handle @dellaert's comments. 🙂 |
I could not find a function that serves that purpose of associating the desired link and state term |
Nope not urgent. You should create the function, it'll be super useful! Good luck for the interview 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I had to build this branch without the Python wrapper otherwise I received the following error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:1841:16: error:
'pointer' declared as a pointer to a reference of type 'const Eigen::Matrix<double, -1, 1, 0, -1, 1> &'
typedef _Tp* pointer;
(even though the wrapper builds in master). @varunagrawal Any ideas?
Other than that, all the examples build and produce nice trajectories :)
Cart pole trajectory optimization:
Quadruped Static Motion Planning:
coeffs.push_back(a_3); | ||
|
||
return coeffs; | ||
gtsam::Matrix43 C; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much much cleaner, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can thank Sehoon Ha for teaching me all about splines last Fall. 🙂
@Alescontrela I can't reproduce the issue. Then again I put in a lot of new fixes to wrap to address a bunch of things so maybe try pulling the latest version? |
Fixed #94