-
Notifications
You must be signed in to change notification settings - Fork 38
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
Adding skeleton for planners #43
Conversation
Removing findEigen3. Setting iDynTree as required as everything depends on it. Linking only the iDynTree core target. The option IS_INTERFACE does not need the ON afterwards.
Testing that GenericVector supports also a vector of iDynTree::Transforms.
I just noticed that the Edit: I guess that being the test compiled with |
That is intentional, even if probably documentation is lacking on the iDynTree side. EigenHelpers is an header only, and it was always meant to be a private header. At some point someone asked me to install it, and I was ok with it with the pact that iDynTree was not handling the CMake part of finding Eigen3, even because the idea was that a project was using EigenHelpers , it was already finding Eigen3 on its own. I think that in general this is a nice pattern (I wanted to move also the YARP and iCub conversions function to it, eventually) but documentation is indeed lacking. If for now you could just link or find Eigen3 explicitly in RecursiveLeastSquareTest that would be great. |
It also change temporarily the module path in order to find packages that may not be available with find_package. See robotology/idyntree#642 (comment)
No problem for the documentation, I actually mainly tried to understand from the CMake code 😁 I have added the dependency in 2ad6611. In 690cb30 I added the dependencies in the config file. I also modified the project(testBipedalLocomotion CXX)
cmake_minimum_required(VERSION 3.5)
find_package(BipedalLocomotionFramework)
add_executable(test main.cpp)
target_link_libraries(test BipedalLocomotion::Framework) works nicely. (I tried adding |
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.
LGTM
Thanks @GiulioRomualdi, if you agree I will merge! |
CMakeLists.txt
Outdated
if (FRAMEWORK_HAS_YARP) | ||
list(APPEND FRAMEWORK_PUBLIC_DEPENDENCIES YARP) | ||
endif() | ||
|
||
if (FRAMEWORK_HAS_Eigen3) | ||
list(APPEND FRAMEWORK_PRIVATE_DEPENDENCIES Eigen3) | ||
endif() |
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.
Actually this would be a bit more robust if it depends on YARP only if the components that depends in a public way are enabled, not only if YARP or Eigen3 is found in the system.
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.
Actually if you do not use Eigen3 as an inclusion in the public headers, I don't think it make sense to have it as a private dependency as it is an header-only dependency.
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.
Actually this would be a bit more robust if it depends on YARP only if the components that depends in a public way are enabled
I thought about that at the beginning, but then I did not find any way to automatize this check. In principle, I would need to determine a set of dependencies depending on the compiled targets. Initially, I thought of adding an entry in the add_bipedal_library
function (something like DEPENDENCIES YARP iDynTree
), but this would be a sort of duplicate of the targets to link and it is error-prone since it does not throw any error if you miss some of them.
The other option was to change the if condition to check directly if some of the components having YARP as dependency are enabled (like what you suggest). But then, every time we add a new component we would need to change also those if
, with a high likelihood of forgetting one from time to time. Hence, I thought that the safest and easiest option was to propagate all the dependencies that were already found in the system.
Actually if you do not use Eigen3 as an inclusion in the public headers, I don't think it make sense to have it as a private dependency as it is an header-only dependency.
Even if we compile statically?
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 other option was to change the if condition to check directly if some of the components having YARP as dependency are enabled (like what you suggest). But then, every time we add a new component we would need to change also those if, with a high likelihood of forgetting one from time to time. Hence, I thought that the safest and easiest option was to propagate all the dependencies that were already found in the system.
That make sense, but can we use FRAMEWORK_USE_YARP
instead of FRAMEWORK_HAS_YARP
? So a user can explicitly disable it.
Actually if you do not use Eigen3 as an inclusion in the public headers, I don't think it make sense to have it as a private dependency as it is an header-only dependency.
Even if we compile statically?
An header only library is only used at compile time, and not at the linking time, so you safely link a static library that used internally Eigen3 completely ignoring the fact that Eigen3 has been used.
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.
An header only library is only used at compile time, and not at the linking time, so you safely link a static library that used internally Eigen3 completely ignoring the fact that Eigen3 has been used.
It makes sense, I will remove it, thanks!
That make sense, but can we use FRAMEWORK_USE_YARP instead of FRAMEWORK_HAS_YARP? So a user can explicitly disable it.
Deal! Should I use the same flag also here in the following lines? https://github.com/dic-iit/bipedal-locomotion-framework/blob/690cb30180554b5f8c83c40a18ffadd3573d9488/cmake/BipedalLocomotionFrameworkFindDependencies.cmake#L131-L141
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 USE
and removed Eigen
as a private dependency (in the config file) in 30e2f06
If you agree, I'll merge. |
You can merge |
This PR is the first with the aim of adding planners to the
bipedal-locomotion-framework
.While doing this, I spotted a few issues in the CMake configurations:
IS_INTERFACE
does not need anything afterward (see the example in https://cmake.org/cmake/help/latest/command/cmake_parse_arguments.html)FindEigen3.cmake
should not be necessary anymore as the supported OSs already ship a decent version of this file.iDynTree
is a strong dependency right now. Basically all the targets depend on it, either directly or indirectly (viaGenericContainer
for example).${iDynTree_LIBRARIES}
, linking only the needed target, in this caseiDynTree::idyntree-core
. This opened for a new issue:Estimators
was depending on Eigen, but this dependency was not correctly handled. Some target in${iDynTree_LIBRARIES}
is including it publicly, so this issue did not appear before. Hence,Eigen
dependency in theadd_bipedal_locomotion_library
functionEstimators
part.In addition, I wanted to rename
vector_data
tocontainer_data
. Initially, I was planning to add a new container and the meta-functionvector_data
was coming in handy. Hence, I changed its name. The attempt of adding the new container failed, but I liked the new name, so I left it there 😁.The actual purpose of this PR is then to add two header files:
Contact.h
Advanceable.h