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

[fbeV1] simple floating base estimation algorithm #1

Merged
merged 5 commits into from
Jul 3, 2019

Conversation

prashanthr05
Copy link
Contributor

TODO: to organize the repository structure in a way that the implementation of this version of base estimator is separately accessible and coherent with the other whole-body-estimators to be implemented in the future.

Also need to take into account the current refactoring phase of the estimator-framework.

Copy link
Member

@traversaro traversaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments.

################################################################################
# #
# Copyright (C) 2018 Fondazione Istituto Italiano di Tecnologia (IIT) #
# All Rights Reserved. #
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the usual license LGPL2+ , see https://github.com/robotology/blockfactory for an example of nice C++ license headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 714c6cc

#include <iDynTree/KinDynComputations.h>
#include <iDynTree/ModelIO/ModelLoader.h>
#include <iDynTree/yarp/YARPConversions.h>
#include <iDynTree/Core//EigenHelpers.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#include <iDynTree/Core//EigenHelpers.h>
#include <iDynTree/Core/EigenHelpers.h>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 714c6cc

namespace dev {


class icubFloatingBaseEstimatorV1 : public yarp::dev::DeviceDriver,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if we could avoid explicit reference to iCub in the device name, in the end even if there are a few icub-ism I think it is quite a general legged robot estimator, so a more general name could come handy for the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 714c6cc

CMakeLists.txt Outdated
target_link_libraries(icubFloatingBaseEstimatorV1 ${YARP_LIBRARIES}
${iDynTree_LIBRARIES}
floatingBaseEstimationRPC-service
${codyco-modules_LIBRARIES})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which libraries are you using from codyco-modules? The idea was to move all the useful devices from codyco-modules here, so it would be great if we could avoid adding this dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 714c6cc

@traversaro
Copy link
Member

Note that to mark draft PR, instead of marking them as WIP you can use draft PR, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ .

@traversaro
Copy link
Member

I am fine in copy&pasting the code from walking-controllers if it is to proceed forward fast, but it would be great if we have a strategy (i.e. moving this utilities somewhere else) to avoid this duplication.

@DanielePucci
Copy link
Collaborator

@prashanthr05 @traversaro
We may discuss this today F2F

@prashanthr05
Copy link
Contributor Author

With @traversaro, we agreed that this repository should be a common-place for any estimator software developments like base-estimator (v1, v2, etc), wholebodydynamics device...

  • We discussed f2f a proper repository structure to have devices like base-estimator-v1, wholebodydynamics separate but also room for any common libraries that might be used.

  • Also, at the moment it should be noted that some libraries used by the estimator device are also used by walking-controllers.

    • The actual solution would be to have a common repository for these library factors.
    • The temporary solution would be to not have same library names for the factors present in both walking-controllers and whole-body-estimators in order to avoid any shared library conflicts.

I shall remodify the repository structure as desired.

  • Meanwhile in another PR, I will work on porting the wholebodydynamics to this repository from codyco-modules and avoid any dependencies on codyco-modules from this repository.

cc @DanielePucci

@prashanthr05 prashanthr05 changed the title [WIP] [fbeV1] simple floating base estimation algorithm [fbeV1] simple floating base estimation algorithm Jun 13, 2019
@prashanthr05
Copy link
Contributor Author

cc @traversaro I think this PR is ready for review.

@@ -0,0 +1,81 @@
<!--
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you don't need this file because on the real platform wholebodydynamics runs independently from the base estimation device

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 82d978f

CMakeLists.txt Outdated
find_package(YARP REQUIRED)
if(${YARP_VERSION} VERSION_LESS ${YARP_REQUIRED_VERSION})
message(FATAL_ERROR "YARP version ${YARP_VERSION} not sufficient, at least version ${YARP_REQUIRED_VERSION} is required.")
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand, why don't you simply write:

find_package(YARP 3.0.1 REQUIRED)

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Mindless ctrl+c ctrl+v.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 82d978f

README.md Outdated
Notice: `sudo` is not necessary if you specify the `CMAKE_INSTALL_PREFIX`. In this case it is necessary to add in the `.bashrc` or `.bash_profile` the following lines:
``` sh
export WBDEstimator_INSTALL_DIR=/path/where/you/installed
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${WBDEstimator_INSTALL_DIR}/lib/yarp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future perhaps we can remove the need for this line by adding rpath handling.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think RPATH handling is already done in the CMakeLists. It's just that I didn't fully understand the implications of RPATH.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to understand,
does adding

add_install_rpath_support(BIN_DIRS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
                          LIB_DIRS "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
                          INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}"
                          DEPENDS ENABLE_RPATH
                          USE_LINK_PATH)

in your CMakeLists.txt add the generated dynamic libraries to the LD_LIBRARY_PATH automatically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright the documentation in add_install_rpath_support details this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 82d978f

endif()
add_custom_target(${_uninstall} COMMAND "${CMAKE_COMMAND}" -P "${_filename}")
set_property(TARGET ${_uninstall} PROPERTY FOLDER "CMakePredefinedTargets")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For AddUninstallTarget and AddInstallRPATHSupport, can you get the latest versions from https://github.com/robotology/ycm/tree/master/modules ? A few problems have been fixed recently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 82d978f

find_package(iDynTree REQUIRED)
if(${iDynTree_VERSION} VERSION_LESS ${iDynTree_REQUIRED_VERSION})
message(FATAL_ERROR "iDyntree version ${iDynTree_VERSION} not sufficient, at least version ${iDynTree_REQUIRED_VERSION} is required.")
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As before, why not simply find_package(iDynTree 0.11 REQUIRED)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 82d978f


set(iDynTree_REQUIRED_VERSION 0.11.0)

set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 82d978f

@traversaro
Copy link
Member

Sorry for the delay!

@prashanthr05
Copy link
Contributor Author

@traversaro Thanks Silvio!

@GiulioRomualdi is currently testing this device with torque-walking, if he gives a thumbs up with the tests, then we can merge it to devel and master.

@GiulioRomualdi
Copy link
Member

Tested in simulation, it works as expected.

@GiulioRomualdi
Copy link
Member

I don't know if it is a bug or something wanted but every time I run the code the device returns the following warnings

[DEBUG]Reading file /home/gromualdi/robot-code/robotology-superbuild/build/install/share/yarp/robots/iCubGazeboV2_5/launch-fbe-analogsens.xml 
[WARNING]Invalid syntax while loading /home/gromualdi/robot-code/robotology-superbuild/build/install/share/yarp/robots/iCubGazeboV2_5/launch-fbe-analogsens.xml at line 1 . No DTD found. Assuming version yarprobotinterfaceV1.0 
[DEBUG]yarprobotinterface: using xml parser for DTD v1.x 
[DEBUG]Reading file /home/gromualdi/robot-code/robotology-superbuild/build/install/share/yarp/robots/iCubGazeboV2_5/launch-fbe-analogsens.xml 
[WARNING]Invalid syntax while loading /home/gromualdi/robot-code/robotology-superbuild/build/install/share/yarp/robots/iCubGazeboV2_5/launch-fbe-analogsens.xml at line 9 . "robot" element should contain the "portprefix" attribute. Using "name" attribute 

@prashanthr05
Copy link
Contributor Author

prashanthr05 commented Jul 1, 2019

I don't know if it is a bug or something wanted but every time I run the code the device returns the following warnings

[DEBUG]Reading file /home/gromualdi/robot-code/robotology-superbuild/build/install/share/yarp/robots/iCubGazeboV2_5/launch-fbe-analogsens.xml 
[WARNING]Invalid syntax while loading /home/gromualdi/robot-code/robotology-superbuild/build/install/share/yarp/robots/iCubGazeboV2_5/launch-fbe-analogsens.xml at line 1 . No DTD found. Assuming version yarprobotinterfaceV1.0 
[DEBUG]yarprobotinterface: using xml parser for DTD v1.x 
[DEBUG]Reading file /home/gromualdi/robot-code/robotology-superbuild/build/install/share/yarp/robots/iCubGazeboV2_5/launch-fbe-analogsens.xml 
[WARNING]Invalid syntax while loading /home/gromualdi/robot-code/robotology-superbuild/build/install/share/yarp/robots/iCubGazeboV2_5/launch-fbe-analogsens.xml at line 9 . "robot" element should contain the "portprefix" attribute. Using "name" attribute 

This bug is because the latest YARP requires the DTD version to be 3.0x. And also few of the soft requirements of the yarprobotinreface xml syntax are being violated.

I will fix it in a commit and push, then we can merge.

@prashanthr05
Copy link
Contributor Author

@traversaro you could merge it now, thanks!

@traversaro
Copy link
Member

You are the mantainer, so feel free to merge it!

@prashanthr05 prashanthr05 merged commit eb39eb2 into robotology:devel Jul 3, 2019
@prashanthr05
Copy link
Contributor Author

@traversaro @GiulioRomualdi Merged, thank you guys!

@prashanthr05 prashanthr05 deleted the simple-base-estimator branch July 3, 2019 15:10
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.

None yet

4 participants