HebiRobotics / hebi-matlab-api

Public download and issue tracker of the latest HEBI API for MATLAB
http://docs.hebi.us/tools.html#matlab-api
0 stars 0 forks source link

Groups are created with multiple modules if they have the same name. #22

Closed daverolli closed 5 years ago

daverolli commented 5 years ago

When you do HebiLookup.newGroupFromNames(), if there are multiple modules with the same family|name, a group is created with all of those modules. I would expect behavior to probably throw and error saying that there were multiple modules found. Behavior of the other APIs is to just use the first module that's found, which also isn't ideal, but is closer to expected behavior, and the debugging process brings you Scope / network debugging earlier. If using a wild-card then multiple modules would be allowed.

This comes up a lot with the Mobile IO group creation if multiple people are on the same network with the default family|name. We're partially fixing this by changing all the demos to require the user to change the family of the phone/iPad, so this low-ish priority for now.

ennerf commented 5 years ago

The MATLAB API used to select the first module, but we changed it after a discussion regarding wild-cards in individual names. If I understand correctly, the behavior you're suggesting is as follows:

Assuming there are 2 modules on the network named HEBI | IO Board

rLinks234 commented 5 years ago

From the initial discussion I overheard, Dave encountered an issue with the first example you provided @ennerf (i.e., no wildcard patterns)

ennerf commented 5 years ago

I listed my understanding of the desired behavior. The current behavior would be that it always creates a group with multiple modules.

I assume that a wildcard in the family should be separate from a wildcard in the name?

what should happen if there are two modules on the network called

and a group is created using newGroupFromNames('*', 'IO Board') ?

rLinks234 commented 5 years ago

No, what I mean happened that Dave tried to create a group like

newGroupFromNames('HEBI', 'Mobile IO') (no wildcard) and he got a group with 2 modules - since we had 2 modules on the network with that name and family. I don't think there was any errors thrown, until he was trying to manipulate feedback received from the group and realized the dimensions weren't what he expected (i.e. 2 elements as opposed to 1)

ennerf commented 5 years ago

I understand what happened and why it is an issue. So what should the future behavior be?

Would everyone be happy if I implemented the behavior that I described above?

daverolli commented 5 years ago

Yup. Behavior above is exactly right.

ennerf commented 5 years ago

Fixed in latest snapshot