{"action":"created","comment":{"url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/comments/211492071","pull_request_review_id":147729365,"id":211492071,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTQ5MjA3MQ==","diff_hunk":"@@ -0,0 +1,76 @@\n+/*\n+ * Copyright (C) 2013-2015 Fondazione Istituto Italiano di Tecnologia RBCS & iCub Facility & ADVR\n+ * Authors: see AUTHORS file.\n+ * CopyPolicy: Released under the terms of the LGPLv2.1 or any later version, see LGPL.TXT or LGPL3.TXT\n+ */\n+\n+#include <linkattacherinterface.h>\n+\n+using namespace gazebo;\n+using namespace std;\n+using namespace yarp::os;\n+\n+LinkAttacherInterface::LinkAttacherInterface() : ModelPlugin(), m_network(0), m_rpcport(0)\n+{\n+}\n+\n+LinkAttacherInterface::~LinkAttacherInterface()\n+{\n+  if(m_rpcport)\n+  {\n+    m_rpcport->close();\n+    delete m_rpcport;\n+  }\n+\n+  if(m_network)\n+    delete m_network;\n+}\n+\n+void LinkAttacherInterface::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)\n+{\n+  if(m_network!=0)\n+    return;\n+\n+  m_network = new yarp::os::Network();\n+\n+  if(!yarp::os::Network::checkNetwork(GazeboYarpPlugins::yarpNetworkInitializationTimeout))\n+  {\n+    yError() << LogPrefix << \"Load: yarp network does not seem to be available, is the yarpserver running?\";\n+    return;\n+  }\n+\n+  std::string model_name = _model->GetName();\n+\n+  yInfo() << LogPrefix << \"Load: Model name: \" << model_name;\n+\n+  m_la_server.attachWorldPointer(_model->GetWorld());\n+  m_la_server.attachModelPointer(_model);\n+\n+  bool configuration_loaded = false;\n+\n+  if( _sdf->HasElement(\"yarpConfigurationFile\") )\n+  {\n+    std::string ini_file_name = _sdf->Get<std::string>(\"yarpConfigurationFile\");\n+    std::string ini_file_path = gazebo::common::SystemPaths::Instance()->FindFileURI(ini_file_name);\n+\n+    if(ini_file_path != \"\" && m_parameters.fromConfigFile(ini_file_path.c_str()))\n+    {\n+      yInfo() << LogPrefix << \"Load: Found yarpConfigurationFile: loading from \" << ini_file_path;\n+      configuration_loaded = true;\n+    }\n+\n+    if(!configuration_loaded)\n+    {\n+      yError() << LogPrefix << \"Load: Failed to load the configuration file\";\n+      return;\n+    }\n+\n+    std::string portname = m_parameters.find(\"name\").asString();","path":"plugins/linkattacher/src/linkattacherinterface.cpp","position":68,"original_position":68,"commit_id":"388ec581252025117c01f39bdc1f5751bc1b0706","original_commit_id":"388ec581252025117c01f39bdc1f5751bc1b0706","user":{"login":"diegoferigo","id":469199,"node_id":"MDQ6VXNlcjQ2OTE5OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/469199?v=4","gravatar_id":"","url":"https://api.github.com/users/diegoferigo","html_url":"https://github.com/diegoferigo","followers_url":"https://api.github.com/users/diegoferigo/followers","following_url":"https://api.github.com/users/diegoferigo/following{/other_user}","gists_url":"https://api.github.com/users/diegoferigo/gists{/gist_id}","starred_url":"https://api.github.com/users/diegoferigo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegoferigo/subscriptions","organizations_url":"https://api.github.com/users/diegoferigo/orgs","repos_url":"https://api.github.com/users/diegoferigo/repos","events_url":"https://api.github.com/users/diegoferigo/events{/privacy}","received_events_url":"https://api.github.com/users/diegoferigo/received_events","type":"User","site_admin":false},"body":"What if `\"name\"` is not present? You should check that it is contained in the `m_parameters` object before accessing it","created_at":"2018-08-21T06:35:56Z","updated_at":"2018-08-21T06:50:59Z","html_url":"https://github.com/robotology/gazebo-yarp-plugins/pull/380#discussion_r211492071","pull_request_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/380","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/comments/211492071"},"html":{"href":"https://github.com/robotology/gazebo-yarp-plugins/pull/380#discussion_r211492071"},"pull_request":{"href":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/380"}}},"pull_request":{"url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/380","id":209503244,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5NTAzMjQ0","html_url":"https://github.com/robotology/gazebo-yarp-plugins/pull/380","diff_url":"https://github.com/robotology/gazebo-yarp-plugins/pull/380.diff","patch_url":"https://github.com/robotology/gazebo-yarp-plugins/pull/380.patch","issue_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/issues/380","number":380,"state":"open","locked":false,"title":"Feature/LinkAttacher Plugin","user":{"login":"Yeshasvitvs","id":6505998,"node_id":"MDQ6VXNlcjY1MDU5OTg=","avatar_url":"https://avatars2.githubusercontent.com/u/6505998?v=4","gravatar_id":"","url":"https://api.github.com/users/Yeshasvitvs","html_url":"https://github.com/Yeshasvitvs","followers_url":"https://api.github.com/users/Yeshasvitvs/followers","following_url":"https://api.github.com/users/Yeshasvitvs/following{/other_user}","gists_url":"https://api.github.com/users/Yeshasvitvs/gists{/gist_id}","starred_url":"https://api.github.com/users/Yeshasvitvs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yeshasvitvs/subscriptions","organizations_url":"https://api.github.com/users/Yeshasvitvs/orgs","repos_url":"https://api.github.com/users/Yeshasvitvs/repos","events_url":"https://api.github.com/users/Yeshasvitvs/events{/privacy}","received_events_url":"https://api.github.com/users/Yeshasvitvs/received_events","type":"User","site_admin":false},"body":"The LinkAttacher is a gazebo model plugin. It can be used to attach/detach any _link_ of the models spawned in gazebo environment. The attachment is made by adding a _fixed joint_ between the links specified. Additionally, this plugin also provides control over _gravity_ of the models spawned in gazebo environment. Currently, this plugin is used for coupling the hands of the robot model and human model in pHRI experiments. Also, this plugin can be used to attach objects to the robot links.\r\n\r\n@traversaro Please review it","created_at":"2018-08-20T12:21:19Z","updated_at":"2018-08-21T06:50:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3fb39b252484a1ccf49f261ae77d29eb4d337f74","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/380/commits","review_comments_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/380/comments","review_comment_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/issues/380/comments","statuses_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/statuses/388ec581252025117c01f39bdc1f5751bc1b0706","head":{"label":"Yeshasvitvs:feature/linkattacher_plugin","ref":"feature/linkattacher_plugin","sha":"388ec581252025117c01f39bdc1f5751bc1b0706","user":{"login":"Yeshasvitvs","id":6505998,"node_id":"MDQ6VXNlcjY1MDU5OTg=","avatar_url":"https://avatars2.githubusercontent.com/u/6505998?v=4","gravatar_id":"","url":"https://api.github.com/users/Yeshasvitvs","html_url":"https://github.com/Yeshasvitvs","followers_url":"https://api.github.com/users/Yeshasvitvs/followers","following_url":"https://api.github.com/users/Yeshasvitvs/following{/other_user}","gists_url":"https://api.github.com/users/Yeshasvitvs/gists{/gist_id}","starred_url":"https://api.github.com/users/Yeshasvitvs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yeshasvitvs/subscriptions","organizations_url":"https://api.github.com/users/Yeshasvitvs/orgs","repos_url":"https://api.github.com/users/Yeshasvitvs/repos","events_url":"https://api.github.com/users/Yeshasvitvs/events{/privacy}","received_events_url":"https://api.github.com/users/Yeshasvitvs/received_events","type":"User","site_admin":false},"repo":{"id":75280418,"node_id":"MDEwOlJlcG9zaXRvcnk3NTI4MDQxOA==","name":"gazebo-yarp-plugins","full_name":"Yeshasvitvs/gazebo-yarp-plugins","owner":{"login":"Yeshasvitvs","id":6505998,"node_id":"MDQ6VXNlcjY1MDU5OTg=","avatar_url":"https://avatars2.githubusercontent.com/u/6505998?v=4","gravatar_id":"","url":"https://api.github.com/users/Yeshasvitvs","html_url":"https://github.com/Yeshasvitvs","followers_url":"https://api.github.com/users/Yeshasvitvs/followers","following_url":"https://api.github.com/users/Yeshasvitvs/following{/other_user}","gists_url":"https://api.github.com/users/Yeshasvitvs/gists{/gist_id}","starred_url":"https://api.github.com/users/Yeshasvitvs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yeshasvitvs/subscriptions","organizations_url":"https://api.github.com/users/Yeshasvitvs/orgs","repos_url":"https://api.github.com/users/Yeshasvitvs/repos","events_url":"https://api.github.com/users/Yeshasvitvs/events{/privacy}","received_events_url":"https://api.github.com/users/Yeshasvitvs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Yeshasvitvs/gazebo-yarp-plugins","description":"Gazebo plugin to interface GAZEBO with YARP.","fork":true,"url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins","forks_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/forks","keys_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/teams","hooks_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/hooks","issue_events_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/events","assignees_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/tags","blobs_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/languages","stargazers_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/stargazers","contributors_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/contributors","subscribers_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/subscribers","subscription_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/subscription","commits_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/merges","archive_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/downloads","issues_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/labels{/name}","releases_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/Yeshasvitvs/gazebo-yarp-plugins/deployments","created_at":"2016-12-01T10:11:00Z","updated_at":"2016-12-01T10:11:03Z","pushed_at":"2018-08-20T12:19:34Z","git_url":"git://github.com/Yeshasvitvs/gazebo-yarp-plugins.git","ssh_url":"git@github.com:Yeshasvitvs/gazebo-yarp-plugins.git","clone_url":"https://github.com/Yeshasvitvs/gazebo-yarp-plugins.git","svn_url":"https://github.com/Yeshasvitvs/gazebo-yarp-plugins","homepage":null,"size":6950,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"robotology:master","ref":"master","sha":"01ad1d1252b0827033fd57058f066cc790b893c6","user":{"login":"robotology","id":1587191,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1ODcxOTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1587191?v=4","gravatar_id":"","url":"https://api.github.com/users/robotology","html_url":"https://github.com/robotology","followers_url":"https://api.github.com/users/robotology/followers","following_url":"https://api.github.com/users/robotology/following{/other_user}","gists_url":"https://api.github.com/users/robotology/gists{/gist_id}","starred_url":"https://api.github.com/users/robotology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robotology/subscriptions","organizations_url":"https://api.github.com/users/robotology/orgs","repos_url":"https://api.github.com/users/robotology/repos","events_url":"https://api.github.com/users/robotology/events{/privacy}","received_events_url":"https://api.github.com/users/robotology/received_events","type":"Organization","site_admin":false},"repo":{"id":13478387,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ3ODM4Nw==","name":"gazebo-yarp-plugins","full_name":"robotology/gazebo-yarp-plugins","owner":{"login":"robotology","id":1587191,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1ODcxOTE=","avatar_url":"https://avatars2.githubusercontent.com/u/1587191?v=4","gravatar_id":"","url":"https://api.github.com/users/robotology","html_url":"https://github.com/robotology","followers_url":"https://api.github.com/users/robotology/followers","following_url":"https://api.github.com/users/robotology/following{/other_user}","gists_url":"https://api.github.com/users/robotology/gists{/gist_id}","starred_url":"https://api.github.com/users/robotology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robotology/subscriptions","organizations_url":"https://api.github.com/users/robotology/orgs","repos_url":"https://api.github.com/users/robotology/repos","events_url":"https://api.github.com/users/robotology/events{/privacy}","received_events_url":"https://api.github.com/users/robotology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/robotology/gazebo-yarp-plugins","description":"Gazebo plugin to interface GAZEBO with YARP.","fork":false,"url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins","forks_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/forks","keys_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/teams","hooks_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/hooks","issue_events_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/events","assignees_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/tags","blobs_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/languages","stargazers_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/stargazers","contributors_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/contributors","subscribers_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/subscribers","subscription_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/subscription","commits_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/merges","archive_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/downloads","issues_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/labels{/name}","releases_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/deployments","created_at":"2013-10-10T17:42:38Z","updated_at":"2018-07-31T17:25:49Z","pushed_at":"2018-08-20T12:21:20Z","git_url":"git://github.com/robotology/gazebo-yarp-plugins.git","ssh_url":"git@github.com:robotology/gazebo-yarp-plugins.git","clone_url":"https://github.com/robotology/gazebo-yarp-plugins.git","svn_url":"https://github.com/robotology/gazebo-yarp-plugins","homepage":null,"size":5848,"stargazers_count":12,"watchers_count":12,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":52,"license":null,"forks":24,"open_issues":52,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/380"},"html":{"href":"https://github.com/robotology/gazebo-yarp-plugins/pull/380"},"issue":{"href":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/issues/380"},"comments":{"href":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/issues/380/comments"},"review_comments":{"href":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/380/comments"},"review_comment":{"href":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/pulls/380/commits"},"statuses":{"href":"https://api.github.com/repos/robotology/gazebo-yarp-plugins/statuses/388ec581252025117c01f39bdc1f5751bc1b0706"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"diegoferigo"}}