{"action":"created","comment":{"url":"https://api.github.com/repos/uf-mil/Navigator/pulls/comments/81462713","pull_request_review_id":2442771,"id":81462713,"diff_hunk":"@@ -0,0 +1,128 @@\n+#!/usr/bin/env python\n+from Sabertooth2x12 import Sabertooth2x12\n+import roslib\n+import rospy\n+import actionlib\n+import time\n+from navigator_msgs.msg import ShooterDoAction, ShooterDoActionFeedback, ShooterDoActionResult\n+from std_srvs.srv import Trigger\n+\n+class ShooterControl:\n+  def loadExecuteCallback(self,goal):\n+    result = ShooterDoActionResult()\n+    if (self.fire_server.is_active()):\n+      rospy.loginfo(\"Something already running, aborting\")\n+      result.result.success = False\n+      result.result.error = result.result.ALREADY_RUNNING\n+      self.load_server.set_aborted(result)\n+      return    \n+    if self.loaded:\n+      rospy.loginfo(\"Already loaded, aborting\")\n+      result.result.success = False\n+      result.result.error = result.result.ALREADY_LOADED\n+      self.load_server.set_aborted(result)\n+      return\n+    start_time = rospy.get_rostime()\n+    dur_from_start = rospy.Duration(0,0)\n+    rospy.loginfo(\"starting load\")\n+    rate = rospy.Rate(50) # 10hz\n+    feedback = ShooterDoActionFeedback()\n+    while dur_from_start < self.load_total_time and self.load_server.is_active():\n+      dur_from_start = rospy.get_rostime() - start_time\n+      feedback.feedback.time_remaining = self.load_total_time - dur_from_start\n+      self.load_server.publish_feedback(feedback)\n+      if (dur_from_start < self.load_retract_time):\n+        self.motor_controller.setMotor1(1.0)\n+      elif (dur_from_start < self.load_total_time):\n+        self.motor_controller.setMotor1(-1.0)\n+      rate.sleep()\n+    if(not self.load_server.is_active()):\n+      return\n+    self.motor_controller.setMotor1(0)\n+    self.motor_controller.setMotor2(1)\n+    result.result.success = True\n+    self.loaded = True\n+    self.load_server.set_succeeded(result)\n+    rospy.loginfo(\"Finished loaded\")\n+  def fireExecuteCallback(self,goal):\n+    result = ShooterDoActionResult()\n+    if (self.load_server.is_active()):\n+      rospy.loginfo(\"Something already running, aborting\")\n+      result.result.success = False\n+      result.result.error = result.result.ALREADY_RUNNING\n+      self.fire_server.set_aborted(result)\n+      return    \n+    if not self.loaded:\n+      rospy.loginfo(\"Not loaded, aborting fire\")\n+      result.result.success = False\n+      result.result.error = result.result.NOT_LOADED\n+      self.fire_server.set_aborted(result)\n+      return\n+    start_time = rospy.get_rostime()\n+    dur_from_start = rospy.Duration(0,0)\n+    rospy.loginfo(\"starting fire\")\n+    rate = rospy.Rate(50) # 10hz\n+    feedback = ShooterDoActionFeedback()\n+    while dur_from_start < self.total_fire_time and self.fire_server.is_active():\n+      dur_from_start = rospy.get_rostime() - start_time\n+      feedback.feedback.time_remaining = self.total_fire_time - dur_from_start\n+      self.fire_server.publish_feedback(feedback)\n+      if (dur_from_start < self.fire_extend_time):\n+        self.motor_controller.setMotor1(-1)\n+      else:\n+        self.motor_controller.setMotor1(0)\n+      rate.sleep()\n+    if(not self.fire_server.is_active()):\n+      return\n+    self.motor_controller.setMotor1(0)\n+    self.motor_controller.setMotor2(0)\n+    result.result.success = True\n+    self.loaded = False\n+    self.fire_server.set_succeeded(result)\n+    rospy.loginfo(\"Finished fire\")\n+  def cancelCallback(self,req):\n+    result = ShooterDoActionResult()\n+    result.result.success = False\n+    result.result.error = result.result.MANUAL_CONTROL_USED\n+    if (self.load_server.is_active()):\n+      self.load_server.set_aborted(result)\n+    if (self.fire_server.is_active()):\n+      self.fire_server.set_aborted(result)\n+    time.sleep(0.1)","path":"mission_systems/shooter/nodes/ShooterControl.py","position":null,"original_position":91,"commit_id":"89f07f31bde1a18ad3bc013b90f52f4640753230","original_commit_id":"46d72b43b5a81e688d68080245e93a655472205d","user":{"login":"ironmig","id":9502636,"avatar_url":"https://avatars.githubusercontent.com/u/9502636?v=3","gravatar_id":"","url":"https://api.github.com/users/ironmig","html_url":"https://github.com/ironmig","followers_url":"https://api.github.com/users/ironmig/followers","following_url":"https://api.github.com/users/ironmig/following{/other_user}","gists_url":"https://api.github.com/users/ironmig/gists{/gist_id}","starred_url":"https://api.github.com/users/ironmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironmig/subscriptions","organizations_url":"https://api.github.com/users/ironmig/orgs","repos_url":"https://api.github.com/users/ironmig/repos","events_url":"https://api.github.com/users/ironmig/events{/privacy}","received_events_url":"https://api.github.com/users/ironmig/received_events","type":"User","site_admin":false},"body":"Fixed in  89f07f3 ","created_at":"2016-10-02T03:28:35Z","updated_at":"2016-10-02T03:28:35Z","html_url":"https://github.com/uf-mil/Navigator/pull/71#discussion_r81462713","pull_request_url":"https://api.github.com/repos/uf-mil/Navigator/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/uf-mil/Navigator/pulls/comments/81462713"},"html":{"href":"https://github.com/uf-mil/Navigator/pull/71#discussion_r81462713"},"pull_request":{"href":"https://api.github.com/repos/uf-mil/Navigator/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/uf-mil/Navigator/pulls/71","id":87567482,"html_url":"https://github.com/uf-mil/Navigator/pull/71","diff_url":"https://github.com/uf-mil/Navigator/pull/71.diff","patch_url":"https://github.com/uf-mil/Navigator/pull/71.patch","issue_url":"https://api.github.com/repos/uf-mil/Navigator/issues/71","number":71,"state":"open","locked":false,"title":"SHOOTER: Work with new motor controller + other improvements","user":{"login":"ironmig","id":9502636,"avatar_url":"https://avatars.githubusercontent.com/u/9502636?v=3","gravatar_id":"","url":"https://api.github.com/users/ironmig","html_url":"https://github.com/ironmig","followers_url":"https://api.github.com/users/ironmig/followers","following_url":"https://api.github.com/users/ironmig/following{/other_user}","gists_url":"https://api.github.com/users/ironmig/gists{/gist_id}","starred_url":"https://api.github.com/users/ironmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironmig/subscriptions","organizations_url":"https://api.github.com/users/ironmig/orgs","repos_url":"https://api.github.com/users/ironmig/repos","events_url":"https://api.github.com/users/ironmig/events{/privacy}","received_events_url":"https://api.github.com/users/ironmig/received_events","type":"User","site_admin":false},"body":"* Removed all arduino stuff (new motor controller operates directly over USB to main PC)\r\n* Shooter load/fire are now actionlib scripts\r\n * Will abort if invalid (double loading, firing without loading)\r\n * Receive feedback about when load/fire will be completed\r\n * Cannot try to do two things at once\r\n* Python class to interface with Sabertooth 2x12 (motor.set(1), etc) using pyserial","created_at":"2016-09-30T21:15:05Z","updated_at":"2016-10-02T03:28:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1829feca9b8005f829a5e9438e10a69e06e7b88b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/uf-mil/Navigator/pulls/71/commits","review_comments_url":"https://api.github.com/repos/uf-mil/Navigator/pulls/71/comments","review_comment_url":"https://api.github.com/repos/uf-mil/Navigator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uf-mil/Navigator/issues/71/comments","statuses_url":"https://api.github.com/repos/uf-mil/Navigator/statuses/89f07f31bde1a18ad3bc013b90f52f4640753230","head":{"label":"ironmig:shooter-dev","ref":"shooter-dev","sha":"89f07f31bde1a18ad3bc013b90f52f4640753230","user":{"login":"ironmig","id":9502636,"avatar_url":"https://avatars.githubusercontent.com/u/9502636?v=3","gravatar_id":"","url":"https://api.github.com/users/ironmig","html_url":"https://github.com/ironmig","followers_url":"https://api.github.com/users/ironmig/followers","following_url":"https://api.github.com/users/ironmig/following{/other_user}","gists_url":"https://api.github.com/users/ironmig/gists{/gist_id}","starred_url":"https://api.github.com/users/ironmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironmig/subscriptions","organizations_url":"https://api.github.com/users/ironmig/orgs","repos_url":"https://api.github.com/users/ironmig/repos","events_url":"https://api.github.com/users/ironmig/events{/privacy}","received_events_url":"https://api.github.com/users/ironmig/received_events","type":"User","site_admin":false},"repo":{"id":62825057,"name":"Navigator","full_name":"ironmig/Navigator","owner":{"login":"ironmig","id":9502636,"avatar_url":"https://avatars.githubusercontent.com/u/9502636?v=3","gravatar_id":"","url":"https://api.github.com/users/ironmig","html_url":"https://github.com/ironmig","followers_url":"https://api.github.com/users/ironmig/followers","following_url":"https://api.github.com/users/ironmig/following{/other_user}","gists_url":"https://api.github.com/users/ironmig/gists{/gist_id}","starred_url":"https://api.github.com/users/ironmig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ironmig/subscriptions","organizations_url":"https://api.github.com/users/ironmig/orgs","repos_url":"https://api.github.com/users/ironmig/repos","events_url":"https://api.github.com/users/ironmig/events{/privacy}","received_events_url":"https://api.github.com/users/ironmig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ironmig/Navigator","description":"On board software for UF's NaviGator Autonomous Surface Vehicle","fork":true,"url":"https://api.github.com/repos/ironmig/Navigator","forks_url":"https://api.github.com/repos/ironmig/Navigator/forks","keys_url":"https://api.github.com/repos/ironmig/Navigator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ironmig/Navigator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ironmig/Navigator/teams","hooks_url":"https://api.github.com/repos/ironmig/Navigator/hooks","issue_events_url":"https://api.github.com/repos/ironmig/Navigator/issues/events{/number}","events_url":"https://api.github.com/repos/ironmig/Navigator/events","assignees_url":"https://api.github.com/repos/ironmig/Navigator/assignees{/user}","branches_url":"https://api.github.com/repos/ironmig/Navigator/branches{/branch}","tags_url":"https://api.github.com/repos/ironmig/Navigator/tags","blobs_url":"https://api.github.com/repos/ironmig/Navigator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ironmig/Navigator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ironmig/Navigator/git/refs{/sha}","trees_url":"https://api.github.com/repos/ironmig/Navigator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ironmig/Navigator/statuses/{sha}","languages_url":"https://api.github.com/repos/ironmig/Navigator/languages","stargazers_url":"https://api.github.com/repos/ironmig/Navigator/stargazers","contributors_url":"https://api.github.com/repos/ironmig/Navigator/contributors","subscribers_url":"https://api.github.com/repos/ironmig/Navigator/subscribers","subscription_url":"https://api.github.com/repos/ironmig/Navigator/subscription","commits_url":"https://api.github.com/repos/ironmig/Navigator/commits{/sha}","git_commits_url":"https://api.github.com/repos/ironmig/Navigator/git/commits{/sha}","comments_url":"https://api.github.com/repos/ironmig/Navigator/comments{/number}","issue_comment_url":"https://api.github.com/repos/ironmig/Navigator/issues/comments{/number}","contents_url":"https://api.github.com/repos/ironmig/Navigator/contents/{+path}","compare_url":"https://api.github.com/repos/ironmig/Navigator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ironmig/Navigator/merges","archive_url":"https://api.github.com/repos/ironmig/Navigator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ironmig/Navigator/downloads","issues_url":"https://api.github.com/repos/ironmig/Navigator/issues{/number}","pulls_url":"https://api.github.com/repos/ironmig/Navigator/pulls{/number}","milestones_url":"https://api.github.com/repos/ironmig/Navigator/milestones{/number}","notifications_url":"https://api.github.com/repos/ironmig/Navigator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ironmig/Navigator/labels{/name}","releases_url":"https://api.github.com/repos/ironmig/Navigator/releases{/id}","deployments_url":"https://api.github.com/repos/ironmig/Navigator/deployments","created_at":"2016-07-07T17:18:13Z","updated_at":"2016-07-07T17:18:14Z","pushed_at":"2016-10-02T03:24:16Z","git_url":"git://github.com/ironmig/Navigator.git","ssh_url":"git@github.com:ironmig/Navigator.git","clone_url":"https://github.com/ironmig/Navigator.git","svn_url":"https://github.com/ironmig/Navigator","homepage":"","size":2915,"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":"master"}},"base":{"label":"uf-mil:dev","ref":"dev","sha":"b99f3b281d3a947e217256346eba27795e737064","user":{"login":"uf-mil","id":6162945,"avatar_url":"https://avatars.githubusercontent.com/u/6162945?v=3","gravatar_id":"","url":"https://api.github.com/users/uf-mil","html_url":"https://github.com/uf-mil","followers_url":"https://api.github.com/users/uf-mil/followers","following_url":"https://api.github.com/users/uf-mil/following{/other_user}","gists_url":"https://api.github.com/users/uf-mil/gists{/gist_id}","starred_url":"https://api.github.com/users/uf-mil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uf-mil/subscriptions","organizations_url":"https://api.github.com/users/uf-mil/orgs","repos_url":"https://api.github.com/users/uf-mil/repos","events_url":"https://api.github.com/users/uf-mil/events{/privacy}","received_events_url":"https://api.github.com/users/uf-mil/received_events","type":"Organization","site_admin":false},"repo":{"id":42456121,"name":"Navigator","full_name":"uf-mil/Navigator","owner":{"login":"uf-mil","id":6162945,"avatar_url":"https://avatars.githubusercontent.com/u/6162945?v=3","gravatar_id":"","url":"https://api.github.com/users/uf-mil","html_url":"https://github.com/uf-mil","followers_url":"https://api.github.com/users/uf-mil/followers","following_url":"https://api.github.com/users/uf-mil/following{/other_user}","gists_url":"https://api.github.com/users/uf-mil/gists{/gist_id}","starred_url":"https://api.github.com/users/uf-mil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uf-mil/subscriptions","organizations_url":"https://api.github.com/users/uf-mil/orgs","repos_url":"https://api.github.com/users/uf-mil/repos","events_url":"https://api.github.com/users/uf-mil/events{/privacy}","received_events_url":"https://api.github.com/users/uf-mil/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uf-mil/Navigator","description":"On board software for UF's NaviGator Autonomous Surface Vehicle","fork":false,"url":"https://api.github.com/repos/uf-mil/Navigator","forks_url":"https://api.github.com/repos/uf-mil/Navigator/forks","keys_url":"https://api.github.com/repos/uf-mil/Navigator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uf-mil/Navigator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uf-mil/Navigator/teams","hooks_url":"https://api.github.com/repos/uf-mil/Navigator/hooks","issue_events_url":"https://api.github.com/repos/uf-mil/Navigator/issues/events{/number}","events_url":"https://api.github.com/repos/uf-mil/Navigator/events","assignees_url":"https://api.github.com/repos/uf-mil/Navigator/assignees{/user}","branches_url":"https://api.github.com/repos/uf-mil/Navigator/branches{/branch}","tags_url":"https://api.github.com/repos/uf-mil/Navigator/tags","blobs_url":"https://api.github.com/repos/uf-mil/Navigator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uf-mil/Navigator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uf-mil/Navigator/git/refs{/sha}","trees_url":"https://api.github.com/repos/uf-mil/Navigator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uf-mil/Navigator/statuses/{sha}","languages_url":"https://api.github.com/repos/uf-mil/Navigator/languages","stargazers_url":"https://api.github.com/repos/uf-mil/Navigator/stargazers","contributors_url":"https://api.github.com/repos/uf-mil/Navigator/contributors","subscribers_url":"https://api.github.com/repos/uf-mil/Navigator/subscribers","subscription_url":"https://api.github.com/repos/uf-mil/Navigator/subscription","commits_url":"https://api.github.com/repos/uf-mil/Navigator/commits{/sha}","git_commits_url":"https://api.github.com/repos/uf-mil/Navigator/git/commits{/sha}","comments_url":"https://api.github.com/repos/uf-mil/Navigator/comments{/number}","issue_comment_url":"https://api.github.com/repos/uf-mil/Navigator/issues/comments{/number}","contents_url":"https://api.github.com/repos/uf-mil/Navigator/contents/{+path}","compare_url":"https://api.github.com/repos/uf-mil/Navigator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uf-mil/Navigator/merges","archive_url":"https://api.github.com/repos/uf-mil/Navigator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uf-mil/Navigator/downloads","issues_url":"https://api.github.com/repos/uf-mil/Navigator/issues{/number}","pulls_url":"https://api.github.com/repos/uf-mil/Navigator/pulls{/number}","milestones_url":"https://api.github.com/repos/uf-mil/Navigator/milestones{/number}","notifications_url":"https://api.github.com/repos/uf-mil/Navigator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uf-mil/Navigator/labels{/name}","releases_url":"https://api.github.com/repos/uf-mil/Navigator/releases{/id}","deployments_url":"https://api.github.com/repos/uf-mil/Navigator/deployments","created_at":"2015-09-14T15:07:13Z","updated_at":"2016-09-30T21:39:20Z","pushed_at":"2016-10-02T03:24:17Z","git_url":"git://github.com/uf-mil/Navigator.git","ssh_url":"git@github.com:uf-mil/Navigator.git","clone_url":"https://github.com/uf-mil/Navigator.git","svn_url":"https://github.com/uf-mil/Navigator","homepage":"","size":3014,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":14,"forks":13,"open_issues":14,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uf-mil/Navigator/pulls/71"},"html":{"href":"https://github.com/uf-mil/Navigator/pull/71"},"issue":{"href":"https://api.github.com/repos/uf-mil/Navigator/issues/71"},"comments":{"href":"https://api.github.com/repos/uf-mil/Navigator/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/uf-mil/Navigator/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/uf-mil/Navigator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uf-mil/Navigator/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/uf-mil/Navigator/statuses/89f07f31bde1a18ad3bc013b90f52f4640753230"}}}}
{"actor":{"display_login":"ironmig"}}