{"action":"created","comment":{"url":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/comments/50741161","id":50741161,"diff_hunk":"@@ -0,0 +1,91 @@\n+/*\n+ * Copyright (c) 2016, Ivor Wanders\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions are met:\n+ *   * Redistributions of source code must retain the above copyright notice,\n+ *     this list of conditions and the following disclaimer.\n+ *   * Redistributions in binary form must reproduce the above copyright\n+ *     notice, this list of conditions and the following disclaimer in the\n+ *     documentation and/or other materials provided with the distribution.\n+ *   * Neither the name of the copyright holder nor the names of its\n+ *     contributors may be used to endorse or promote products derived from\n+ *     this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n+ * POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#include <socketcan_bridge/topic_to_socketcan.h>\n+#include <socketcan_interface/string.h>\n+#include <string>\n+\n+namespace socketcan_bridge\n+{\n+  TopicToSocketCAN::TopicToSocketCAN(ros::NodeHandle* nh, ros::NodeHandle* nh_param,\n+      boost::shared_ptr<can::DriverInterface> driver)\n+    {\n+      can_topic_ = nh->subscribe<can_msgs::Frame>(\"sent_messages\", 10,\n+                    boost::bind(&TopicToSocketCAN::msgCallback, this, _1));\n+      driver_ = driver;\n+    };\n+\n+  int TopicToSocketCAN::setup()\n+    {\n+      state_listener_ = driver_->createStateListener(\n+              can::StateInterface::StateDelegate(this, &TopicToSocketCAN::stateCallback));\n+    };","path":"socketcan_bridge/src/topic_to_socketcan.cpp","position":46,"original_position":46,"commit_id":"a2a2000381867c2a2f88a89d76b9d07665d6c57f","original_commit_id":"a2a2000381867c2a2f88a89d76b9d07665d6c57f","user":{"login":"ipa-mdl","id":727227,"avatar_url":"https://avatars.githubusercontent.com/u/727227?v=3","gravatar_id":"","url":"https://api.github.com/users/ipa-mdl","html_url":"https://github.com/ipa-mdl","followers_url":"https://api.github.com/users/ipa-mdl/followers","following_url":"https://api.github.com/users/ipa-mdl/following{/other_user}","gists_url":"https://api.github.com/users/ipa-mdl/gists{/gist_id}","starred_url":"https://api.github.com/users/ipa-mdl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipa-mdl/subscriptions","organizations_url":"https://api.github.com/users/ipa-mdl/orgs","repos_url":"https://api.github.com/users/ipa-mdl/repos","events_url":"https://api.github.com/users/ipa-mdl/events{/privacy}","received_events_url":"https://api.github.com/users/ipa-mdl/received_events","type":"User","site_admin":false},"body":"return is missing.","created_at":"2016-01-25T19:17:34Z","updated_at":"2016-01-25T19:17:34Z","html_url":"https://github.com/ros-industrial/ros_canopen/pull/157#discussion_r50741161","pull_request_url":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/157","_links":{"self":{"href":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/comments/50741161"},"html":{"href":"https://github.com/ros-industrial/ros_canopen/pull/157#discussion_r50741161"},"pull_request":{"href":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/157"}}},"pull_request":{"url":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/157","id":56973999,"html_url":"https://github.com/ros-industrial/ros_canopen/pull/157","diff_url":"https://github.com/ros-industrial/ros_canopen/pull/157.diff","patch_url":"https://github.com/ros-industrial/ros_canopen/pull/157.patch","issue_url":"https://api.github.com/repos/ros-industrial/ros_canopen/issues/157","number":157,"state":"open","locked":false,"title":"Add socketcan_bridge and can_msgs.","user":{"login":"iwanders","id":1732289,"avatar_url":"https://avatars.githubusercontent.com/u/1732289?v=3","gravatar_id":"","url":"https://api.github.com/users/iwanders","html_url":"https://github.com/iwanders","followers_url":"https://api.github.com/users/iwanders/followers","following_url":"https://api.github.com/users/iwanders/following{/other_user}","gists_url":"https://api.github.com/users/iwanders/gists{/gist_id}","starred_url":"https://api.github.com/users/iwanders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwanders/subscriptions","organizations_url":"https://api.github.com/users/iwanders/orgs","repos_url":"https://api.github.com/users/iwanders/repos","events_url":"https://api.github.com/users/iwanders/events{/privacy}","received_events_url":"https://api.github.com/users/iwanders/received_events","type":"User","site_admin":false},"body":"Currently there is no package available in ROS to expose can frames from SocketCAN to a topic or the other way around. This pull request contains the additions which provide this functionality, the development has been discussed in issue #137.\r\n\r\nIt adds the `can_msgs` package, which holds a message type for a CAN Frame. The `socketcan_bridge` package contains nodes and classes that can bridge frames from SocketCAN to a ROS Topic and vice versa. \r\n\r\nThe `socketcan_bridge` builds on the `socketcan_interface` package and does not depend on other `ros_canopen` packages. One change to `socketcan_interface` was required: the `DummyInterface` has been modified in order to facilitate testing the `socketcan_bridge` functionality, test results are unaffected by the changes.\r\n\r\nPlease review the code, if there are any obstacles to the merge, please let me know. I'll write the wiki pages and send an announcement on the ros-users list when the time comes.","created_at":"2016-01-23T11:11:13Z","updated_at":"2016-01-25T19:17:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7678f53f07b150c4c683bd956e26ce0f0c538725","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/157/commits","review_comments_url":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/157/comments","review_comment_url":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros-industrial/ros_canopen/issues/157/comments","statuses_url":"https://api.github.com/repos/ros-industrial/ros_canopen/statuses/a2a2000381867c2a2f88a89d76b9d07665d6c57f","head":{"label":"iwanders:bridge_threading_interface","ref":"bridge_threading_interface","sha":"a2a2000381867c2a2f88a89d76b9d07665d6c57f","user":{"login":"iwanders","id":1732289,"avatar_url":"https://avatars.githubusercontent.com/u/1732289?v=3","gravatar_id":"","url":"https://api.github.com/users/iwanders","html_url":"https://github.com/iwanders","followers_url":"https://api.github.com/users/iwanders/followers","following_url":"https://api.github.com/users/iwanders/following{/other_user}","gists_url":"https://api.github.com/users/iwanders/gists{/gist_id}","starred_url":"https://api.github.com/users/iwanders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwanders/subscriptions","organizations_url":"https://api.github.com/users/iwanders/orgs","repos_url":"https://api.github.com/users/iwanders/repos","events_url":"https://api.github.com/users/iwanders/events{/privacy}","received_events_url":"https://api.github.com/users/iwanders/received_events","type":"User","site_admin":false},"repo":{"id":49254409,"name":"ros_canopen","full_name":"iwanders/ros_canopen","owner":{"login":"iwanders","id":1732289,"avatar_url":"https://avatars.githubusercontent.com/u/1732289?v=3","gravatar_id":"","url":"https://api.github.com/users/iwanders","html_url":"https://github.com/iwanders","followers_url":"https://api.github.com/users/iwanders/followers","following_url":"https://api.github.com/users/iwanders/following{/other_user}","gists_url":"https://api.github.com/users/iwanders/gists{/gist_id}","starred_url":"https://api.github.com/users/iwanders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iwanders/subscriptions","organizations_url":"https://api.github.com/users/iwanders/orgs","repos_url":"https://api.github.com/users/iwanders/repos","events_url":"https://api.github.com/users/iwanders/events{/privacy}","received_events_url":"https://api.github.com/users/iwanders/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iwanders/ros_canopen","description":"CANopen driver framework for ROS.","fork":true,"url":"https://api.github.com/repos/iwanders/ros_canopen","forks_url":"https://api.github.com/repos/iwanders/ros_canopen/forks","keys_url":"https://api.github.com/repos/iwanders/ros_canopen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iwanders/ros_canopen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iwanders/ros_canopen/teams","hooks_url":"https://api.github.com/repos/iwanders/ros_canopen/hooks","issue_events_url":"https://api.github.com/repos/iwanders/ros_canopen/issues/events{/number}","events_url":"https://api.github.com/repos/iwanders/ros_canopen/events","assignees_url":"https://api.github.com/repos/iwanders/ros_canopen/assignees{/user}","branches_url":"https://api.github.com/repos/iwanders/ros_canopen/branches{/branch}","tags_url":"https://api.github.com/repos/iwanders/ros_canopen/tags","blobs_url":"https://api.github.com/repos/iwanders/ros_canopen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iwanders/ros_canopen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iwanders/ros_canopen/git/refs{/sha}","trees_url":"https://api.github.com/repos/iwanders/ros_canopen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iwanders/ros_canopen/statuses/{sha}","languages_url":"https://api.github.com/repos/iwanders/ros_canopen/languages","stargazers_url":"https://api.github.com/repos/iwanders/ros_canopen/stargazers","contributors_url":"https://api.github.com/repos/iwanders/ros_canopen/contributors","subscribers_url":"https://api.github.com/repos/iwanders/ros_canopen/subscribers","subscription_url":"https://api.github.com/repos/iwanders/ros_canopen/subscription","commits_url":"https://api.github.com/repos/iwanders/ros_canopen/commits{/sha}","git_commits_url":"https://api.github.com/repos/iwanders/ros_canopen/git/commits{/sha}","comments_url":"https://api.github.com/repos/iwanders/ros_canopen/comments{/number}","issue_comment_url":"https://api.github.com/repos/iwanders/ros_canopen/issues/comments{/number}","contents_url":"https://api.github.com/repos/iwanders/ros_canopen/contents/{+path}","compare_url":"https://api.github.com/repos/iwanders/ros_canopen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iwanders/ros_canopen/merges","archive_url":"https://api.github.com/repos/iwanders/ros_canopen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iwanders/ros_canopen/downloads","issues_url":"https://api.github.com/repos/iwanders/ros_canopen/issues{/number}","pulls_url":"https://api.github.com/repos/iwanders/ros_canopen/pulls{/number}","milestones_url":"https://api.github.com/repos/iwanders/ros_canopen/milestones{/number}","notifications_url":"https://api.github.com/repos/iwanders/ros_canopen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iwanders/ros_canopen/labels{/name}","releases_url":"https://api.github.com/repos/iwanders/ros_canopen/releases{/id}","deployments_url":"https://api.github.com/repos/iwanders/ros_canopen/deployments","created_at":"2016-01-08T06:31:11Z","updated_at":"2016-01-08T06:31:11Z","pushed_at":"2016-01-23T10:52:15Z","git_url":"git://github.com/iwanders/ros_canopen.git","ssh_url":"git@github.com:iwanders/ros_canopen.git","clone_url":"https://github.com/iwanders/ros_canopen.git","svn_url":"https://github.com/iwanders/ros_canopen","homepage":"","size":1054,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"indigo-devel"}},"base":{"label":"ros-industrial:indigo-devel","ref":"indigo-devel","sha":"349792213ccd6ad252fdde87d6c68b8105ffc387","user":{"login":"ros-industrial","id":2932528,"avatar_url":"https://avatars.githubusercontent.com/u/2932528?v=3","gravatar_id":"","url":"https://api.github.com/users/ros-industrial","html_url":"https://github.com/ros-industrial","followers_url":"https://api.github.com/users/ros-industrial/followers","following_url":"https://api.github.com/users/ros-industrial/following{/other_user}","gists_url":"https://api.github.com/users/ros-industrial/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-industrial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-industrial/subscriptions","organizations_url":"https://api.github.com/users/ros-industrial/orgs","repos_url":"https://api.github.com/users/ros-industrial/repos","events_url":"https://api.github.com/users/ros-industrial/events{/privacy}","received_events_url":"https://api.github.com/users/ros-industrial/received_events","type":"Organization","site_admin":false},"repo":{"id":21686950,"name":"ros_canopen","full_name":"ros-industrial/ros_canopen","owner":{"login":"ros-industrial","id":2932528,"avatar_url":"https://avatars.githubusercontent.com/u/2932528?v=3","gravatar_id":"","url":"https://api.github.com/users/ros-industrial","html_url":"https://github.com/ros-industrial","followers_url":"https://api.github.com/users/ros-industrial/followers","following_url":"https://api.github.com/users/ros-industrial/following{/other_user}","gists_url":"https://api.github.com/users/ros-industrial/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-industrial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-industrial/subscriptions","organizations_url":"https://api.github.com/users/ros-industrial/orgs","repos_url":"https://api.github.com/users/ros-industrial/repos","events_url":"https://api.github.com/users/ros-industrial/events{/privacy}","received_events_url":"https://api.github.com/users/ros-industrial/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros-industrial/ros_canopen","description":"CANopen driver framework for ROS.","fork":false,"url":"https://api.github.com/repos/ros-industrial/ros_canopen","forks_url":"https://api.github.com/repos/ros-industrial/ros_canopen/forks","keys_url":"https://api.github.com/repos/ros-industrial/ros_canopen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros-industrial/ros_canopen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros-industrial/ros_canopen/teams","hooks_url":"https://api.github.com/repos/ros-industrial/ros_canopen/hooks","issue_events_url":"https://api.github.com/repos/ros-industrial/ros_canopen/issues/events{/number}","events_url":"https://api.github.com/repos/ros-industrial/ros_canopen/events","assignees_url":"https://api.github.com/repos/ros-industrial/ros_canopen/assignees{/user}","branches_url":"https://api.github.com/repos/ros-industrial/ros_canopen/branches{/branch}","tags_url":"https://api.github.com/repos/ros-industrial/ros_canopen/tags","blobs_url":"https://api.github.com/repos/ros-industrial/ros_canopen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros-industrial/ros_canopen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros-industrial/ros_canopen/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros-industrial/ros_canopen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros-industrial/ros_canopen/statuses/{sha}","languages_url":"https://api.github.com/repos/ros-industrial/ros_canopen/languages","stargazers_url":"https://api.github.com/repos/ros-industrial/ros_canopen/stargazers","contributors_url":"https://api.github.com/repos/ros-industrial/ros_canopen/contributors","subscribers_url":"https://api.github.com/repos/ros-industrial/ros_canopen/subscribers","subscription_url":"https://api.github.com/repos/ros-industrial/ros_canopen/subscription","commits_url":"https://api.github.com/repos/ros-industrial/ros_canopen/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros-industrial/ros_canopen/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros-industrial/ros_canopen/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros-industrial/ros_canopen/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros-industrial/ros_canopen/contents/{+path}","compare_url":"https://api.github.com/repos/ros-industrial/ros_canopen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros-industrial/ros_canopen/merges","archive_url":"https://api.github.com/repos/ros-industrial/ros_canopen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros-industrial/ros_canopen/downloads","issues_url":"https://api.github.com/repos/ros-industrial/ros_canopen/issues{/number}","pulls_url":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls{/number}","milestones_url":"https://api.github.com/repos/ros-industrial/ros_canopen/milestones{/number}","notifications_url":"https://api.github.com/repos/ros-industrial/ros_canopen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros-industrial/ros_canopen/labels{/name}","releases_url":"https://api.github.com/repos/ros-industrial/ros_canopen/releases{/id}","deployments_url":"https://api.github.com/repos/ros-industrial/ros_canopen/deployments","created_at":"2014-07-10T08:42:35Z","updated_at":"2015-12-31T03:54:14Z","pushed_at":"2016-01-23T11:11:13Z","git_url":"git://github.com/ros-industrial/ros_canopen.git","ssh_url":"git@github.com:ros-industrial/ros_canopen.git","clone_url":"https://github.com/ros-industrial/ros_canopen.git","svn_url":"https://github.com/ros-industrial/ros_canopen","homepage":"","size":1042,"stargazers_count":9,"watchers_count":9,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":19,"forks":17,"open_issues":19,"watchers":9,"default_branch":"indigo-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/157"},"html":{"href":"https://github.com/ros-industrial/ros_canopen/pull/157"},"issue":{"href":"https://api.github.com/repos/ros-industrial/ros_canopen/issues/157"},"comments":{"href":"https://api.github.com/repos/ros-industrial/ros_canopen/issues/157/comments"},"review_comments":{"href":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/157/comments"},"review_comment":{"href":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros-industrial/ros_canopen/pulls/157/commits"},"statuses":{"href":"https://api.github.com/repos/ros-industrial/ros_canopen/statuses/a2a2000381867c2a2f88a89d76b9d07665d6c57f"}}}}