{"action":"created","comment":{"url":"https://api.github.com/repos/ros-industrial/abb/pulls/comments/186751894","pull_request_review_id":118392312,"id":186751894,"diff_hunk":"@@ -37,42 +37,120 @@ LOCAL VAR socketdev client_socket;\n PROC main()\r\n \r\n     TPWrite \"StateServer: Waiting for connection.\";\r\n-\tROS_init_socket server_socket, server_port;\r\n+    ROS_init_socket server_socket, server_port;\r\n     ROS_wait_for_client server_socket, client_socket;\r\n-    \r\n-\tWHILE (TRUE) DO\r\n-\t\tsend_joints;\r\n-\t\tWaitTime update_rate;\r\n+\r\n+    WHILE (TRUE) DO\r\n+        send_joints;\r\n+        send_status;\r\n+        WaitTime update_rate;\r\n     ENDWHILE\r\n \r\n ERROR (ERR_SOCK_TIMEOUT, ERR_SOCK_CLOSED)\r\n-\tIF (ERRNO=ERR_SOCK_TIMEOUT) OR (ERRNO=ERR_SOCK_CLOSED) THEN\r\n+    IF (ERRNO=ERR_SOCK_TIMEOUT) OR (ERRNO=ERR_SOCK_CLOSED) THEN\r\n         SkipWarn;  ! TBD: include this error data in the message logged below?\r\n         ErrWrite \\W, \"ROS StateServer disconnect\", \"Connection lost.  Waiting for new connection.\";\r\n         ExitCycle;  ! restart program\r\n-\tELSE\r\n-\t\tTRYNEXT;\r\n-\tENDIF\r\n+    ELSE\r\n+        TRYNEXT;\r\n+    ENDIF\r\n UNDO\r\n ENDPROC\r\n \r\n LOCAL PROC send_joints()\r\n-\tVAR ROS_msg_joint_data message;\r\n-\tVAR jointtarget joints;\r\n-\t\r\n+    VAR ROS_msg_joint_data message;\r\n+    VAR jointtarget joints;\r\n+\r\n     ! get current joint position (degrees)\r\n-\tjoints := CJointT();\r\n-    \r\n+    joints := CJointT();\r\n+\r\n     ! create message\r\n     message.header := [ROS_MSG_TYPE_JOINT, ROS_COM_TYPE_TOPIC, ROS_REPLY_TYPE_INVALID];\r\n     message.sequence_id := 0;\r\n     message.joints := joints.robax;\r\n-    \r\n+\r\n     ! send message to client\r\n     ROS_send_msg_joint_data client_socket, message;\r\n \r\n ERROR\r\n     RAISE;  ! raise errors to calling code\r\n ENDPROC\r\n \r\n-ENDMODULE\n\\ No newline at end of file\n+! signalRobotEStop : System Output\r\n+! signalMotorOn : System Output\r\n+! signalMotionPossible : System Output\r\n+! signalRobotNotMoving : System Output\r\n+LOCAL PROC send_status()\r\n+    VAR ROS_msg_robot_status message;\r\n+\r\n+    ! get current joint position (degrees)\r\n+    ! joints := CJointT();\r\n+\r\n+    ! create message\r\n+    message.header := [ROS_MSG_TYPE_STATUS, ROS_COM_TYPE_TOPIC, ROS_REPLY_TYPE_INVALID];\r\n+    message.sequence_id := 0;\r\n+\r\n+    ! default values\r\n+    message.mode            := ROS_ROBOT_MODE_UNKNOWN;\r\n+    message.e_stopped       := ROS_TRISTATE_UNKNOWN;\r\n+    message.drives_powered  := ROS_TRISTATE_UNKNOWN;\r\n+    message.error_code      := ROS_TRISTATE_UNKNOWN;\r\n+    message.in_error        := ROS_TRISTATE_UNKNOWN;\r\n+    message.in_motion       := ROS_TRISTATE_UNKNOWN;\r\n+    message.motion_possible := ROS_TRISTATE_UNKNOWN;\r\n+\r\n+    ! Get operating mode\r\n+    TEST OpMode()\r\n+        CASE OP_AUTO:\r\n+            message.mode := ROS_ROBOT_MODE_AUTO;\r\n+        CASE OP_MAN_PROG:\r\n+        CASE OP_MAN_TEST:\r\n+            message.mode := ROS_ROBOT_MODE_MANUAL;\r\n+    ENDTEST\r\n+\r\n+    ! Get E-stop status\r\n+    IF DOutput(signalRobotEStop) = 1 THEN\r\n+        message.e_stopped := ROS_TRISTATE_ON;\r\n+    ELSE\r\n+        message.e_stopped := ROS_TRISTATE_OFF;\r\n+    ENDIF\r\n+\r\n+    ! Get whether motors have power\r\n+    IF DOutput(signalMotorOn)=1 THEN\r\n+        message.drives_powered := ROS_TRISTATE_TRUE;\r\n+    ELSE\r\n+        message.drives_powered := ROS_TRISTATE_FALSE;\r\n+    ENDIF\r\n+\r\n+    ! Get error code\r\n+    message.error_code := ERRNO;\r\n+\r\n+    ! Determine in_error\r\n+    if (message.error_code >= 1) AND (message.error_code <= 90) THEN\r","path":"abb_driver/rapid/ROS_stateServer.mod","position":110,"original_position":110,"commit_id":"b1934053e301d58a705a55af9c40a45fd86c7b8f","original_commit_id":"b1934053e301d58a705a55af9c40a45fd86c7b8f","user":{"login":"gavanderhoorn","id":4550046,"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},"body":"Yes, I had understood that as well. But that bit of doc doesn't seem to limit error nrs to `[1, 90]` specifically.","created_at":"2018-05-08T14:40:36Z","updated_at":"2018-05-08T14:40:36Z","html_url":"https://github.com/ros-industrial/abb/pull/145#discussion_r186751894","pull_request_url":"https://api.github.com/repos/ros-industrial/abb/pulls/145","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/ros-industrial/abb/pulls/comments/186751894"},"html":{"href":"https://github.com/ros-industrial/abb/pull/145#discussion_r186751894"},"pull_request":{"href":"https://api.github.com/repos/ros-industrial/abb/pulls/145"}},"in_reply_to_id":186708292},"pull_request":{"url":"https://api.github.com/repos/ros-industrial/abb/pulls/145","id":172269289,"html_url":"https://github.com/ros-industrial/abb/pull/145","diff_url":"https://github.com/ros-industrial/abb/pull/145.diff","patch_url":"https://github.com/ros-industrial/abb/pull/145.patch","issue_url":"https://api.github.com/repos/ros-industrial/abb/issues/145","number":145,"state":"open","locked":false,"title":"Adds robot status publishing to Rapid driver","user":{"login":"yamokosk","id":3110418,"avatar_url":"https://avatars0.githubusercontent.com/u/3110418?v=4","gravatar_id":"","url":"https://api.github.com/users/yamokosk","html_url":"https://github.com/yamokosk","followers_url":"https://api.github.com/users/yamokosk/followers","following_url":"https://api.github.com/users/yamokosk/following{/other_user}","gists_url":"https://api.github.com/users/yamokosk/gists{/gist_id}","starred_url":"https://api.github.com/users/yamokosk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yamokosk/subscriptions","organizations_url":"https://api.github.com/users/yamokosk/orgs","repos_url":"https://api.github.com/users/yamokosk/repos","events_url":"https://api.github.com/users/yamokosk/events{/privacy}","received_events_url":"https://api.github.com/users/yamokosk/received_events","type":"User","site_admin":false},"body":"Continuation of #144. Fully tested on hardware and a packet capture is included to verify. In capture robot was commanded to move to a few points and at the end of the capture, the E-stop was pressed.\r\n\r\nThe PR also standardizes whitespace indentation. Spaces, as opposed to tabs, were used more often for indentation so I changed everything to spaces. They are in separate commits to better see the changes.\r\n\r\n[robot_status_message.pcapng.zip](https://github.com/ros-industrial/abb/files/1771700/robot_status_message.pcapng.zip)\r\n\r\n","created_at":"2018-03-01T15:30:36Z","updated_at":"2018-05-08T14:40:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9baf4ba9936e3f660781283c4d414707b80a8f2e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ros-industrial/abb/pulls/145/commits","review_comments_url":"https://api.github.com/repos/ros-industrial/abb/pulls/145/comments","review_comment_url":"https://api.github.com/repos/ros-industrial/abb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ros-industrial/abb/issues/145/comments","statuses_url":"https://api.github.com/repos/ros-industrial/abb/statuses/b1934053e301d58a705a55af9c40a45fd86c7b8f","head":{"label":"yamokosk:feature/robot_status_message","ref":"feature/robot_status_message","sha":"b1934053e301d58a705a55af9c40a45fd86c7b8f","user":{"login":"yamokosk","id":3110418,"avatar_url":"https://avatars0.githubusercontent.com/u/3110418?v=4","gravatar_id":"","url":"https://api.github.com/users/yamokosk","html_url":"https://github.com/yamokosk","followers_url":"https://api.github.com/users/yamokosk/followers","following_url":"https://api.github.com/users/yamokosk/following{/other_user}","gists_url":"https://api.github.com/users/yamokosk/gists{/gist_id}","starred_url":"https://api.github.com/users/yamokosk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yamokosk/subscriptions","organizations_url":"https://api.github.com/users/yamokosk/orgs","repos_url":"https://api.github.com/users/yamokosk/repos","events_url":"https://api.github.com/users/yamokosk/events{/privacy}","received_events_url":"https://api.github.com/users/yamokosk/received_events","type":"User","site_admin":false},"repo":{"id":122510165,"name":"abb","full_name":"yamokosk/abb","owner":{"login":"yamokosk","id":3110418,"avatar_url":"https://avatars0.githubusercontent.com/u/3110418?v=4","gravatar_id":"","url":"https://api.github.com/users/yamokosk","html_url":"https://github.com/yamokosk","followers_url":"https://api.github.com/users/yamokosk/followers","following_url":"https://api.github.com/users/yamokosk/following{/other_user}","gists_url":"https://api.github.com/users/yamokosk/gists{/gist_id}","starred_url":"https://api.github.com/users/yamokosk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yamokosk/subscriptions","organizations_url":"https://api.github.com/users/yamokosk/orgs","repos_url":"https://api.github.com/users/yamokosk/repos","events_url":"https://api.github.com/users/yamokosk/events{/privacy}","received_events_url":"https://api.github.com/users/yamokosk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yamokosk/abb","description":"ROS-Industrial ABB meta-package (http://wiki.ros.org/abb)","fork":true,"url":"https://api.github.com/repos/yamokosk/abb","forks_url":"https://api.github.com/repos/yamokosk/abb/forks","keys_url":"https://api.github.com/repos/yamokosk/abb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yamokosk/abb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yamokosk/abb/teams","hooks_url":"https://api.github.com/repos/yamokosk/abb/hooks","issue_events_url":"https://api.github.com/repos/yamokosk/abb/issues/events{/number}","events_url":"https://api.github.com/repos/yamokosk/abb/events","assignees_url":"https://api.github.com/repos/yamokosk/abb/assignees{/user}","branches_url":"https://api.github.com/repos/yamokosk/abb/branches{/branch}","tags_url":"https://api.github.com/repos/yamokosk/abb/tags","blobs_url":"https://api.github.com/repos/yamokosk/abb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yamokosk/abb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yamokosk/abb/git/refs{/sha}","trees_url":"https://api.github.com/repos/yamokosk/abb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yamokosk/abb/statuses/{sha}","languages_url":"https://api.github.com/repos/yamokosk/abb/languages","stargazers_url":"https://api.github.com/repos/yamokosk/abb/stargazers","contributors_url":"https://api.github.com/repos/yamokosk/abb/contributors","subscribers_url":"https://api.github.com/repos/yamokosk/abb/subscribers","subscription_url":"https://api.github.com/repos/yamokosk/abb/subscription","commits_url":"https://api.github.com/repos/yamokosk/abb/commits{/sha}","git_commits_url":"https://api.github.com/repos/yamokosk/abb/git/commits{/sha}","comments_url":"https://api.github.com/repos/yamokosk/abb/comments{/number}","issue_comment_url":"https://api.github.com/repos/yamokosk/abb/issues/comments{/number}","contents_url":"https://api.github.com/repos/yamokosk/abb/contents/{+path}","compare_url":"https://api.github.com/repos/yamokosk/abb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yamokosk/abb/merges","archive_url":"https://api.github.com/repos/yamokosk/abb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yamokosk/abb/downloads","issues_url":"https://api.github.com/repos/yamokosk/abb/issues{/number}","pulls_url":"https://api.github.com/repos/yamokosk/abb/pulls{/number}","milestones_url":"https://api.github.com/repos/yamokosk/abb/milestones{/number}","notifications_url":"https://api.github.com/repos/yamokosk/abb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yamokosk/abb/labels{/name}","releases_url":"https://api.github.com/repos/yamokosk/abb/releases{/id}","deployments_url":"https://api.github.com/repos/yamokosk/abb/deployments","created_at":"2018-02-22T17:16:40Z","updated_at":"2018-02-22T17:16:43Z","pushed_at":"2018-03-05T21:48:32Z","git_url":"git://github.com/yamokosk/abb.git","ssh_url":"git@github.com:yamokosk/abb.git","clone_url":"https://github.com/yamokosk/abb.git","svn_url":"https://github.com/yamokosk/abb","homepage":"","size":13135,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"kinetic-devel"}},"base":{"label":"ros-industrial:kinetic-devel","ref":"kinetic-devel","sha":"10411781b2a0f2f0d33bf3c14de19624ce757518","user":{"login":"ros-industrial","id":2932528,"avatar_url":"https://avatars1.githubusercontent.com/u/2932528?v=4","gravatar_id":"","url":"https://api.github.com/users/ros-industrial","html_url":"https://github.com/ros-industrial","followers_url":"https://api.github.com/users/ros-industrial/followers","following_url":"https://api.github.com/users/ros-industrial/following{/other_user}","gists_url":"https://api.github.com/users/ros-industrial/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-industrial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-industrial/subscriptions","organizations_url":"https://api.github.com/users/ros-industrial/orgs","repos_url":"https://api.github.com/users/ros-industrial/repos","events_url":"https://api.github.com/users/ros-industrial/events{/privacy}","received_events_url":"https://api.github.com/users/ros-industrial/received_events","type":"Organization","site_admin":false},"repo":{"id":10642675,"name":"abb","full_name":"ros-industrial/abb","owner":{"login":"ros-industrial","id":2932528,"avatar_url":"https://avatars1.githubusercontent.com/u/2932528?v=4","gravatar_id":"","url":"https://api.github.com/users/ros-industrial","html_url":"https://github.com/ros-industrial","followers_url":"https://api.github.com/users/ros-industrial/followers","following_url":"https://api.github.com/users/ros-industrial/following{/other_user}","gists_url":"https://api.github.com/users/ros-industrial/gists{/gist_id}","starred_url":"https://api.github.com/users/ros-industrial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ros-industrial/subscriptions","organizations_url":"https://api.github.com/users/ros-industrial/orgs","repos_url":"https://api.github.com/users/ros-industrial/repos","events_url":"https://api.github.com/users/ros-industrial/events{/privacy}","received_events_url":"https://api.github.com/users/ros-industrial/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ros-industrial/abb","description":"ROS-Industrial ABB meta-package (http://wiki.ros.org/abb)","fork":false,"url":"https://api.github.com/repos/ros-industrial/abb","forks_url":"https://api.github.com/repos/ros-industrial/abb/forks","keys_url":"https://api.github.com/repos/ros-industrial/abb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ros-industrial/abb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ros-industrial/abb/teams","hooks_url":"https://api.github.com/repos/ros-industrial/abb/hooks","issue_events_url":"https://api.github.com/repos/ros-industrial/abb/issues/events{/number}","events_url":"https://api.github.com/repos/ros-industrial/abb/events","assignees_url":"https://api.github.com/repos/ros-industrial/abb/assignees{/user}","branches_url":"https://api.github.com/repos/ros-industrial/abb/branches{/branch}","tags_url":"https://api.github.com/repos/ros-industrial/abb/tags","blobs_url":"https://api.github.com/repos/ros-industrial/abb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ros-industrial/abb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ros-industrial/abb/git/refs{/sha}","trees_url":"https://api.github.com/repos/ros-industrial/abb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ros-industrial/abb/statuses/{sha}","languages_url":"https://api.github.com/repos/ros-industrial/abb/languages","stargazers_url":"https://api.github.com/repos/ros-industrial/abb/stargazers","contributors_url":"https://api.github.com/repos/ros-industrial/abb/contributors","subscribers_url":"https://api.github.com/repos/ros-industrial/abb/subscribers","subscription_url":"https://api.github.com/repos/ros-industrial/abb/subscription","commits_url":"https://api.github.com/repos/ros-industrial/abb/commits{/sha}","git_commits_url":"https://api.github.com/repos/ros-industrial/abb/git/commits{/sha}","comments_url":"https://api.github.com/repos/ros-industrial/abb/comments{/number}","issue_comment_url":"https://api.github.com/repos/ros-industrial/abb/issues/comments{/number}","contents_url":"https://api.github.com/repos/ros-industrial/abb/contents/{+path}","compare_url":"https://api.github.com/repos/ros-industrial/abb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ros-industrial/abb/merges","archive_url":"https://api.github.com/repos/ros-industrial/abb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ros-industrial/abb/downloads","issues_url":"https://api.github.com/repos/ros-industrial/abb/issues{/number}","pulls_url":"https://api.github.com/repos/ros-industrial/abb/pulls{/number}","milestones_url":"https://api.github.com/repos/ros-industrial/abb/milestones{/number}","notifications_url":"https://api.github.com/repos/ros-industrial/abb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ros-industrial/abb/labels{/name}","releases_url":"https://api.github.com/repos/ros-industrial/abb/releases{/id}","deployments_url":"https://api.github.com/repos/ros-industrial/abb/deployments","created_at":"2013-06-12T12:48:36Z","updated_at":"2018-04-09T21:02:27Z","pushed_at":"2018-03-05T21:48:34Z","git_url":"git://github.com/ros-industrial/abb.git","ssh_url":"git@github.com:ros-industrial/abb.git","clone_url":"https://github.com/ros-industrial/abb.git","svn_url":"https://github.com/ros-industrial/abb","homepage":"","size":13127,"stargazers_count":39,"watchers_count":39,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":56,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":56,"open_issues":15,"watchers":39,"default_branch":"kinetic-devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ros-industrial/abb/pulls/145"},"html":{"href":"https://github.com/ros-industrial/abb/pull/145"},"issue":{"href":"https://api.github.com/repos/ros-industrial/abb/issues/145"},"comments":{"href":"https://api.github.com/repos/ros-industrial/abb/issues/145/comments"},"review_comments":{"href":"https://api.github.com/repos/ros-industrial/abb/pulls/145/comments"},"review_comment":{"href":"https://api.github.com/repos/ros-industrial/abb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ros-industrial/abb/pulls/145/commits"},"statuses":{"href":"https://api.github.com/repos/ros-industrial/abb/statuses/b1934053e301d58a705a55af9c40a45fd86c7b8f"}},"author_association":"NONE"}}
{"actor":{"display_login":"gavanderhoorn"}}