-
Notifications
You must be signed in to change notification settings - Fork 356
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
add support of CASADI #813
Conversation
Minor info: I have found some bugs. I will try to push a fix by tomorrow. |
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.
As a remark, I think support of external libraries like casADi, AutoDiff, CppAD should not be added this way. I would put all the template specialization code into separate files.
There are good reasons for this:
- putting the specialization into the main files prevents user to provide their own specialization, e.g. for an application specific case or to fix a bugged specialization.
- it should be provided not as a complete but rather as a start. User may need to complete it. As far as I know (correct me if I am wrong), the main developers of Pinocchio haven't use auto-diff a lot. Using CasADi automatic differentiation is not possible #809 is one example.
Another good reason is that it would give a good example of how one can use another auto-diff module. |
I do agree with all these points, but I do not have any great solution for that. Maybe we can think to something like the unsupported directory of Eigen. |
I suggest to first make everything in such a way Pinocchio works fine with Casadi, which requires some works. And to propose a clean way of integrating all AutoDiff frameworks later. It will be easier for me. |
By the way, at least CppAD should be an optional dependency because it is the framework I use to do code generation. |
I believe this is an easy task which can be the responsibility of the user. I don't think this is the responsibility of Pinocchio.
Add a file casadi.hpp anywhere in Pinocchio, with the following properties:
Eventually, it could be a folder with several files. |
Yes, I guess. I will try to do it after fixing all the unit test for the integration of CASADI. |
Thank you for your work ! |
5972120
to
bb7911c
Compare
A stupid question, how can I add my contributions to this pull request (instead of creating another one)? |
You're now a collaborator of the project. You should be able to push on the current PR. @mkatliar Thanks for your contributions. |
FYI, I am currently working on making |
@jcarpent I never did push to a pull request before, so maybe I am doing something wrong here. I added git@github.com:jcarpent/pinocchio.git as a remote, then checked out
What is wrong? |
You did not accept the invitation to join the project that you should have received few hours ago. |
@@ -52,8 +49,8 @@ BOOST_AUTO_TEST_CASE(test_example) | |||
{ | |||
for (Eigen::Index j = 0; j < A.cols(); ++j) | |||
{ | |||
A(i, j) = 10 * i + j; | |||
B(i, j) = -10 * i - j; | |||
A(i, j) = 10. * static_cast<double>(i) + static_cast<double>(j); |
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.
Did you have some compiler warnings here?
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.
Yes
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.
Which compiler are you using?
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.
g++ (Ubuntu 8.3.0-6ubuntu1) 8.3.0
On my system, I get the following output from cmake when trying to build the
But it instead of ADD_REQUIRED_DEPENDENCY("casadi >= 3.4.5") I do find_package(CasADi 3.4.5 REQUIRED)
set(CASADI_FOUND True) then cmake does not complain. I have built casadi from sources and installed in How can we fix this? |
@mkatliar I have a basic question, why do you need to specialize Eigen::LLT, is it because you have some warnings when compiling `pinocchio::aba? |
I have forked |
@jcarpent casadi installs its |
This is expected. Some computations involve the usage of Eigen::LLT. I suggest to specialize these computations according to the Scalar types: if the Scalar type is classic (float, double, long double), then we need to call the classic LLT, otherwise, we have to the inversion (without relying on LLT, and without any comparisons). |
@jcarpent this makes sense to me. Could you then write the specialized code for these computations, since you are much more familiar with the algorithms? I can help you on the casadi side if you need. |
Yes, I will do the specialization of the algorithms. |
A lot of projects (among them Pinocchio) rely on pkg-config for dependency check. I think it would be worthy to add this feature to CASADI, even if, for the time being, we can use the CMake approach. |
@mkatliar I think I'm done with this PR. Everything works well on my computer. Can you try it from your side? |
@mkatliar @jmirabel I've just opened a new PR for checking the integration of Pinocchio inside CASADI. This is still work in progress but I will try to add the different tests that @mkatliar is adding.
Do not hesitate to add your contributions.
Related to #809