{"action":"created","comment":{"url":"https://api.github.com/repos/samkhal/biped/pulls/comments/91845308","pull_request_review_id":12357429,"id":91845308,"diff_hunk":"@@ -6,15 +6,93 @@\n #include \"commDataFromTeensy.hpp\" // header file for data from teensy to dispatcher\n #include \"Joint.h\" // struct that stores joint data\n #include \"ConstJoint.h\" // struct for constant joint data\n+#include \"ROM_DATA.h\" // array to data addresses and enum\n \n LCMSerialSlave lcm; //initialize LCM object\n \n+//PID Variables\n+uint16_t minPot;\n+uint16_t maxPot;\n+\n+//State Machine Variables\n+volatile unsigned long int timer = 0;\n+volatile bool allowPD = true; //flag for allowing the control\n+\n+\n+//takes number of link/joint of teensy and an attribute\n+// attributes: 0 - zeroTheta, 1 - minPot, 2 - maxPot, 3 - orientation\n+int readROM(int link, int attribute) {\n+  int address1 = ROM[(link*2-1) + attribute*6 + 2];\n+  int address2 = ROM[(link*2) + attribute*6 + 2];\n+  int val = EEPROM.read(address1);\n+  val = val + (EEPROM.read(address2) << 8);\n+  return val;\n+}\n+\n+void setOrientROM(ConstJoint* cjoint){\n+  EEPROM.write(ROM[20+cjoint->link*2-1], (byte)(cjoint->direction));\n+  EEPROM.write(ROM[20+cjoint->link*2], (byte)0);\n+}\n+\n+void setZeroThetaROM(ConstJoint* cjoint){\n+  int val = analogRead(cjoint->position);\n+  EEPROM.write((2+cjoint->link*2-1), (byte)(val));\n+  EEPROM.write((2+cjoint->link*2), (byte)(val >> 8));\n+}\n+\n+ConstJoint linksConst[3] = {\n+  JointTable[EEPROM.read(ROM_ENUM::link1Addr)], //make enums\n+  JointTable[EEPROM.read(ROM_ENUM::link2Addr)],\n+  JointTable[EEPROM.read(ROM_ENUM::link3Addr)]};\n+\n+Joint links [3];\n+\n+Joint joint;\n+Joint* joint_p;\n+ConstJoint cjoint;\n+ConstJoint* cjoint_p;","path":"serial_communication/onboard/onboard/main.cpp","position":53,"original_position":48,"commit_id":"913113fa36a8073e26695b3f3c4bec2e999944d4","original_commit_id":"913113fa36a8073e26695b3f3c4bec2e999944d4","user":{"login":"samkhal","id":5384883,"avatar_url":"https://avatars.githubusercontent.com/u/5384883?v=3","gravatar_id":"","url":"https://api.github.com/users/samkhal","html_url":"https://github.com/samkhal","followers_url":"https://api.github.com/users/samkhal/followers","following_url":"https://api.github.com/users/samkhal/following{/other_user}","gists_url":"https://api.github.com/users/samkhal/gists{/gist_id}","starred_url":"https://api.github.com/users/samkhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samkhal/subscriptions","organizations_url":"https://api.github.com/users/samkhal/orgs","repos_url":"https://api.github.com/users/samkhal/repos","events_url":"https://api.github.com/users/samkhal/events{/privacy}","received_events_url":"https://api.github.com/users/samkhal/received_events","type":"User","site_admin":false},"body":"Again, you don't need to define a pointer to the same thing for no reason.","created_at":"2016-12-11T00:32:46Z","updated_at":"2016-12-11T00:33:47Z","html_url":"https://github.com/samkhal/biped/pull/7#discussion_r91845308","pull_request_url":"https://api.github.com/repos/samkhal/biped/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/samkhal/biped/pulls/comments/91845308"},"html":{"href":"https://github.com/samkhal/biped/pull/7#discussion_r91845308"},"pull_request":{"href":"https://api.github.com/repos/samkhal/biped/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/samkhal/biped/pulls/7","id":97434747,"html_url":"https://github.com/samkhal/biped/pull/7","diff_url":"https://github.com/samkhal/biped/pull/7.diff","patch_url":"https://github.com/samkhal/biped/pull/7.patch","issue_url":"https://api.github.com/repos/samkhal/biped/issues/7","number":7,"state":"open","locked":false,"title":"Teensy restart","user":{"login":"gardamerinos","id":6911659,"avatar_url":"https://avatars.githubusercontent.com/u/6911659?v=3","gravatar_id":"","url":"https://api.github.com/users/gardamerinos","html_url":"https://github.com/gardamerinos","followers_url":"https://api.github.com/users/gardamerinos/followers","following_url":"https://api.github.com/users/gardamerinos/following{/other_user}","gists_url":"https://api.github.com/users/gardamerinos/gists{/gist_id}","starred_url":"https://api.github.com/users/gardamerinos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gardamerinos/subscriptions","organizations_url":"https://api.github.com/users/gardamerinos/orgs","repos_url":"https://api.github.com/users/gardamerinos/repos","events_url":"https://api.github.com/users/gardamerinos/events{/privacy}","received_events_url":"https://api.github.com/users/gardamerinos/received_events","type":"User","site_admin":false},"body":"Starting Teensy code from scratch\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/samkhal/biped/7)\n<!-- Reviewable:end -->\n","created_at":"2016-12-10T19:15:50Z","updated_at":"2016-12-11T00:33:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9576f44cae0be826c9a0ae6e961bdbc8d27b852d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/samkhal/biped/pulls/7/commits","review_comments_url":"https://api.github.com/repos/samkhal/biped/pulls/7/comments","review_comment_url":"https://api.github.com/repos/samkhal/biped/pulls/comments{/number}","comments_url":"https://api.github.com/repos/samkhal/biped/issues/7/comments","statuses_url":"https://api.github.com/repos/samkhal/biped/statuses/913113fa36a8073e26695b3f3c4bec2e999944d4","head":{"label":"samkhal:teensy_restart","ref":"teensy_restart","sha":"913113fa36a8073e26695b3f3c4bec2e999944d4","user":{"login":"samkhal","id":5384883,"avatar_url":"https://avatars.githubusercontent.com/u/5384883?v=3","gravatar_id":"","url":"https://api.github.com/users/samkhal","html_url":"https://github.com/samkhal","followers_url":"https://api.github.com/users/samkhal/followers","following_url":"https://api.github.com/users/samkhal/following{/other_user}","gists_url":"https://api.github.com/users/samkhal/gists{/gist_id}","starred_url":"https://api.github.com/users/samkhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samkhal/subscriptions","organizations_url":"https://api.github.com/users/samkhal/orgs","repos_url":"https://api.github.com/users/samkhal/repos","events_url":"https://api.github.com/users/samkhal/events{/privacy}","received_events_url":"https://api.github.com/users/samkhal/received_events","type":"User","site_admin":false},"repo":{"id":51670384,"name":"biped","full_name":"samkhal/biped","owner":{"login":"samkhal","id":5384883,"avatar_url":"https://avatars.githubusercontent.com/u/5384883?v=3","gravatar_id":"","url":"https://api.github.com/users/samkhal","html_url":"https://github.com/samkhal","followers_url":"https://api.github.com/users/samkhal/followers","following_url":"https://api.github.com/users/samkhal/following{/other_user}","gists_url":"https://api.github.com/users/samkhal/gists{/gist_id}","starred_url":"https://api.github.com/users/samkhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samkhal/subscriptions","organizations_url":"https://api.github.com/users/samkhal/orgs","repos_url":"https://api.github.com/users/samkhal/repos","events_url":"https://api.github.com/users/samkhal/events{/privacy}","received_events_url":"https://api.github.com/users/samkhal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samkhal/biped","description":null,"fork":false,"url":"https://api.github.com/repos/samkhal/biped","forks_url":"https://api.github.com/repos/samkhal/biped/forks","keys_url":"https://api.github.com/repos/samkhal/biped/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samkhal/biped/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samkhal/biped/teams","hooks_url":"https://api.github.com/repos/samkhal/biped/hooks","issue_events_url":"https://api.github.com/repos/samkhal/biped/issues/events{/number}","events_url":"https://api.github.com/repos/samkhal/biped/events","assignees_url":"https://api.github.com/repos/samkhal/biped/assignees{/user}","branches_url":"https://api.github.com/repos/samkhal/biped/branches{/branch}","tags_url":"https://api.github.com/repos/samkhal/biped/tags","blobs_url":"https://api.github.com/repos/samkhal/biped/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samkhal/biped/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samkhal/biped/git/refs{/sha}","trees_url":"https://api.github.com/repos/samkhal/biped/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samkhal/biped/statuses/{sha}","languages_url":"https://api.github.com/repos/samkhal/biped/languages","stargazers_url":"https://api.github.com/repos/samkhal/biped/stargazers","contributors_url":"https://api.github.com/repos/samkhal/biped/contributors","subscribers_url":"https://api.github.com/repos/samkhal/biped/subscribers","subscription_url":"https://api.github.com/repos/samkhal/biped/subscription","commits_url":"https://api.github.com/repos/samkhal/biped/commits{/sha}","git_commits_url":"https://api.github.com/repos/samkhal/biped/git/commits{/sha}","comments_url":"https://api.github.com/repos/samkhal/biped/comments{/number}","issue_comment_url":"https://api.github.com/repos/samkhal/biped/issues/comments{/number}","contents_url":"https://api.github.com/repos/samkhal/biped/contents/{+path}","compare_url":"https://api.github.com/repos/samkhal/biped/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samkhal/biped/merges","archive_url":"https://api.github.com/repos/samkhal/biped/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samkhal/biped/downloads","issues_url":"https://api.github.com/repos/samkhal/biped/issues{/number}","pulls_url":"https://api.github.com/repos/samkhal/biped/pulls{/number}","milestones_url":"https://api.github.com/repos/samkhal/biped/milestones{/number}","notifications_url":"https://api.github.com/repos/samkhal/biped/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samkhal/biped/labels{/name}","releases_url":"https://api.github.com/repos/samkhal/biped/releases{/id}","deployments_url":"https://api.github.com/repos/samkhal/biped/deployments","created_at":"2016-02-13T23:16:07Z","updated_at":"2016-02-13T23:17:11Z","pushed_at":"2016-12-11T00:23:08Z","git_url":"git://github.com/samkhal/biped.git","ssh_url":"git@github.com:samkhal/biped.git","clone_url":"https://github.com/samkhal/biped.git","svn_url":"https://github.com/samkhal/biped","homepage":null,"size":184168,"stargazers_count":0,"watchers_count":0,"language":"Matlab","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"samkhal:master","ref":"master","sha":"33693620ab26fbfae6da929271d678e7c42ddbf4","user":{"login":"samkhal","id":5384883,"avatar_url":"https://avatars.githubusercontent.com/u/5384883?v=3","gravatar_id":"","url":"https://api.github.com/users/samkhal","html_url":"https://github.com/samkhal","followers_url":"https://api.github.com/users/samkhal/followers","following_url":"https://api.github.com/users/samkhal/following{/other_user}","gists_url":"https://api.github.com/users/samkhal/gists{/gist_id}","starred_url":"https://api.github.com/users/samkhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samkhal/subscriptions","organizations_url":"https://api.github.com/users/samkhal/orgs","repos_url":"https://api.github.com/users/samkhal/repos","events_url":"https://api.github.com/users/samkhal/events{/privacy}","received_events_url":"https://api.github.com/users/samkhal/received_events","type":"User","site_admin":false},"repo":{"id":51670384,"name":"biped","full_name":"samkhal/biped","owner":{"login":"samkhal","id":5384883,"avatar_url":"https://avatars.githubusercontent.com/u/5384883?v=3","gravatar_id":"","url":"https://api.github.com/users/samkhal","html_url":"https://github.com/samkhal","followers_url":"https://api.github.com/users/samkhal/followers","following_url":"https://api.github.com/users/samkhal/following{/other_user}","gists_url":"https://api.github.com/users/samkhal/gists{/gist_id}","starred_url":"https://api.github.com/users/samkhal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samkhal/subscriptions","organizations_url":"https://api.github.com/users/samkhal/orgs","repos_url":"https://api.github.com/users/samkhal/repos","events_url":"https://api.github.com/users/samkhal/events{/privacy}","received_events_url":"https://api.github.com/users/samkhal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samkhal/biped","description":null,"fork":false,"url":"https://api.github.com/repos/samkhal/biped","forks_url":"https://api.github.com/repos/samkhal/biped/forks","keys_url":"https://api.github.com/repos/samkhal/biped/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samkhal/biped/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samkhal/biped/teams","hooks_url":"https://api.github.com/repos/samkhal/biped/hooks","issue_events_url":"https://api.github.com/repos/samkhal/biped/issues/events{/number}","events_url":"https://api.github.com/repos/samkhal/biped/events","assignees_url":"https://api.github.com/repos/samkhal/biped/assignees{/user}","branches_url":"https://api.github.com/repos/samkhal/biped/branches{/branch}","tags_url":"https://api.github.com/repos/samkhal/biped/tags","blobs_url":"https://api.github.com/repos/samkhal/biped/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samkhal/biped/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samkhal/biped/git/refs{/sha}","trees_url":"https://api.github.com/repos/samkhal/biped/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samkhal/biped/statuses/{sha}","languages_url":"https://api.github.com/repos/samkhal/biped/languages","stargazers_url":"https://api.github.com/repos/samkhal/biped/stargazers","contributors_url":"https://api.github.com/repos/samkhal/biped/contributors","subscribers_url":"https://api.github.com/repos/samkhal/biped/subscribers","subscription_url":"https://api.github.com/repos/samkhal/biped/subscription","commits_url":"https://api.github.com/repos/samkhal/biped/commits{/sha}","git_commits_url":"https://api.github.com/repos/samkhal/biped/git/commits{/sha}","comments_url":"https://api.github.com/repos/samkhal/biped/comments{/number}","issue_comment_url":"https://api.github.com/repos/samkhal/biped/issues/comments{/number}","contents_url":"https://api.github.com/repos/samkhal/biped/contents/{+path}","compare_url":"https://api.github.com/repos/samkhal/biped/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samkhal/biped/merges","archive_url":"https://api.github.com/repos/samkhal/biped/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samkhal/biped/downloads","issues_url":"https://api.github.com/repos/samkhal/biped/issues{/number}","pulls_url":"https://api.github.com/repos/samkhal/biped/pulls{/number}","milestones_url":"https://api.github.com/repos/samkhal/biped/milestones{/number}","notifications_url":"https://api.github.com/repos/samkhal/biped/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samkhal/biped/labels{/name}","releases_url":"https://api.github.com/repos/samkhal/biped/releases{/id}","deployments_url":"https://api.github.com/repos/samkhal/biped/deployments","created_at":"2016-02-13T23:16:07Z","updated_at":"2016-02-13T23:17:11Z","pushed_at":"2016-12-11T00:23:08Z","git_url":"git://github.com/samkhal/biped.git","ssh_url":"git@github.com:samkhal/biped.git","clone_url":"https://github.com/samkhal/biped.git","svn_url":"https://github.com/samkhal/biped","homepage":null,"size":184168,"stargazers_count":0,"watchers_count":0,"language":"Matlab","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/samkhal/biped/pulls/7"},"html":{"href":"https://github.com/samkhal/biped/pull/7"},"issue":{"href":"https://api.github.com/repos/samkhal/biped/issues/7"},"comments":{"href":"https://api.github.com/repos/samkhal/biped/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/samkhal/biped/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/samkhal/biped/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/samkhal/biped/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/samkhal/biped/statuses/913113fa36a8073e26695b3f3c4bec2e999944d4"}}}}
{"actor":{"display_login":"samkhal"}}