robotology / human-sensing

This repository contains software related to human sensing
GNU General Public License v2.0
13 stars 18 forks source link

iCub dependencies #5

Closed BrutusTT closed 8 years ago

BrutusTT commented 8 years ago

Hi,

the human-sensing modul is quite nice and does a good job at recognizing faces and gazeing direction. It would be really useful also in other contexts in which no iCub is involved. But the tide coupling to the gaze controller client and therefore to the iKinGazeCtrl module prevents from using this package without an iCub robot.

I had a brief look into the sources and it appears to me that there are only 3 calls using the gazecontrolclient.

Therefore the question is: Would it be easy to replace these 3 calls using ports instead of the gazecontrolclient? Is there a way to "simulate" a iKinGazeCtrl in case its not present?

pattacini commented 8 years ago

Hi @BrutusTT

Using ports in lieu of the gaze interface is anti-pattern, so I warmly suggest not to pursue this road.

Instead, what the developer in charge could do is pretty much simple: foresee a command line parameter to enable/disable the internal use of the gaze interface (with default value set to on).

alecive commented 8 years ago

Ideally, the perception part should be decoupled (or decouple-able) from the control part, since the tracker should work independently. @BrutusTT feel free to create a pull request on this :)

pattacini commented 8 years ago

Yes, ideally... but then, @alecive, how will the control module look like? Just three lines of codes? It's a matter of trade-off :smile:

alecive commented 8 years ago

This is why I said decouple-able :stuck_out_tongue:

BrutusTT commented 8 years ago

Hi,

I will have a look into it.

But just for the sake of better understanding on my side. Why is decoupling and using ports an anti-pattern? As far as I understand the yarp module architecture its about decoupled components that are communicating through messages. By binding it to a specific interface that most of the time is only being used to internally communicate to iKinGazeCtrl ports itself, its just creating a hard dependency making modules hard to be used with non-iCub robots and introducing a second paradigm of communication (using fixed API instead of ports).

I'm currently working with a different robot for which a video stream is available and has a module that is inline with iKinGazeCtrl messaging but doesn't use iKinGazeCtrl.

What would be the suggested way to deal with this kind of setup?

pattacini commented 8 years ago

Hi @BrutusTT

Ideally, your control module should be wrapped using the gaze interface (maybe implementing only a subset of services that are meaningful to you). This way, human-sensing will remain unchanged, relying on the same client part. You'll only need to specify which server it has to connect to: either iKinGazeCtrl or your controller.

Motor interfaces provide a further abstraction level and thus are definitely preferable over direct port communication:

Finally, you could consider following @alecive's suggestion, going toward a bit deeper level of granularity by splitting perception from control: two completely different modules. My objections are:

pattacini commented 8 years ago

Closing for now, feel free to reopen it.