{"action":"created","comment":{"url":"https://api.github.com/repos/shadow-robot/optoforce/pulls/comments/78693943","id":78693943,"diff_hunk":"@@ -66,25 +81,46 @@ class OptoforceDriver(object):\n     _zeroing_values = {False: 0,\n                        True: 255}\n \n-    def __init__(self):\n+    # Tree representation of all accepted headers.\n+    # Leaf nodes are the lenght of the frame associated with the header\n+    _headers = {170:\n+                   {0:\n+                       {18:\n+                           {8: 14}},\n+                   7:\n+                       {8:\n+                           {10: 16,\n+                           16: 34,\n+                       28: 22}}}}\n+\n+    def __init__(self, port,\n+                sensor_type,\n+                scale,\n+                starting_index = 0):\n         \"\"\"\n         Initialize OptoforceDriver object\n+\n+        Raises serial.SerialException if there is a problem connecting to the\n+        serial port.\n+\n+        @param port path to the device's port\n+        @param sensor_type string representing the sensor type (one or more\n+            channels, 3 or 6 axes)","path":"optoforce/src/optoforce/optoforce.py","position":67,"original_position":67,"commit_id":"cc6023ec4ef52e8e4e903504d62f48294063b8fa","original_commit_id":"6c3627163444eb21474ffef0ab32c1f0b83bf80e","user":{"login":"dogoepp","id":13215604,"avatar_url":"https://avatars.githubusercontent.com/u/13215604?v=3","gravatar_id":"","url":"https://api.github.com/users/dogoepp","html_url":"https://github.com/dogoepp","followers_url":"https://api.github.com/users/dogoepp/followers","following_url":"https://api.github.com/users/dogoepp/following{/other_user}","gists_url":"https://api.github.com/users/dogoepp/gists{/gist_id}","starred_url":"https://api.github.com/users/dogoepp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dogoepp/subscriptions","organizations_url":"https://api.github.com/users/dogoepp/orgs","repos_url":"https://api.github.com/users/dogoepp/repos","events_url":"https://api.github.com/users/dogoepp/events{/privacy}","received_events_url":"https://api.github.com/users/dogoepp/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-09-14T06:48:12Z","updated_at":"2016-09-14T06:48:12Z","html_url":"https://github.com/shadow-robot/optoforce/pull/23#discussion_r78693943","pull_request_url":"https://api.github.com/repos/shadow-robot/optoforce/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/shadow-robot/optoforce/pulls/comments/78693943"},"html":{"href":"https://github.com/shadow-robot/optoforce/pull/23#discussion_r78693943"},"pull_request":{"href":"https://api.github.com/repos/shadow-robot/optoforce/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/shadow-robot/optoforce/pulls/23","id":84605217,"html_url":"https://github.com/shadow-robot/optoforce/pull/23","diff_url":"https://github.com/shadow-robot/optoforce/pull/23.diff","patch_url":"https://github.com/shadow-robot/optoforce/pull/23.patch","issue_url":"https://api.github.com/repos/shadow-robot/optoforce/issues/23","number":23,"state":"open","locked":false,"title":"Serial number, reboot","user":{"login":"dogoepp","id":13215604,"avatar_url":"https://avatars.githubusercontent.com/u/13215604?v=3","gravatar_id":"","url":"https://api.github.com/users/dogoepp","html_url":"https://github.com/dogoepp","followers_url":"https://api.github.com/users/dogoepp/followers","following_url":"https://api.github.com/users/dogoepp/following{/other_user}","gists_url":"https://api.github.com/users/dogoepp/gists{/gist_id}","starred_url":"https://api.github.com/users/dogoepp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dogoepp/subscriptions","organizations_url":"https://api.github.com/users/dogoepp/orgs","repos_url":"https://api.github.com/users/dogoepp/repos","events_url":"https://api.github.com/users/dogoepp/events{/privacy}","received_events_url":"https://api.github.com/users/dogoepp/received_events","type":"User","site_admin":false},"body":"This pull request is a sequel to the #20 on which it does a few improvements:\r\n\r\n- No need to make an assumption on the port name that Linux will allocate to the sensor. An udev rule takes care of the naming of the sensor ports, based on their serial number\r\n- The persistence is no longer at the level of the topic, but the port name\r\n- The ROS node is separated from the driver (because we need the driver for the udev rule)\r\n- We actually check that the data received matches a frame header, freeing ourselves from the occasional \"bad checksum\" warning waterfall.","created_at":"2016-09-09T07:26:00Z","updated_at":"2016-09-14T06:48:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36cacf3cb41866eb75ac09863b1f9217d022cc01","assignee":{"login":"kirstyellis","id":11501425,"avatar_url":"https://avatars.githubusercontent.com/u/11501425?v=3","gravatar_id":"","url":"https://api.github.com/users/kirstyellis","html_url":"https://github.com/kirstyellis","followers_url":"https://api.github.com/users/kirstyellis/followers","following_url":"https://api.github.com/users/kirstyellis/following{/other_user}","gists_url":"https://api.github.com/users/kirstyellis/gists{/gist_id}","starred_url":"https://api.github.com/users/kirstyellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirstyellis/subscriptions","organizations_url":"https://api.github.com/users/kirstyellis/orgs","repos_url":"https://api.github.com/users/kirstyellis/repos","events_url":"https://api.github.com/users/kirstyellis/events{/privacy}","received_events_url":"https://api.github.com/users/kirstyellis/received_events","type":"User","site_admin":false},"assignees":[{"login":"kirstyellis","id":11501425,"avatar_url":"https://avatars.githubusercontent.com/u/11501425?v=3","gravatar_id":"","url":"https://api.github.com/users/kirstyellis","html_url":"https://github.com/kirstyellis","followers_url":"https://api.github.com/users/kirstyellis/followers","following_url":"https://api.github.com/users/kirstyellis/following{/other_user}","gists_url":"https://api.github.com/users/kirstyellis/gists{/gist_id}","starred_url":"https://api.github.com/users/kirstyellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirstyellis/subscriptions","organizations_url":"https://api.github.com/users/kirstyellis/orgs","repos_url":"https://api.github.com/users/kirstyellis/repos","events_url":"https://api.github.com/users/kirstyellis/events{/privacy}","received_events_url":"https://api.github.com/users/kirstyellis/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/shadow-robot/optoforce/pulls/23/commits","review_comments_url":"https://api.github.com/repos/shadow-robot/optoforce/pulls/23/comments","review_comment_url":"https://api.github.com/repos/shadow-robot/optoforce/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shadow-robot/optoforce/issues/23/comments","statuses_url":"https://api.github.com/repos/shadow-robot/optoforce/statuses/cc6023ec4ef52e8e4e903504d62f48294063b8fa","head":{"label":"resibots:udev_serial_number","ref":"udev_serial_number","sha":"cc6023ec4ef52e8e4e903504d62f48294063b8fa","user":{"login":"resibots","id":13557617,"avatar_url":"https://avatars.githubusercontent.com/u/13557617?v=3","gravatar_id":"","url":"https://api.github.com/users/resibots","html_url":"https://github.com/resibots","followers_url":"https://api.github.com/users/resibots/followers","following_url":"https://api.github.com/users/resibots/following{/other_user}","gists_url":"https://api.github.com/users/resibots/gists{/gist_id}","starred_url":"https://api.github.com/users/resibots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resibots/subscriptions","organizations_url":"https://api.github.com/users/resibots/orgs","repos_url":"https://api.github.com/users/resibots/repos","events_url":"https://api.github.com/users/resibots/events{/privacy}","received_events_url":"https://api.github.com/users/resibots/received_events","type":"Organization","site_admin":false},"repo":{"id":53957279,"name":"optoforce","full_name":"resibots/optoforce","owner":{"login":"resibots","id":13557617,"avatar_url":"https://avatars.githubusercontent.com/u/13557617?v=3","gravatar_id":"","url":"https://api.github.com/users/resibots","html_url":"https://github.com/resibots","followers_url":"https://api.github.com/users/resibots/followers","following_url":"https://api.github.com/users/resibots/following{/other_user}","gists_url":"https://api.github.com/users/resibots/gists{/gist_id}","starred_url":"https://api.github.com/users/resibots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resibots/subscriptions","organizations_url":"https://api.github.com/users/resibots/orgs","repos_url":"https://api.github.com/users/resibots/repos","events_url":"https://api.github.com/users/resibots/events{/privacy}","received_events_url":"https://api.github.com/users/resibots/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resibots/optoforce","description":"ROS driver for the Optoforce sensor","fork":true,"url":"https://api.github.com/repos/resibots/optoforce","forks_url":"https://api.github.com/repos/resibots/optoforce/forks","keys_url":"https://api.github.com/repos/resibots/optoforce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resibots/optoforce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resibots/optoforce/teams","hooks_url":"https://api.github.com/repos/resibots/optoforce/hooks","issue_events_url":"https://api.github.com/repos/resibots/optoforce/issues/events{/number}","events_url":"https://api.github.com/repos/resibots/optoforce/events","assignees_url":"https://api.github.com/repos/resibots/optoforce/assignees{/user}","branches_url":"https://api.github.com/repos/resibots/optoforce/branches{/branch}","tags_url":"https://api.github.com/repos/resibots/optoforce/tags","blobs_url":"https://api.github.com/repos/resibots/optoforce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resibots/optoforce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resibots/optoforce/git/refs{/sha}","trees_url":"https://api.github.com/repos/resibots/optoforce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resibots/optoforce/statuses/{sha}","languages_url":"https://api.github.com/repos/resibots/optoforce/languages","stargazers_url":"https://api.github.com/repos/resibots/optoforce/stargazers","contributors_url":"https://api.github.com/repos/resibots/optoforce/contributors","subscribers_url":"https://api.github.com/repos/resibots/optoforce/subscribers","subscription_url":"https://api.github.com/repos/resibots/optoforce/subscription","commits_url":"https://api.github.com/repos/resibots/optoforce/commits{/sha}","git_commits_url":"https://api.github.com/repos/resibots/optoforce/git/commits{/sha}","comments_url":"https://api.github.com/repos/resibots/optoforce/comments{/number}","issue_comment_url":"https://api.github.com/repos/resibots/optoforce/issues/comments{/number}","contents_url":"https://api.github.com/repos/resibots/optoforce/contents/{+path}","compare_url":"https://api.github.com/repos/resibots/optoforce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resibots/optoforce/merges","archive_url":"https://api.github.com/repos/resibots/optoforce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resibots/optoforce/downloads","issues_url":"https://api.github.com/repos/resibots/optoforce/issues{/number}","pulls_url":"https://api.github.com/repos/resibots/optoforce/pulls{/number}","milestones_url":"https://api.github.com/repos/resibots/optoforce/milestones{/number}","notifications_url":"https://api.github.com/repos/resibots/optoforce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resibots/optoforce/labels{/name}","releases_url":"https://api.github.com/repos/resibots/optoforce/releases{/id}","deployments_url":"https://api.github.com/repos/resibots/optoforce/deployments","created_at":"2016-03-15T15:42:52Z","updated_at":"2016-03-15T15:42:53Z","pushed_at":"2016-09-14T06:47:32Z","git_url":"git://github.com/resibots/optoforce.git","ssh_url":"git@github.com:resibots/optoforce.git","clone_url":"https://github.com/resibots/optoforce.git","svn_url":"https://github.com/resibots/optoforce","homepage":null,"size":130,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"shadow-robot:indigo-devel","ref":"indigo-devel","sha":"b2353d6edb52492d03a54833c42b934293c0fb47","user":{"login":"shadow-robot","id":3306493,"avatar_url":"https://avatars.githubusercontent.com/u/3306493?v=3","gravatar_id":"","url":"https://api.github.com/users/shadow-robot","html_url":"https://github.com/shadow-robot","followers_url":"https://api.github.com/users/shadow-robot/followers","following_url":"https://api.github.com/users/shadow-robot/following{/other_user}","gists_url":"https://api.github.com/users/shadow-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/shadow-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadow-robot/subscriptions","organizations_url":"https://api.github.com/users/shadow-robot/orgs","repos_url":"https://api.github.com/users/shadow-robot/repos","events_url":"https://api.github.com/users/shadow-robot/events{/privacy}","received_events_url":"https://api.github.com/users/shadow-robot/received_events","type":"Organization","site_admin":false},"repo":{"id":43001369,"name":"optoforce","full_name":"shadow-robot/optoforce","owner":{"login":"shadow-robot","id":3306493,"avatar_url":"https://avatars.githubusercontent.com/u/3306493?v=3","gravatar_id":"","url":"https://api.github.com/users/shadow-robot","html_url":"https://github.com/shadow-robot","followers_url":"https://api.github.com/users/shadow-robot/followers","following_url":"https://api.github.com/users/shadow-robot/following{/other_user}","gists_url":"https://api.github.com/users/shadow-robot/gists{/gist_id}","starred_url":"https://api.github.com/users/shadow-robot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shadow-robot/subscriptions","organizations_url":"https://api.github.com/users/shadow-robot/orgs","repos_url":"https://api.github.com/users/shadow-robot/repos","events_url":"https://api.github.com/users/shadow-robot/events{/privacy}","received_events_url":"https://api.github.com/users/shadow-robot/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shadow-robot/optoforce","description":"ROS driver for the Optoforce sensor","fork":false,"url":"https://api.github.com/repos/shadow-robot/optoforce","forks_url":"https://api.github.com/repos/shadow-robot/optoforce/forks","keys_url":"https://api.github.com/repos/shadow-robot/optoforce/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shadow-robot/optoforce/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shadow-robot/optoforce/teams","hooks_url":"https://api.github.com/repos/shadow-robot/optoforce/hooks","issue_events_url":"https://api.github.com/repos/shadow-robot/optoforce/issues/events{/number}","events_url":"https://api.github.com/repos/shadow-robot/optoforce/events","assignees_url":"https://api.github.com/repos/shadow-robot/optoforce/assignees{/user}","branches_url":"https://api.github.com/repos/shadow-robot/optoforce/branches{/branch}","tags_url":"https://api.github.com/repos/shadow-robot/optoforce/tags","blobs_url":"https://api.github.com/repos/shadow-robot/optoforce/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shadow-robot/optoforce/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shadow-robot/optoforce/git/refs{/sha}","trees_url":"https://api.github.com/repos/shadow-robot/optoforce/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shadow-robot/optoforce/statuses/{sha}","languages_url":"https://api.github.com/repos/shadow-robot/optoforce/languages","stargazers_url":"https://api.github.com/repos/shadow-robot/optoforce/stargazers","contributors_url":"https://api.github.com/repos/shadow-robot/optoforce/contributors","subscribers_url":"https://api.github.com/repos/shadow-robot/optoforce/subscribers","subscription_url":"https://api.github.com/repos/shadow-robot/optoforce/subscription","commits_url":"https://api.github.com/repos/shadow-robot/optoforce/commits{/sha}","git_commits_url":"https://api.github.com/repos/shadow-robot/optoforce/git/commits{/sha}","comments_url":"https://api.github.com/repos/shadow-robot/optoforce/comments{/number}","issue_comment_url":"https://api.github.com/repos/shadow-robot/optoforce/issues/comments{/number}","contents_url":"https://api.github.com/repos/shadow-robot/optoforce/contents/{+path}","compare_url":"https://api.github.com/repos/shadow-robot/optoforce/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shadow-robot/optoforce/merges","archive_url":"https://api.github.com/repos/shadow-robot/optoforce/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shadow-robot/optoforce/downloads","issues_url":"https://api.github.com/repos/shadow-robot/optoforce/issues{/number}","pulls_url":"https://api.github.com/repos/shadow-robot/optoforce/pulls{/number}","milestones_url":"https://api.github.com/repos/shadow-robot/optoforce/milestones{/number}","notifications_url":"https://api.github.com/repos/shadow-robot/optoforce/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shadow-robot/optoforce/labels{/name}","releases_url":"https://api.github.com/repos/shadow-robot/optoforce/releases{/id}","deployments_url":"https://api.github.com/repos/shadow-robot/optoforce/deployments","created_at":"2015-09-23T13:06:22Z","updated_at":"2016-08-29T15:31:52Z","pushed_at":"2016-09-14T06:47:32Z","git_url":"git://github.com/shadow-robot/optoforce.git","ssh_url":"git@github.com:shadow-robot/optoforce.git","clone_url":"https://github.com/shadow-robot/optoforce.git","svn_url":"https://github.com/shadow-robot/optoforce","homepage":null,"size":97,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":5,"forks":5,"open_issues":5,"watchers":2,"default_branch":"indigo-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/shadow-robot/optoforce/pulls/23"},"html":{"href":"https://github.com/shadow-robot/optoforce/pull/23"},"issue":{"href":"https://api.github.com/repos/shadow-robot/optoforce/issues/23"},"comments":{"href":"https://api.github.com/repos/shadow-robot/optoforce/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/shadow-robot/optoforce/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/shadow-robot/optoforce/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shadow-robot/optoforce/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/shadow-robot/optoforce/statuses/cc6023ec4ef52e8e4e903504d62f48294063b8fa"}}}}
{"actor":{"display_login":"dogoepp"}}