{"action":"created","issue":{"url":"https://api.github.com/repos/Zagitta/ur_modern_driver/issues/27","repository_url":"https://api.github.com/repos/Zagitta/ur_modern_driver","labels_url":"https://api.github.com/repos/Zagitta/ur_modern_driver/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/Zagitta/ur_modern_driver/issues/27/comments","events_url":"https://api.github.com/repos/Zagitta/ur_modern_driver/issues/27/events","html_url":"https://github.com/Zagitta/ur_modern_driver/pull/27","id":353228206,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwMzMzMDY5","number":27,"title":"Add program_running status publisher & example function","user":{"login":"felixvd","id":4535737,"node_id":"MDQ6VXNlcjQ1MzU3Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/4535737?v=4","gravatar_id":"","url":"https://api.github.com/users/felixvd","html_url":"https://github.com/felixvd","followers_url":"https://api.github.com/users/felixvd/followers","following_url":"https://api.github.com/users/felixvd/following{/other_user}","gists_url":"https://api.github.com/users/felixvd/gists{/gist_id}","starred_url":"https://api.github.com/users/felixvd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixvd/subscriptions","organizations_url":"https://api.github.com/users/felixvd/orgs","repos_url":"https://api.github.com/users/felixvd/repos","events_url":"https://api.github.com/users/felixvd/events{/privacy}","received_events_url":"https://api.github.com/users/felixvd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-23T05:18:41Z","updated_at":"2018-08-23T06:11:17Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/Zagitta/ur_modern_driver/pulls/27","html_url":"https://github.com/Zagitta/ur_modern_driver/pull/27","diff_url":"https://github.com/Zagitta/ur_modern_driver/pull/27.diff","patch_url":"https://github.com/Zagitta/ur_modern_driver/pull/27.patch"},"body":"When sending a script to the robot, it is often necessary to know when it has stopped. @gavanderhoorn mentioned [here](https://github.com/ThomasTimm/ur_modern_driver/issues/162) that \"there's no way to detect whether 'the script' has finished\", but this is implemented in other popular python libraries like [urx](https://github.com/SintefRaufossManufacturing/python-urx) via the program_running status variable.\r\n\r\nThe ur_modern_driver already parses the parameter, but does not expose it. This PR publishes the parameter to a topic `/ur_driver/program_running`, and adds a simple example that allows C++ users to wait for the program on the robot to finish.\r\n\r\nIf the wait function is called when the regular ur_modern_driver is running on the controller (i.e. when a goal is sent through the action interface), it will not terminate. Some users might get confused about this, but the functionality is required for some use cases (including ours), and I believe the message that appears on-screen is informative enough.\r\n\r\n[A related ROS Answers thread](https://answers.ros.org/question/285345/action-completion-from-ur-controller/)."},"comment":{"url":"https://api.github.com/repos/Zagitta/ur_modern_driver/issues/comments/415303259","html_url":"https://github.com/Zagitta/ur_modern_driver/pull/27#issuecomment-415303259","issue_url":"https://api.github.com/repos/Zagitta/ur_modern_driver/issues/27","id":415303259,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTMwMzI1OQ==","user":{"login":"gavanderhoorn","id":4550046,"node_id":"MDQ6VXNlcjQ1NTAwNDY=","avatar_url":"https://avatars0.githubusercontent.com/u/4550046?v=4","gravatar_id":"","url":"https://api.github.com/users/gavanderhoorn","html_url":"https://github.com/gavanderhoorn","followers_url":"https://api.github.com/users/gavanderhoorn/followers","following_url":"https://api.github.com/users/gavanderhoorn/following{/other_user}","gists_url":"https://api.github.com/users/gavanderhoorn/gists{/gist_id}","starred_url":"https://api.github.com/users/gavanderhoorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gavanderhoorn/subscriptions","organizations_url":"https://api.github.com/users/gavanderhoorn/orgs","repos_url":"https://api.github.com/users/gavanderhoorn/repos","events_url":"https://api.github.com/users/gavanderhoorn/events{/privacy}","received_events_url":"https://api.github.com/users/gavanderhoorn/received_events","type":"User","site_admin":false},"created_at":"2018-08-23T06:11:17Z","updated_at":"2018-08-23T06:11:17Z","author_association":"COLLABORATOR","body":"@felixvd wrote:\r\n> When sending a script to the robot, it is often necessary to know when it has stopped. @gavanderhoorn mentioned [here](https://github.com/ThomasTimm/ur_modern_driver/issues/162) that \"there's no way to detect whether 'the script' has finished\", but this is implemented in other popular python libraries like [urx](https://github.com/SintefRaufossManufacturing/python-urx) via the program_running status variable.\r\n\r\nmy comment was specifically made in the context of programs running in parallel to the driver or as a replacement. As the driver is a program as well, there is no clear way to know which program is running or not. You mention this ambiguity yourself already:\r\n\r\n> If the wait function is called when the regular ur_modern_driver is running on the controller (i.e. when a goal is sent through the action interface), it will not terminate. \r\n\r\nI'm not so sure I agree with your next statement:\r\n\r\n> Some users might get confused about this, but the functionality is required for some use cases (including ours), and I believe the message that appears on-screen is informative enough.\r\n\r\n`ROS_INFO` is not always shown on the console, and the nr of users/devs that don't check the various ROS logging tools is too high too rely on this alone.\r\n\r\nIt would perhaps be better to provide a `isProgramRunning()` function, which could then be used by clients in a simple while-loop (like in `wait_for_program.h`). This would avoid introducing a potentially infinite wait, or at least in driver provided code.\r\n"}}
{"actor":{"display_login":"gavanderhoorn"}}