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

Initial refactoring of human-dynamics-estimation #243

Closed
3 of 4 tasks
lrapetti opened this issue Apr 20, 2021 · 6 comments
Closed
3 of 4 tasks

Initial refactoring of human-dynamics-estimation #243

lrapetti opened this issue Apr 20, 2021 · 6 comments
Assignees
Labels

Comments

@lrapetti
Copy link
Member

lrapetti commented Apr 20, 2021

As discussed, we are planning a refactoring of the code contained in human-dynamics estimation. Initially, the code contained in this repo was meant to be a collection of YARP applications able to interface sensors data (in wearables format) with iDynTree algorithms. With time, however, some algorithms were progressively implemented directly in the devices. The main objective is to progressively move from a collection of applications to a library+applications. This change would lead to some improvements:

  • improved readability
  • possibility to reuse the code in different contexts
  • possibility to test the code out of the wearables+yarp online environment

In order to do so, some initial steps have been detected:

  • move the InverseVelocityKinematics and stateIntegrator in a separate library
  • move the other algorithms contained in HumanStateProvider (and other blocks) into a separate library Move algorithms from HumanStateProvider to HDE library #247
  • move the Berdy algorithm inside this repo
  • move from the interfaces to stand-alone objects that can be configured offline. (@diegoferigo maybe you can help with the definition of this task)

An MVP for this activity might be the possibility to run kinematics and dynamics estimation offline in a single C++ module.

@lrapetti lrapetti added this to the AnDy - Iteration 61 milestone Apr 20, 2021
@lrapetti
Copy link
Member Author

@Yeshasvitvs @kouroshD @diegoferigo @traversaro @S-Dafarra @prashanthr05 @GiulioRomualdi @DanielePucci @evalli-iit @claudia-lat please feel free to add any point I missed from the internal discussion, or any additional thought you had since.

@lrapetti lrapetti added the Epic label Apr 20, 2021
@diegoferigo
Copy link
Member

move from the interfaces to stand-alone objects that can be configured offline. (@diegoferigo maybe you can help with the definition of this task)

In my opinion things could be done in steps. Here below a proposal.

A. Standalone hde library with algorithm

  1. Create a new hde/ folder containing the files and (public) headers for the IK and Berdy. What do you think of using the hde:: namespace?
  2. Move the code from the devices to the library
  3. Optional: create bindings with pybind11 so that both Python and Matlab are supported

This would already be a great start. It does not touch the high-level architecture of hde but it would provide the desired refactoring.

B. Allow programmatic usage of devices

⚠️ This step might need more brainstorming and prototyping ⚠️

Currently, the devices are loaded by yarprobotinterface and quite complex configuration files are read. Something that is not 100% clear to me (I forgot with time and I should give a new careful look to the code) is whether all devices read from yarp ports or they always rely on interfaces that are attached. Can we do a list of devices that you'd like to call programmatically, and check their internal implementation?

If no yarp ports are involved, maybe a first tentative I'd try is to exploit what @traversaro kindly implemented last summer robotology/yarp#2319, it seems a great match for the first prototype. It allows to operate programmatically on the devices without altering a single line or code. Bonus point, also the configuration files would be compatible with this approach.

Then, moving on, devices could be updated to simplify even further their usage, and maybe removing yarp from our feet in the public APIs.

Any comments / ideas?

@diegoferigo
Copy link
Member

Thinking more about phase B above, if the desiderata is the following,

  • possibility to test the code out of the wearables+yarp online environment
    [...]
    An MVP for this activity might be the possibility to run kinematics and dynamics estimation offline in a single C++ module.

YARP should not be involved in any of the new libraries, not even privately. This means that, after stage A, some new high-level classes that provide all the functionality needed by the devices may be necessary. In this way, the online pipeline does not have to change. I think it's worth at first defining exactly what you want to achieve offline, and then decide the best phase B for the selected goals.

@lrapetti
Copy link
Member Author

Hi @diegoferigo sorry for taking some times to answer.

I think we are aligned on starting addressing the point A you proposed in the comment above.

In line with this, I have added an additional first point to the list due to some requirements we are currently having (@prashanthr05 @Yeshasvitvs) and that will be soon addressed:

  • move the InverseVelocityKinematics and stateIntegrator in a separate library

Concerning the phase B, I think that can be further discussed after the phase A is achieved. In particular concerning what you commented above:

If no yarp ports are involved, maybe a first tentative I'd try is to exploit what @traversaro kindly implemented last summer robotology/yarp#2319, it seems a great match for the first prototype. It allows to operate programmatically on the devices without altering a single line or code. Bonus point, also the configuration files would be compatible with this approach.

I think that might be a parallel task, but somehow independent from the final objective of having the main functionalities exposed as a library, and independent from yarp.

@lrapetti
Copy link
Member Author

We remove the activity on python bindings creation from this epic since it is left in icebox and close it

@lrapetti
Copy link
Member Author

  • move from the interfaces to stand-alone objects that can be configured offline. (@diegoferigo maybe you can help with the definition of this task)

This activity is still not clear so we have removed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants