{"action":"created","comment":{"url":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/comments/37756424","id":37756424,"diff_hunk":"@@ -19,20 +19,27 @@ class JpCircle : public systems::SingleIO<double, typename units::JointPositions\n \n public:\n \tJpCircle(jp_type startPos, double amplitude, double omega, const std::string& sysName = \"JpCircle\") :\n-\t\tsystems::SingleIO<double, jp_type>(sysName), jp(startPos), j3_0(jp[2]), j4_0(jp[3]), amp(amplitude), omega(omega) {}\n+\t\tsystems::SingleIO<double, jp_type>(sysName), jp(startPos), jp_0(jp), amp(amplitude), omega(omega) {}\n \tvirtual ~JpCircle() { this->mandatoryCleanUp(); }\n \n protected:\n \tjp_type jp;\n-\tdouble j3_0, j4_0;\n+\tjp_type jp_0;\n \tdouble amp, omega;\n \tdouble theta;\n \n \tvirtual void operate() {\n \t\ttheta = omega * this->input.getValue();\n \n-\t\tjp[2] = amp * std::sin(theta) + j3_0;\n-\t\tjp[3] = amp * (std::cos(theta) - 1.0) + j4_0;\n+    if (DOF>3) {\n+      // WAM - Use joints 3 and 4.\n+      jp[2] = amp * std::sin(theta) + jp_0[2];\n+      jp[3] = amp * (std::cos(theta) - 1.0) + jp_0[3];\n+    } else {\n+      // Proficio - Use joints 2 and 3.\n+      jp[1] = amp * std::sin(theta) + jp_0[1];\n+      jp[2] = amp * (std::cos(theta) - 1.0) + jp_0[2];\n+    }\n ","path":"examples/ex06_realtime_move.cpp","position":29,"original_position":29,"commit_id":"b8cfba476441419d64a00481b509d7d80204675c","original_commit_id":"b8cfba476441419d64a00481b509d7d80204675c","user":{"login":"mhariharasudan","id":4086319,"avatar_url":"https://avatars.githubusercontent.com/u/4086319?v=3","gravatar_id":"","url":"https://api.github.com/users/mhariharasudan","html_url":"https://github.com/mhariharasudan","followers_url":"https://api.github.com/users/mhariharasudan/followers","following_url":"https://api.github.com/users/mhariharasudan/following{/other_user}","gists_url":"https://api.github.com/users/mhariharasudan/gists{/gist_id}","starred_url":"https://api.github.com/users/mhariharasudan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhariharasudan/subscriptions","organizations_url":"https://api.github.com/users/mhariharasudan/orgs","repos_url":"https://api.github.com/users/mhariharasudan/repos","events_url":"https://api.github.com/users/mhariharasudan/events{/privacy}","received_events_url":"https://api.github.com/users/mhariharasudan/received_events","type":"User","site_admin":false},"body":"Instead of checking the DOF inside the operate which loops continuously, can we perform the check once in the constructor and assign variables to it. Something like this.\r\nJpCircle(...) : ... {\r\n   if (DOF>3) {\r\n      i =2;\r\n      j = 3;\r\n  } else {\r\n     i = 1;\r\n     j =2;\r\n  }\r\n}\r\nint i,j;\r\n.\r\n.\r\n.\r\nvoid operate() {\r\n.\r\n.\r\n.\r\njp[i] = ....... jp_0[i];\r\njp[j] = ....... jp_0[j];","created_at":"2015-08-24T14:26:13Z","updated_at":"2015-08-24T14:26:13Z","html_url":"https://github.com/BarrettTechnology/libbarrett/pull/16#discussion_r37756424","pull_request_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/comments/37756424"},"html":{"href":"https://github.com/BarrettTechnology/libbarrett/pull/16#discussion_r37756424"},"pull_request":{"href":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/16","id":43079932,"html_url":"https://github.com/BarrettTechnology/libbarrett/pull/16","diff_url":"https://github.com/BarrettTechnology/libbarrett/pull/16.diff","patch_url":"https://github.com/BarrettTechnology/libbarrett/pull/16.patch","issue_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues/16","number":16,"state":"open","locked":false,"title":"Updated ex06 to work with Proficio","user":{"login":"amyblank","id":2780999,"avatar_url":"https://avatars.githubusercontent.com/u/2780999?v=3","gravatar_id":"","url":"https://api.github.com/users/amyblank","html_url":"https://github.com/amyblank","followers_url":"https://api.github.com/users/amyblank/followers","following_url":"https://api.github.com/users/amyblank/following{/other_user}","gists_url":"https://api.github.com/users/amyblank/gists{/gist_id}","starred_url":"https://api.github.com/users/amyblank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amyblank/subscriptions","organizations_url":"https://api.github.com/users/amyblank/orgs","repos_url":"https://api.github.com/users/amyblank/repos","events_url":"https://api.github.com/users/amyblank/events{/privacy}","received_events_url":"https://api.github.com/users/amyblank/received_events","type":"User","site_admin":false},"body":"Checks for robot type (WAM vs Proficio) and configuration (if Proficio).","created_at":"2015-08-21T20:53:17Z","updated_at":"2015-08-24T14:26:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e2c986512865cb6590859e957b79ca59a286c8b3","assignee":{"login":"mhariharasudan","id":4086319,"avatar_url":"https://avatars.githubusercontent.com/u/4086319?v=3","gravatar_id":"","url":"https://api.github.com/users/mhariharasudan","html_url":"https://github.com/mhariharasudan","followers_url":"https://api.github.com/users/mhariharasudan/followers","following_url":"https://api.github.com/users/mhariharasudan/following{/other_user}","gists_url":"https://api.github.com/users/mhariharasudan/gists{/gist_id}","starred_url":"https://api.github.com/users/mhariharasudan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhariharasudan/subscriptions","organizations_url":"https://api.github.com/users/mhariharasudan/orgs","repos_url":"https://api.github.com/users/mhariharasudan/repos","events_url":"https://api.github.com/users/mhariharasudan/events{/privacy}","received_events_url":"https://api.github.com/users/mhariharasudan/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/16/commits","review_comments_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/16/comments","review_comment_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues/16/comments","statuses_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/statuses/b8cfba476441419d64a00481b509d7d80204675c","head":{"label":"BarrettTechnology:ex06-proficio-fix","ref":"ex06-proficio-fix","sha":"b8cfba476441419d64a00481b509d7d80204675c","user":{"login":"BarrettTechnology","id":8998952,"avatar_url":"https://avatars.githubusercontent.com/u/8998952?v=3","gravatar_id":"","url":"https://api.github.com/users/BarrettTechnology","html_url":"https://github.com/BarrettTechnology","followers_url":"https://api.github.com/users/BarrettTechnology/followers","following_url":"https://api.github.com/users/BarrettTechnology/following{/other_user}","gists_url":"https://api.github.com/users/BarrettTechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/BarrettTechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BarrettTechnology/subscriptions","organizations_url":"https://api.github.com/users/BarrettTechnology/orgs","repos_url":"https://api.github.com/users/BarrettTechnology/repos","events_url":"https://api.github.com/users/BarrettTechnology/events{/privacy}","received_events_url":"https://api.github.com/users/BarrettTechnology/received_events","type":"Organization","site_admin":false},"repo":{"id":31773383,"name":"libbarrett","full_name":"BarrettTechnology/libbarrett","owner":{"login":"BarrettTechnology","id":8998952,"avatar_url":"https://avatars.githubusercontent.com/u/8998952?v=3","gravatar_id":"","url":"https://api.github.com/users/BarrettTechnology","html_url":"https://github.com/BarrettTechnology","followers_url":"https://api.github.com/users/BarrettTechnology/followers","following_url":"https://api.github.com/users/BarrettTechnology/following{/other_user}","gists_url":"https://api.github.com/users/BarrettTechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/BarrettTechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BarrettTechnology/subscriptions","organizations_url":"https://api.github.com/users/BarrettTechnology/orgs","repos_url":"https://api.github.com/users/BarrettTechnology/repos","events_url":"https://api.github.com/users/BarrettTechnology/events{/privacy}","received_events_url":"https://api.github.com/users/BarrettTechnology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BarrettTechnology/libbarrett","description":"Communication and controls library for Barrett products","fork":false,"url":"https://api.github.com/repos/BarrettTechnology/libbarrett","forks_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/forks","keys_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/teams","hooks_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/hooks","issue_events_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues/events{/number}","events_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/events","assignees_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/assignees{/user}","branches_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/branches{/branch}","tags_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/tags","blobs_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/refs{/sha}","trees_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/statuses/{sha}","languages_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/languages","stargazers_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/stargazers","contributors_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/contributors","subscribers_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/subscribers","subscription_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/subscription","commits_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/commits{/sha}","git_commits_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/commits{/sha}","comments_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/comments{/number}","issue_comment_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues/comments{/number}","contents_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/contents/{+path}","compare_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/merges","archive_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/downloads","issues_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues{/number}","pulls_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls{/number}","milestones_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/milestones{/number}","notifications_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/labels{/name}","releases_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/releases{/id}","created_at":"2015-03-06T14:39:12Z","updated_at":"2015-08-04T11:19:19Z","pushed_at":"2015-08-21T20:53:17Z","git_url":"git://github.com/BarrettTechnology/libbarrett.git","ssh_url":"git@github.com:BarrettTechnology/libbarrett.git","clone_url":"https://github.com/BarrettTechnology/libbarrett.git","svn_url":"https://github.com/BarrettTechnology/libbarrett","homepage":"http://support.barrett.com","size":321548,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":1,"default_branch":"devel"}},"base":{"label":"BarrettTechnology:devel","ref":"devel","sha":"dafb43f9fbed74e436ada67c1d68407faf11920c","user":{"login":"BarrettTechnology","id":8998952,"avatar_url":"https://avatars.githubusercontent.com/u/8998952?v=3","gravatar_id":"","url":"https://api.github.com/users/BarrettTechnology","html_url":"https://github.com/BarrettTechnology","followers_url":"https://api.github.com/users/BarrettTechnology/followers","following_url":"https://api.github.com/users/BarrettTechnology/following{/other_user}","gists_url":"https://api.github.com/users/BarrettTechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/BarrettTechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BarrettTechnology/subscriptions","organizations_url":"https://api.github.com/users/BarrettTechnology/orgs","repos_url":"https://api.github.com/users/BarrettTechnology/repos","events_url":"https://api.github.com/users/BarrettTechnology/events{/privacy}","received_events_url":"https://api.github.com/users/BarrettTechnology/received_events","type":"Organization","site_admin":false},"repo":{"id":31773383,"name":"libbarrett","full_name":"BarrettTechnology/libbarrett","owner":{"login":"BarrettTechnology","id":8998952,"avatar_url":"https://avatars.githubusercontent.com/u/8998952?v=3","gravatar_id":"","url":"https://api.github.com/users/BarrettTechnology","html_url":"https://github.com/BarrettTechnology","followers_url":"https://api.github.com/users/BarrettTechnology/followers","following_url":"https://api.github.com/users/BarrettTechnology/following{/other_user}","gists_url":"https://api.github.com/users/BarrettTechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/BarrettTechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BarrettTechnology/subscriptions","organizations_url":"https://api.github.com/users/BarrettTechnology/orgs","repos_url":"https://api.github.com/users/BarrettTechnology/repos","events_url":"https://api.github.com/users/BarrettTechnology/events{/privacy}","received_events_url":"https://api.github.com/users/BarrettTechnology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BarrettTechnology/libbarrett","description":"Communication and controls library for Barrett products","fork":false,"url":"https://api.github.com/repos/BarrettTechnology/libbarrett","forks_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/forks","keys_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/teams","hooks_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/hooks","issue_events_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues/events{/number}","events_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/events","assignees_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/assignees{/user}","branches_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/branches{/branch}","tags_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/tags","blobs_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/refs{/sha}","trees_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/statuses/{sha}","languages_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/languages","stargazers_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/stargazers","contributors_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/contributors","subscribers_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/subscribers","subscription_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/subscription","commits_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/commits{/sha}","git_commits_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/git/commits{/sha}","comments_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/comments{/number}","issue_comment_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues/comments{/number}","contents_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/contents/{+path}","compare_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/merges","archive_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/downloads","issues_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues{/number}","pulls_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls{/number}","milestones_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/milestones{/number}","notifications_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/labels{/name}","releases_url":"https://api.github.com/repos/BarrettTechnology/libbarrett/releases{/id}","created_at":"2015-03-06T14:39:12Z","updated_at":"2015-08-04T11:19:19Z","pushed_at":"2015-08-21T20:53:17Z","git_url":"git://github.com/BarrettTechnology/libbarrett.git","ssh_url":"git@github.com:BarrettTechnology/libbarrett.git","clone_url":"https://github.com/BarrettTechnology/libbarrett.git","svn_url":"https://github.com/BarrettTechnology/libbarrett","homepage":"http://support.barrett.com","size":321548,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":1,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/16"},"html":{"href":"https://github.com/BarrettTechnology/libbarrett/pull/16"},"issue":{"href":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues/16"},"comments":{"href":"https://api.github.com/repos/BarrettTechnology/libbarrett/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BarrettTechnology/libbarrett/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/BarrettTechnology/libbarrett/statuses/b8cfba476441419d64a00481b509d7d80204675c"}}}}