{"action":"created","issue":{"url":"https://api.github.com/repos/robotology/wysiwyd/issues/16","labels_url":"https://api.github.com/repos/robotology/wysiwyd/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/robotology/wysiwyd/issues/16/comments","events_url":"https://api.github.com/repos/robotology/wysiwyd/issues/16/events","html_url":"https://github.com/robotology/wysiwyd/issues/16","id":72125083,"number":16,"title":"[iol2opc] Several issues in the communication with the OPC","user":{"login":"Tobias-Fischer","id":5497832,"avatar_url":"https://avatars.githubusercontent.com/u/5497832?v=3","gravatar_id":"","url":"https://api.github.com/users/Tobias-Fischer","html_url":"https://github.com/Tobias-Fischer","followers_url":"https://api.github.com/users/Tobias-Fischer/followers","following_url":"https://api.github.com/users/Tobias-Fischer/following{/other_user}","gists_url":"https://api.github.com/users/Tobias-Fischer/gists{/gist_id}","starred_url":"https://api.github.com/users/Tobias-Fischer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tobias-Fischer/subscriptions","organizations_url":"https://api.github.com/users/Tobias-Fischer/orgs","repos_url":"https://api.github.com/users/Tobias-Fischer/repos","events_url":"https://api.github.com/users/Tobias-Fischer/events{/privacy}","received_events_url":"https://api.github.com/users/Tobias-Fischer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/robotology/wysiwyd/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/robotology/wysiwyd/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-30T10:40:08Z","updated_at":"2015-04-30T17:49:49Z","closed_at":null,"body":"Hi,\r\nthere is an issue with iol2opc. Thus far, adding objects in the OPC works nicely. However, if an object gets out of the scene, `m_present` is still set to `true`. We therefore need to find a way to\r\na) detect once an object is removed from the scene\r\nb) find this object in the OPC and set `m_present=false`\r\n\r\nThe issue is that we don't keep track which objects are added to the OPC. I think we need to create a list with known objects, and keep this list up to date. What do you think, @pattacini?\r\n\r\nBest,\r\nTobias"},"comment":{"url":"https://api.github.com/repos/robotology/wysiwyd/issues/comments/97896541","html_url":"https://github.com/robotology/wysiwyd/issues/16#issuecomment-97896541","issue_url":"https://api.github.com/repos/robotology/wysiwyd/issues/16","id":97896541,"user":{"login":"pattacini","id":3738070,"avatar_url":"https://avatars.githubusercontent.com/u/3738070?v=3","gravatar_id":"","url":"https://api.github.com/users/pattacini","html_url":"https://github.com/pattacini","followers_url":"https://api.github.com/users/pattacini/followers","following_url":"https://api.github.com/users/pattacini/following{/other_user}","gists_url":"https://api.github.com/users/pattacini/gists{/gist_id}","starred_url":"https://api.github.com/users/pattacini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pattacini/subscriptions","organizations_url":"https://api.github.com/users/pattacini/orgs","repos_url":"https://api.github.com/users/pattacini/repos","events_url":"https://api.github.com/users/pattacini/events{/privacy}","received_events_url":"https://api.github.com/users/pattacini/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T17:49:49Z","updated_at":"2015-04-30T17:49:49Z","body":"The way I'd go for is the following:\r\n\r\n1. Upon connection between 'iol2opc' and 'himrepClassifier', we ask for the list of currently known classes by means of the \"`list`\" rpc command (I've just added it up). This way, we can build the internal database we have to maintain later on.\r\nWe can attach a callback to the connection event by relying on the `PortMonitor` class. Be careful: don't do any access to the port within the callback, but just schedule to do the processing on a different thread (e.g. in the `updateModule()`).\r\n\r\n2. At run-time we can recognize objects available in the scene and thus tick them off the list we have built. All the remaining objects need then to be handled such that their `m_present` attribute is disabled in `OPC`. To this end, I'd filter out some fluctuations by disabling only objects that are persistently unavailable for more than 1 second.\r\n\r\nFor the last issue, I'd point you at how the original [`findName()`](https://github.com/robotology/iol/blob/master/src/iolStateMachineHandler/src/classifierHandling.cpp#L310) function was coded."}}