{"action":"created","comment":{"url":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/comments/44688892","id":44688892,"diff_hunk":"@@ -0,0 +1,95 @@\n+/**\n+ *\n+ *  \\file\n+ *  \\brief      Cooling control class for Ridgeback\n+ *  \\author     Tony Baltovski <tbaltovski@clearpathrobotics.com>\n+ *  \\copyright  Copyright (c) 2015, Clearpath Robotics, Inc.\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\n+ *       notice, 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 Clearpath Robotics, Inc. nor the\n+ *       names of its contributors may be used to endorse or promote products\n+ *       derived from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+ * DISCLAIMED. IN NO EVENT SHALL CLEARPATH ROBOTICS, INC. BE LIABLE FOR ANY\n+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ *\n+ * Please send comments, questions, or patches to code@clearpathrobotics.com\n+ *\n+ */\n+\n+#include \"ridgeback_base/ridgeback_cooling.h\"\n+\n+\n+namespace ridgeback_base\n+{\n+\n+RidgebackCooling::RidgebackCooling(ros::NodeHandle* nh) :\n+  nh_(nh),\n+  charger_disconnected_(true)\n+{\n+  cmd_fans_pub_ = nh_->advertise<ridgeback_msgs::Fans>(\"mcu/fans\", 1);\n+\n+  status_sub_ = nh_->subscribe(\"mcu/status\", 1, &RidgebackCooling::statusCallback, this);\n+  cmd_vel_sub_ = nh_->subscribe(\"cmd_vel\", 1, &RidgebackCooling::cmdVelCallback, this);\n+\n+  for (int i = 0; i < 6; i++)\n+  {\n+    cmd_fans_msg_.fans[i] = ridgeback_msgs::Fans::FAN_ON_LOW;\n+  }\n+}\n+\n+void RidgebackCooling::statusCallback(const ridgeback_msgs::Status::ConstPtr& status)\n+{\n+  if (status->charger_connected)\n+  {\n+    cmd_fans_msg_.fans[ridgeback_msgs::Fans::CHARGER_BAY_INTAKE] = ridgeback_msgs::Fans::FAN_ON_HIGH;\n+    cmd_fans_msg_.fans[ridgeback_msgs::Fans::CHARGER_BAY_EXHAUST] = ridgeback_msgs::Fans::FAN_ON_HIGH;\n+    charger_disconnected_ = false;\n+  }\n+  else if (!charger_disconnected_)\n+  {\n+    cmd_fans_msg_.fans[ridgeback_msgs::Fans::CHARGER_BAY_INTAKE] = ridgeback_msgs::Fans::FAN_ON_LOW;\n+    cmd_fans_msg_.fans[ridgeback_msgs::Fans::CHARGER_BAY_EXHAUST] = ridgeback_msgs::Fans::FAN_ON_LOW;\n+    charger_disconnected_ = true;\n+  }\n+\n+  cmd_fans_pub_.publish(cmd_fans_msg_);\n+}\n+void RidgebackCooling::cmdVelCallback(const geometry_msgs::Twist::ConstPtr& twist)\n+{\n+  if (twist->linear.x >= 0.1 ||\n+      twist->linear.y >= 0.1 ||\n+      twist->angular.z >= 0.4)","path":"ridgeback_base/src/ridgeback_cooling.cpp","position":76,"original_position":76,"commit_id":"0f9adefcc45975c92afd8f74d49f3aadc7598026","original_commit_id":"0f9adefcc45975c92afd8f74d49f3aadc7598026","user":{"login":"mikepurvis","id":944666,"avatar_url":"https://avatars.githubusercontent.com/u/944666?v=3","gravatar_id":"","url":"https://api.github.com/users/mikepurvis","html_url":"https://github.com/mikepurvis","followers_url":"https://api.github.com/users/mikepurvis/followers","following_url":"https://api.github.com/users/mikepurvis/following{/other_user}","gists_url":"https://api.github.com/users/mikepurvis/gists{/gist_id}","starred_url":"https://api.github.com/users/mikepurvis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikepurvis/subscriptions","organizations_url":"https://api.github.com/users/mikepurvis/orgs","repos_url":"https://api.github.com/users/mikepurvis/repos","events_url":"https://api.github.com/users/mikepurvis/events{/privacy}","received_events_url":"https://api.github.com/users/mikepurvis/received_events","type":"User","site_admin":false},"body":"Parameterize these motion thresholds, or at least make them a constant?","created_at":"2015-11-12T17:44:53Z","updated_at":"2015-11-12T17:44:53Z","html_url":"https://github.com/ridgeback/ridgeback_robot/pull/8#discussion_r44688892","pull_request_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/8","_links":{"self":{"href":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/comments/44688892"},"html":{"href":"https://github.com/ridgeback/ridgeback_robot/pull/8#discussion_r44688892"},"pull_request":{"href":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/8","id":50535552,"html_url":"https://github.com/ridgeback/ridgeback_robot/pull/8","diff_url":"https://github.com/ridgeback/ridgeback_robot/pull/8.diff","patch_url":"https://github.com/ridgeback/ridgeback_robot/pull/8.patch","issue_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues/8","number":8,"state":"open","locked":false,"title":"Added cooling.","user":{"login":"tonybaltovski","id":2964763,"avatar_url":"https://avatars.githubusercontent.com/u/2964763?v=3","gravatar_id":"","url":"https://api.github.com/users/tonybaltovski","html_url":"https://github.com/tonybaltovski","followers_url":"https://api.github.com/users/tonybaltovski/followers","following_url":"https://api.github.com/users/tonybaltovski/following{/other_user}","gists_url":"https://api.github.com/users/tonybaltovski/gists{/gist_id}","starred_url":"https://api.github.com/users/tonybaltovski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonybaltovski/subscriptions","organizations_url":"https://api.github.com/users/tonybaltovski/orgs","repos_url":"https://api.github.com/users/tonybaltovski/repos","events_url":"https://api.github.com/users/tonybaltovski/events{/privacy}","received_events_url":"https://api.github.com/users/tonybaltovski/received_events","type":"User","site_admin":false},"body":"@mikepurvis Added cooling based on `cmd_vel` and charger being connected. ","created_at":"2015-11-12T16:46:41Z","updated_at":"2015-11-12T17:44:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af2b29b474efb914de5e15b291f48b737a21aeb8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/8/commits","review_comments_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/8/comments","review_comment_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues/8/comments","statuses_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/statuses/0f9adefcc45975c92afd8f74d49f3aadc7598026","head":{"label":"ridgeback:cooling","ref":"cooling","sha":"0f9adefcc45975c92afd8f74d49f3aadc7598026","user":{"login":"ridgeback","id":11037221,"avatar_url":"https://avatars.githubusercontent.com/u/11037221?v=3","gravatar_id":"","url":"https://api.github.com/users/ridgeback","html_url":"https://github.com/ridgeback","followers_url":"https://api.github.com/users/ridgeback/followers","following_url":"https://api.github.com/users/ridgeback/following{/other_user}","gists_url":"https://api.github.com/users/ridgeback/gists{/gist_id}","starred_url":"https://api.github.com/users/ridgeback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridgeback/subscriptions","organizations_url":"https://api.github.com/users/ridgeback/orgs","repos_url":"https://api.github.com/users/ridgeback/repos","events_url":"https://api.github.com/users/ridgeback/events{/privacy}","received_events_url":"https://api.github.com/users/ridgeback/received_events","type":"Organization","site_admin":false},"repo":{"id":44987772,"name":"ridgeback_robot","full_name":"ridgeback/ridgeback_robot","owner":{"login":"ridgeback","id":11037221,"avatar_url":"https://avatars.githubusercontent.com/u/11037221?v=3","gravatar_id":"","url":"https://api.github.com/users/ridgeback","html_url":"https://github.com/ridgeback","followers_url":"https://api.github.com/users/ridgeback/followers","following_url":"https://api.github.com/users/ridgeback/following{/other_user}","gists_url":"https://api.github.com/users/ridgeback/gists{/gist_id}","starred_url":"https://api.github.com/users/ridgeback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridgeback/subscriptions","organizations_url":"https://api.github.com/users/ridgeback/orgs","repos_url":"https://api.github.com/users/ridgeback/repos","events_url":"https://api.github.com/users/ridgeback/events{/privacy}","received_events_url":"https://api.github.com/users/ridgeback/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ridgeback/ridgeback_robot","description":"Robot packages for Ridgeback.","fork":false,"url":"https://api.github.com/repos/ridgeback/ridgeback_robot","forks_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/forks","keys_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/teams","hooks_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/hooks","issue_events_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues/events{/number}","events_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/events","assignees_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/assignees{/user}","branches_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/branches{/branch}","tags_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/tags","blobs_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/refs{/sha}","trees_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/statuses/{sha}","languages_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/languages","stargazers_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/stargazers","contributors_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/contributors","subscribers_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/subscribers","subscription_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/subscription","commits_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/commits{/sha}","git_commits_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/commits{/sha}","comments_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/comments{/number}","issue_comment_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues/comments{/number}","contents_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/contents/{+path}","compare_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/merges","archive_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/downloads","issues_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues{/number}","pulls_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls{/number}","milestones_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/milestones{/number}","notifications_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/labels{/name}","releases_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/releases{/id}","created_at":"2015-10-26T18:09:01Z","updated_at":"2015-10-26T18:12:03Z","pushed_at":"2015-11-12T16:47:41Z","git_url":"git://github.com/ridgeback/ridgeback_robot.git","ssh_url":"git@github.com:ridgeback/ridgeback_robot.git","clone_url":"https://github.com/ridgeback/ridgeback_robot.git","svn_url":"https://github.com/ridgeback/ridgeback_robot","homepage":null,"size":368,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"indigo-devel"}},"base":{"label":"ridgeback:indigo-devel","ref":"indigo-devel","sha":"4443fe73aeac5028cf39cac04b67ce1fafdb2f6c","user":{"login":"ridgeback","id":11037221,"avatar_url":"https://avatars.githubusercontent.com/u/11037221?v=3","gravatar_id":"","url":"https://api.github.com/users/ridgeback","html_url":"https://github.com/ridgeback","followers_url":"https://api.github.com/users/ridgeback/followers","following_url":"https://api.github.com/users/ridgeback/following{/other_user}","gists_url":"https://api.github.com/users/ridgeback/gists{/gist_id}","starred_url":"https://api.github.com/users/ridgeback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridgeback/subscriptions","organizations_url":"https://api.github.com/users/ridgeback/orgs","repos_url":"https://api.github.com/users/ridgeback/repos","events_url":"https://api.github.com/users/ridgeback/events{/privacy}","received_events_url":"https://api.github.com/users/ridgeback/received_events","type":"Organization","site_admin":false},"repo":{"id":44987772,"name":"ridgeback_robot","full_name":"ridgeback/ridgeback_robot","owner":{"login":"ridgeback","id":11037221,"avatar_url":"https://avatars.githubusercontent.com/u/11037221?v=3","gravatar_id":"","url":"https://api.github.com/users/ridgeback","html_url":"https://github.com/ridgeback","followers_url":"https://api.github.com/users/ridgeback/followers","following_url":"https://api.github.com/users/ridgeback/following{/other_user}","gists_url":"https://api.github.com/users/ridgeback/gists{/gist_id}","starred_url":"https://api.github.com/users/ridgeback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridgeback/subscriptions","organizations_url":"https://api.github.com/users/ridgeback/orgs","repos_url":"https://api.github.com/users/ridgeback/repos","events_url":"https://api.github.com/users/ridgeback/events{/privacy}","received_events_url":"https://api.github.com/users/ridgeback/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ridgeback/ridgeback_robot","description":"Robot packages for Ridgeback.","fork":false,"url":"https://api.github.com/repos/ridgeback/ridgeback_robot","forks_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/forks","keys_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/teams","hooks_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/hooks","issue_events_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues/events{/number}","events_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/events","assignees_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/assignees{/user}","branches_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/branches{/branch}","tags_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/tags","blobs_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/refs{/sha}","trees_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/statuses/{sha}","languages_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/languages","stargazers_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/stargazers","contributors_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/contributors","subscribers_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/subscribers","subscription_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/subscription","commits_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/commits{/sha}","git_commits_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/git/commits{/sha}","comments_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/comments{/number}","issue_comment_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues/comments{/number}","contents_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/contents/{+path}","compare_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/merges","archive_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/downloads","issues_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues{/number}","pulls_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls{/number}","milestones_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/milestones{/number}","notifications_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/labels{/name}","releases_url":"https://api.github.com/repos/ridgeback/ridgeback_robot/releases{/id}","created_at":"2015-10-26T18:09:01Z","updated_at":"2015-10-26T18:12:03Z","pushed_at":"2015-11-12T16:47:41Z","git_url":"git://github.com/ridgeback/ridgeback_robot.git","ssh_url":"git@github.com:ridgeback/ridgeback_robot.git","clone_url":"https://github.com/ridgeback/ridgeback_robot.git","svn_url":"https://github.com/ridgeback/ridgeback_robot","homepage":null,"size":368,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"indigo-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/8"},"html":{"href":"https://github.com/ridgeback/ridgeback_robot/pull/8"},"issue":{"href":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues/8"},"comments":{"href":"https://api.github.com/repos/ridgeback/ridgeback_robot/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ridgeback/ridgeback_robot/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/ridgeback/ridgeback_robot/statuses/0f9adefcc45975c92afd8f74d49f3aadc7598026"}}}}