{"action":"closed","number":653,"pull_request":{"url":"https://api.github.com/repos/ros/ros_comm/pulls/653","id":43280137,"html_url":"https://github.com/ros/ros_comm/pull/653","diff_url":"https://github.com/ros/ros_comm/pull/653.diff","patch_url":"https://github.com/ros/ros_comm/pull/653.patch","issue_url":"https://api.github.com/repos/ros/ros_comm/issues/653","number":653,"state":"closed","locked":false,"title":"Extend timer.Timer to include startup method","user":{"login":"keithhamilton","id":2139917,"avatar_url":"https://avatars.githubusercontent.com/u/2139917?v=3","gravatar_id":"","url":"https://api.github.com/users/keithhamilton","html_url":"https://github.com/keithhamilton","followers_url":"https://api.github.com/users/keithhamilton/followers","following_url":"https://api.github.com/users/keithhamilton/following{/other_user}","gists_url":"https://api.github.com/users/keithhamilton/gists{/gist_id}","starred_url":"https://api.github.com/users/keithhamilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithhamilton/subscriptions","organizations_url":"https://api.github.com/users/keithhamilton/orgs","repos_url":"https://api.github.com/users/keithhamilton/repos","events_url":"https://api.github.com/users/keithhamilton/events{/privacy}","received_events_url":"https://api.github.com/users/keithhamilton/received_events","type":"User","site_admin":false},"body":"In working with the `rospy.timer.Timer` class, it feels to me like it could be improved with two subtle changes:\r\n\r\n* A kwarg in its constructor that allows its invoker to either instantiate it in a running or shutdown state\r\n* A companion method to `shutdown` that starts running the timer instead of turning it off.\r\n\r\nThis PR adds a kwarg to the `timer.Timer` constructor, `start_running` that defaults to False. In the `__init__` method, `self._shutdown` is set to `not start_running` so that if you wish to start the Timer in a running state, `start_running=True` and `self._shutdown = False`.\r\n\r\nThis PR also adds a `startup` method as a companion to `shutdown`, adding the ability to retain one instance of a `timer.Timer` object with the ability to toggle its running state. \r\n\r\nI have found this great for establishing a timer that controls a certain behavior with our robot, that may start and stop depending on repeating conditions.\r\n\r\nThanks for checking this out!\r\n-- Keith","created_at":"2015-08-25T12:35:48Z","updated_at":"2015-10-07T18:05:30Z","closed_at":"2015-10-07T18:05:30Z","merged_at":null,"merge_commit_sha":"598403496a861eabc884108b1c0449ae00f7d6fc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ros/ros_comm/pulls/653/commits","review_comments_url":"https://api.github.com/repos/ros/ros_comm/pulls/653/comments","review_comment_url":"https://api.github.com/repos/ros/ros_comm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros/ros_comm/issues/653/comments","statuses_url":"https://api.github.com/repos/ros/ros_comm/statuses/1468137014bc88182c16a8bbd729aafa2c1a1197","head":{"label":"keithhamilton:keithhamilton-timer","ref":"keithhamilton-timer","sha":"1468137014bc88182c16a8bbd729aafa2c1a1197","user":{"login":"keithhamilton","id":2139917,"avatar_url":"https://avatars.githubusercontent.com/u/2139917?v=3","gravatar_id":"","url":"https://api.github.com/users/keithhamilton","html_url":"https://github.com/keithhamilton","followers_url":"https://api.github.com/users/keithhamilton/followers","following_url":"https://api.github.com/users/keithhamilton/following{/other_user}","gists_url":"https://api.github.com/users/keithhamilton/gists{/gist_id}","starred_url":"https://api.github.com/users/keithhamilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithhamilton/subscriptions","organizations_url":"https://api.github.com/users/keithhamilton/orgs","repos_url":"https://api.github.com/users/keithhamilton/repos","events_url":"https://api.github.com/users/keithhamilton/events{/privacy}","received_events_url":"https://api.github.com/users/keithhamilton/received_events","type":"User","site_admin":false},"repo":{"id":41361474,"name":"ros_comm","full_name":"keithhamilton/ros_comm","owner":{"login":"keithhamilton","id":2139917,"avatar_url":"https://avatars.githubusercontent.com/u/2139917?v=3","gravatar_id":"","url":"https://api.github.com/users/keithhamilton","html_url":"https://github.com/keithhamilton","followers_url":"https://api.github.com/users/keithhamilton/followers","following_url":"https://api.github.com/users/keithhamilton/following{/other_user}","gists_url":"https://api.github.com/users/keithhamilton/gists{/gist_id}","starred_url":"https://api.github.com/users/keithhamilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keithhamilton/subscriptions","organizations_url":"https://api.github.com/users/keithhamilton/orgs","repos_url":"https://api.github.com/users/keithhamilton/repos","events_url":"https://api.github.com/users/keithhamilton/events{/privacy}","received_events_url":"https://api.github.com/users/keithhamilton/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/keithhamilton/ros_comm","description":"ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).","fork":true,"url":"https://api.github.com/repos/keithhamilton/ros_comm","forks_url":"https://api.github.com/repos/keithhamilton/ros_comm/forks","keys_url":"https://api.github.com/repos/keithhamilton/ros_comm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/keithhamilton/ros_comm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/keithhamilton/ros_comm/teams","hooks_url":"https://api.github.com/repos/keithhamilton/ros_comm/hooks","issue_events_url":"https://api.github.com/repos/keithhamilton/ros_comm/issues/events{/number}","events_url":"https://api.github.com/repos/keithhamilton/ros_comm/events","assignees_url":"https://api.github.com/repos/keithhamilton/ros_comm/assignees{/user}","branches_url":"https://api.github.com/repos/keithhamilton/ros_comm/branches{/branch}","tags_url":"https://api.github.com/repos/keithhamilton/ros_comm/tags","blobs_url":"https://api.github.com/repos/keithhamilton/ros_comm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/keithhamilton/ros_comm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/keithhamilton/ros_comm/git/refs{/sha}","trees_url":"https://api.github.com/repos/keithhamilton/ros_comm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/keithhamilton/ros_comm/statuses/{sha}","languages_url":"https://api.github.com/repos/keithhamilton/ros_comm/languages","stargazers_url":"https://api.github.com/repos/keithhamilton/ros_comm/stargazers","contributors_url":"https://api.github.com/repos/keithhamilton/ros_comm/contributors","subscribers_url":"https://api.github.com/repos/keithhamilton/ros_comm/subscribers","subscription_url":"https://api.github.com/repos/keithhamilton/ros_comm/subscription","commits_url":"https://api.github.com/repos/keithhamilton/ros_comm/commits{/sha}","git_commits_url":"https://api.github.com/repos/keithhamilton/ros_comm/git/commits{/sha}","comments_url":"https://api.github.com/repos/keithhamilton/ros_comm/comments{/number}","issue_comment_url":"https://api.github.com/repos/keithhamilton/ros_comm/issues/comments{/number}","contents_url":"https://api.github.com/repos/keithhamilton/ros_comm/contents/{+path}","compare_url":"https://api.github.com/repos/keithhamilton/ros_comm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/keithhamilton/ros_comm/merges","archive_url":"https://api.github.com/repos/keithhamilton/ros_comm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/keithhamilton/ros_comm/downloads","issues_url":"https://api.github.com/repos/keithhamilton/ros_comm/issues{/number}","pulls_url":"https://api.github.com/repos/keithhamilton/ros_comm/pulls{/number}","milestones_url":"https://api.github.com/repos/keithhamilton/ros_comm/milestones{/number}","notifications_url":"https://api.github.com/repos/keithhamilton/ros_comm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/keithhamilton/ros_comm/labels{/name}","releases_url":"https://api.github.com/repos/keithhamilton/ros_comm/releases{/id}","created_at":"2015-08-25T12:15:54Z","updated_at":"2015-08-25T12:15:56Z","pushed_at":"2015-09-17T18:38:53Z","git_url":"git://github.com/keithhamilton/ros_comm.git","ssh_url":"git@github.com:keithhamilton/ros_comm.git","clone_url":"https://github.com/keithhamilton/ros_comm.git","svn_url":"https://github.com/keithhamilton/ros_comm","homepage":"http://wiki.ros.org/ros_comm","size":11613,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"ros:indigo-devel","ref":"indigo-devel","sha":"c4bb2b8520838974fcd5c4cb76ecd8b2dc3a7383","user":{"login":"ros","id":547448,"avatar_url":"https://avatars.githubusercontent.com/u/547448?v=3","gravatar_id":"","url":"https://api.github.com/users/ros","html_url":"https://github.com/ros","followers_url":"https://api.github.com/users/ros/followers","following_url":"https://api.github.com/users/ros/following{/other_user}","gists_url":"https://api.github.com/users/ros/gists{/gist_id}","starred_url":"https://api.github.com/users/ros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros/subscriptions","organizations_url":"https://api.github.com/users/ros/orgs","repos_url":"https://api.github.com/users/ros/repos","events_url":"https://api.github.com/users/ros/events{/privacy}","received_events_url":"https://api.github.com/users/ros/received_events","type":"Organization","site_admin":false},"repo":{"id":5474834,"name":"ros_comm","full_name":"ros/ros_comm","owner":{"login":"ros","id":547448,"avatar_url":"https://avatars.githubusercontent.com/u/547448?v=3","gravatar_id":"","url":"https://api.github.com/users/ros","html_url":"https://github.com/ros","followers_url":"https://api.github.com/users/ros/followers","following_url":"https://api.github.com/users/ros/following{/other_user}","gists_url":"https://api.github.com/users/ros/gists{/gist_id}","starred_url":"https://api.github.com/users/ros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros/subscriptions","organizations_url":"https://api.github.com/users/ros/orgs","repos_url":"https://api.github.com/users/ros/repos","events_url":"https://api.github.com/users/ros/events{/privacy}","received_events_url":"https://api.github.com/users/ros/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros/ros_comm","description":"ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).","fork":false,"url":"https://api.github.com/repos/ros/ros_comm","forks_url":"https://api.github.com/repos/ros/ros_comm/forks","keys_url":"https://api.github.com/repos/ros/ros_comm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros/ros_comm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros/ros_comm/teams","hooks_url":"https://api.github.com/repos/ros/ros_comm/hooks","issue_events_url":"https://api.github.com/repos/ros/ros_comm/issues/events{/number}","events_url":"https://api.github.com/repos/ros/ros_comm/events","assignees_url":"https://api.github.com/repos/ros/ros_comm/assignees{/user}","branches_url":"https://api.github.com/repos/ros/ros_comm/branches{/branch}","tags_url":"https://api.github.com/repos/ros/ros_comm/tags","blobs_url":"https://api.github.com/repos/ros/ros_comm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros/ros_comm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros/ros_comm/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros/ros_comm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros/ros_comm/statuses/{sha}","languages_url":"https://api.github.com/repos/ros/ros_comm/languages","stargazers_url":"https://api.github.com/repos/ros/ros_comm/stargazers","contributors_url":"https://api.github.com/repos/ros/ros_comm/contributors","subscribers_url":"https://api.github.com/repos/ros/ros_comm/subscribers","subscription_url":"https://api.github.com/repos/ros/ros_comm/subscription","commits_url":"https://api.github.com/repos/ros/ros_comm/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros/ros_comm/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros/ros_comm/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros/ros_comm/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros/ros_comm/contents/{+path}","compare_url":"https://api.github.com/repos/ros/ros_comm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros/ros_comm/merges","archive_url":"https://api.github.com/repos/ros/ros_comm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros/ros_comm/downloads","issues_url":"https://api.github.com/repos/ros/ros_comm/issues{/number}","pulls_url":"https://api.github.com/repos/ros/ros_comm/pulls{/number}","milestones_url":"https://api.github.com/repos/ros/ros_comm/milestones{/number}","notifications_url":"https://api.github.com/repos/ros/ros_comm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros/ros_comm/labels{/name}","releases_url":"https://api.github.com/repos/ros/ros_comm/releases{/id}","created_at":"2012-08-19T22:26:34Z","updated_at":"2015-10-06T07:15:46Z","pushed_at":"2015-10-07T16:13:38Z","git_url":"git://github.com/ros/ros_comm.git","ssh_url":"git@github.com:ros/ros_comm.git","clone_url":"https://github.com/ros/ros_comm.git","svn_url":"https://github.com/ros/ros_comm","homepage":"http://wiki.ros.org/ros_comm","size":28000,"stargazers_count":64,"watchers_count":64,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":169,"mirror_url":null,"open_issues_count":151,"forks":169,"open_issues":151,"watchers":64,"default_branch":"indigo-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ros/ros_comm/pulls/653"},"html":{"href":"https://github.com/ros/ros_comm/pull/653"},"issue":{"href":"https://api.github.com/repos/ros/ros_comm/issues/653"},"comments":{"href":"https://api.github.com/repos/ros/ros_comm/issues/653/comments"},"review_comments":{"href":"https://api.github.com/repos/ros/ros_comm/pulls/653/comments"},"review_comment":{"href":"https://api.github.com/repos/ros/ros_comm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros/ros_comm/pulls/653/commits"},"statuses":{"href":"https://api.github.com/repos/ros/ros_comm/statuses/1468137014bc88182c16a8bbd729aafa2c1a1197"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":2,"review_comments":8,"commits":6,"additions":14,"deletions":4,"changed_files":1}}