-
Notifications
You must be signed in to change notification settings - Fork 70
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
Update matlab bindings adding inverse-kinematics #633
Update matlab bindings adding inverse-kinematics #633
Conversation
Let's target |
Can you also update the Changelog at https://github.com/robotology/idyntree/blob/devel/CHANGELOG.md ? Thanks! |
Sorry, by mistake I committed also the change in #631, I'll clean it up |
0645894
to
ea370f3
Compare
Fixed
Target changed to
Done d7e2035 |
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
|||
## [1.0.1] - 2020-01-14 | |||
|
|||
### Added | |||
- Added `bindings` for `InverseKinematics` (https://github.com/robotology/idyntree/pull/633) | |||
|
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.
Sorry, probably editing the ChangeLog is still confusing. The release 1.0.1 has been already done, so this change will go in a currently unreleased
version, so it should be added in the ## [Unreleased]
section, see https://keepachangelog.com/en/1.0.0/ for more details.
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.
ah ok! Yes, actually in fact I was a bit confused and I was not sure about the position
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.
It is now moved under Unreleased
d7e2035
to
c297d56
Compare
I just realized that unfortunately we can't merge the PR in its current form, sorry. The main problem is that as it is now, we are breaking the following configuration (that is used, especially in Windows, in some repos, even if it is not tested by iDynTree's repo CI):
This is due to the fact that we commit the generated source code with the modified SWIG that supports matlab.
In the case of InverseKinematics, I think the easiest option is to prepare a dummy InverseKinematics.cpp to compile when Ipopt is not available https://github.com/robotology/idyntree/blob/v1.0.1/src/inverse-kinematics/src/InverseKinematics.cpp , that in place of all the methods just prints an error that explains that |
@traversaro |
Yes, otherwise you would get a linking error. |
With 0657826 I have implemented the dummy methods. However I was thinking that a possible cleaner solutions could be:
|
|
||
if (IDYNTREE_USES_IPOPT) | ||
set(IDYNTREE_BUILD_IK TRUE) | ||
add_subdirectory(inverse-kinematics) | ||
endif() | ||
|
||
if (IDYNTREE_COMPILES_OPTIMALCONTROL) |
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.
IDYNTREE_USES_OPTIMALCONTROL instead ?
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 think currently the way the option are used is: IDYNTREE_USES_{dependency_name}
(e.g. for IDYNTREE_USES_YARP
or IDYNTREE_USES_IPOPT
), and IDYNTREE_COMPILES_{IDynTree component}
(e.g. IDYNTREE_COMPILES_TESTS
). So in this case I would say IDYNTREE_COMPILES_OPTIMALCONTROL
is coherent with the rest of the code, even we might want to change and use always USE
.
Anyway, this part did not change within this PR, so eventually the discussion might be moved elsewhere.
Yes, this make sense, thanks! |
@@ -37,6 +37,7 @@ target_include_directories(${libraryname} SYSTEM PRIVATE ${EIGEN3_INCLUDE_DIR}) | |||
target_link_libraries(${libraryname} idyntree-core idyntree-high-level ${IPOPT_LIBRARIES}) | |||
|
|||
target_compile_definitions(${libraryname} PRIVATE ${IPOPT_DEFINITIONS}) | |||
target_compile_definitions(${libraryname} PRIVATE IDYNTREE_USES_IPOPT) |
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 you can see from the GitHub Actions failures, you need to also modify the CMakeLists.txt of this library to link IPOPT, pass the IDYNTREE_USES_IPOPT
definition, add the private sources that depend on IPOPT only if IDYNTREE_USES_IPOPT
is set to FALSE, similarly to what is done for assimp in the solid-shapes lib, see https://github.com/robotology/idyntree/blob/v1.0.1/src/solid-shapes/CMakeLists.txt . Note that as we require CMake 3.5 now, if necessary you can also use target_sources
command, see https://github.com/robotology/idyntree/blob/v1.0.1/src/solid-shapes/CMakeLists.txt .
See GitHub Actions failures and #633 (comment) . |
it should be fixed in ee3d335. |
|
||
add_library(${libraryname} ${IDYN_TREE_IK_HEADERS} ${IDYN_TREE_IK_SOURCES} | ||
${PRIVATE_IDYN_TREE_IK_SOURCES} ${PRIVATE_IDYN_TREE_IK_HEADERS}) | ||
if(IDYNTREE_USES_IPOPT) |
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 had this if
since those classes are not compiled in the dummy class.
@traversaro please check if it looks sound for you or if you think there is a better way to handle it.
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.
Using target_sources
you can avoid to duplicate the add_library
call, in any case what you did is ok, thanks!
Some tests, apparently not related to inverse-kinematics, are failing |
Yes, those are probably not related to the PR and caused by robotology/yarp#2189 . |
Failures are not related to PR, but it seems to be related to robotology/yarp#2189 . |
Can you rebase all the commits except ea370f3 or in genear clean the history? After that, the change can be merged. |
e0a1166
to
f16f240
Compare
f16f240
to
ade4b8f
Compare
Done |
Thanks! |
With this PR bindings for
inverse-kinematics
are generated.The commit has been done accordingly to the guidelines.
@traversaro is it ok to target
master
with the updated bindings or shoulddevel
be targeted instead?