{"action":"created","issue":{"url":"https://api.github.com/repos/siemens/ros-sharp/issues/78","repository_url":"https://api.github.com/repos/siemens/ros-sharp","labels_url":"https://api.github.com/repos/siemens/ros-sharp/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/siemens/ros-sharp/issues/78/comments","events_url":"https://api.github.com/repos/siemens/ros-sharp/issues/78/events","html_url":"https://github.com/siemens/ros-sharp/issues/78","id":335238870,"node_id":"MDU6SXNzdWUzMzUyMzg4NzA=","number":78,"title":"Bug in ROSBridgeClient?","user":{"login":"faizan-m","id":22532191,"node_id":"MDQ6VXNlcjIyNTMyMTkx","avatar_url":"https://avatars2.githubusercontent.com/u/22532191?v=4","gravatar_id":"","url":"https://api.github.com/users/faizan-m","html_url":"https://github.com/faizan-m","followers_url":"https://api.github.com/users/faizan-m/followers","following_url":"https://api.github.com/users/faizan-m/following{/other_user}","gists_url":"https://api.github.com/users/faizan-m/gists{/gist_id}","starred_url":"https://api.github.com/users/faizan-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faizan-m/subscriptions","organizations_url":"https://api.github.com/users/faizan-m/orgs","repos_url":"https://api.github.com/users/faizan-m/repos","events_url":"https://api.github.com/users/faizan-m/events{/privacy}","received_events_url":"https://api.github.com/users/faizan-m/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-25T02:23:22Z","updated_at":"2018-06-26T07:36:10Z","closed_at":null,"author_association":"NONE","body":"* [x] I am at the right place and my issue is directly related to ROS#. General technical questions I would post e.g. at [ROS Answers](https://answers.ros.org/) or [Stackoverflow](https://stackoverflow.com). For library-specific questions I would look for help in the corresponding library forums.\r\n* [x] I have throughly read [the Contributing Guideline](Contributing.md) and writing this issue is the right thing to do in my case.\r\n\r\n## I found a bug! ##\r\n* [x] I am using the latest ROS# version available here on the master branch.\r\n* [x] I am adding all required information, code and data files, screenshots and log files so that you can reproduce the problem.\r\n\r\n* My OS is: Windows 10\r\n* My Unity Version is: 2018.1.3f1\r\n* My ROS Distribution is: ROS Indigo\r\n* My Build Target Platform is: Unity Editor/Android/iOS\r\n\r\n**Here is my bug description:**\r\nI am trying to get the Laser Scan topic inside Unity. It subscribes well but the callback function is never called so data never comes. \r\n\r\nPerform the following steps reproduce the bug:\r\n\r\nI followed the instructions [here](https://github.com/siemens/ros-sharp/wiki/Dev_NewMessageTypes):\r\nAdded the SensorLaserScan class in Message.cs:\r\n\r\npublic class SensorLaserScan : Message\r\n    {\r\n        public StandardHeader header;\r\n        public float angle_min;\r\n        public float angle_max;\r\n        public float angle_increment;\r\n        public float time_increment;\r\n        public float scan_time;\r\n        public float range_min;\r\n        public float range_max;\r\n        public float[] ranges;\r\n        public float[] intensities;\r\n\r\n        public SensorLaserScan()\r\n        {\r\n            header = new StandardHeader();\r\n            angle_min = 0;\r\n            angle_max = 0;\r\n            angle_increment = 0;\r\n            time_increment = 0;\r\n            scan_time = 0;\r\n            range_min = 0;\r\n            range_max = 0;\r\n            ranges = new float[0];\r\n            intensities = new float[0];\r\n        }\r\n  }\r\n\r\n\r\nAdded the corresponding values in the MessageTypes.cs:\r\n\r\n          { \"sensor_msgs/LaserScan\", typeof(SensorLaserScan) },\r\n\r\n\r\nCreated a Test Script in Unity:\r\n\r\nusing System;\r\nusing System.Collections;\r\nusing System.Collections.Generic;\r\nusing UnityEngine;\r\n\r\nusing RosSharp.RosBridgeClient;\r\n\r\n\r\npublic class TestScript : MonoBehaviour {\r\n    RosSocket rosSocket;\r\n\r\n    // Use this for initialization\r\n    void Start () {\r\n        Debug.Log(\"Start Called on Script\");\r\n\r\n        rosSocket = new RosSocket(\"ws://172.16.218.131:9090\");\r\n        string subscription_id = rosSocket.Subscribe(\"/scan\", \"sensor_msgs/LaserScan\", subscriptionHandler);\r\n        Debug.Log(\"Subscription ID: \" + subscription_id);\r\n\r\n    }\r\n\r\n    // Update is called once per frame\r\n    void Update () {\r\n        Debug.Log(\"Update Called on Script\");\r\n    }\r\n\r\n    private static void subscriptionHandler(Message message)\r\n    {\r\n        Debug.Log(\"Callback Called on Script\");\r\n\r\n        SensorLaserScan scanData = (SensorLaserScan)message;\r\n        Debug.Log(scanData.angle_max);\r\n    }\r\n}\r\n\r\nObserved results:\r\nCallback function is never called, though a subscription id is given and rosbridge_suite acknowledges that it has subscribed.\r\n\r\nExpected Results:\r\nUsed this exact code for a CompressedImage topic and it works as expected, calling the callback function as the data is available.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/siemens/ros-sharp/issues/comments/400210313","html_url":"https://github.com/siemens/ros-sharp/issues/78#issuecomment-400210313","issue_url":"https://api.github.com/repos/siemens/ros-sharp/issues/78","id":400210313,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDIxMDMxMw==","user":{"login":"MartinBischoff","id":30176214,"node_id":"MDQ6VXNlcjMwMTc2MjE0","avatar_url":"https://avatars0.githubusercontent.com/u/30176214?v=4","gravatar_id":"","url":"https://api.github.com/users/MartinBischoff","html_url":"https://github.com/MartinBischoff","followers_url":"https://api.github.com/users/MartinBischoff/followers","following_url":"https://api.github.com/users/MartinBischoff/following{/other_user}","gists_url":"https://api.github.com/users/MartinBischoff/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinBischoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinBischoff/subscriptions","organizations_url":"https://api.github.com/users/MartinBischoff/orgs","repos_url":"https://api.github.com/users/MartinBischoff/repos","events_url":"https://api.github.com/users/MartinBischoff/events{/privacy}","received_events_url":"https://api.github.com/users/MartinBischoff/received_events","type":"User","site_admin":false},"created_at":"2018-06-26T07:36:10Z","updated_at":"2018-06-26T07:36:10Z","author_association":"CONTRIBUTOR","body":"@faizan-m : So how would you like to have the line 255 changed in future versions then?"}}
{"actor":{"display_login":"MartinBischoff"}}