{"action":"created","issue":{"url":"https://api.github.com/repos/jsk-ros-pkg/geneus/issues/38","labels_url":"https://api.github.com/repos/jsk-ros-pkg/geneus/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/jsk-ros-pkg/geneus/issues/38/comments","events_url":"https://api.github.com/repos/jsk-ros-pkg/geneus/issues/38/events","html_url":"https://github.com/jsk-ros-pkg/geneus/issues/38","id":92188979,"number":38,"title":"Non-fixed bool array geneus seems to be incorrect","user":{"login":"snozawa","id":6102287,"avatar_url":"https://avatars.githubusercontent.com/u/6102287?v=3","gravatar_id":"","url":"https://api.github.com/users/snozawa","html_url":"https://github.com/snozawa","followers_url":"https://api.github.com/users/snozawa/followers","following_url":"https://api.github.com/users/snozawa/following{/other_user}","gists_url":"https://api.github.com/users/snozawa/gists{/gist_id}","starred_url":"https://api.github.com/users/snozawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snozawa/subscriptions","organizations_url":"https://api.github.com/users/snozawa/orgs","repos_url":"https://api.github.com/users/snozawa/repos","events_url":"https://api.github.com/users/snozawa/events{/privacy}","received_events_url":"https://api.github.com/users/snozawa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-30T20:15:27Z","updated_at":"2015-07-07T13:32:24Z","closed_at":null,"body":"Non-fixed bool array geneus seems to be incorrect.\r\nI found this problem in `hrpsys_ros_bridge` conversion.\r\n\r\n- Expected behavior\r\nRoseus message corresponding to ROS `bool` type is expected to return `t` or `nil`. \r\n\r\n- Test case\r\n```\r\n# Generate tempolary msg file\r\necho \"bool data\" > /tmp/TmpBool.msg\r\necho \"bool[] data\" > /tmp/TmpBoolArray.msg\r\necho \"bool[2] data\" > /tmp/TmpFixedBoolArray.msg\r\n# I renamed data name as \"data\".\r\n\r\n# Run geneus ( tempolarily in roseus package)\r\nrosrun geneus gen_eus.py -p roseus -o /tmp -Iroseus:`rospack find roseus`/msg -Istd_msgs:`rospack find std_msgs`/msg /tmp/TmpBool.msg\r\nrosrun geneus gen_eus.py -p roseus -o /tmp -Iroseus:`rospack find roseus`/msg -Istd_msgs:`rospack find std_msgs`/msg /tmp/TmpBoolArray.msg\r\nrosrun geneus gen_eus.py -p roseus -o /tmp -Iroseus:`rospack find roseus`/msg -Istd_msgs:`rospack find std_msgs`/msg /tmp/TmpFixedBoolArray.msg\r\n```\r\n\r\nIn generated `.l` files,\r\n- `:desiricalize` method in TmpBool.l and TmpFixedBoolArray.l are generated like this:\r\n```\r\n  (:deserialize\r\n   (buf &optional (ptr- 0))\r\n   ;; bool _tmpbool                                                                                                                                                                                                                      \r\n     (setq _tmpbool (not (= 0 (sys::peek buf ptr- :char)))) (incf ptr- 1)\r\n   ;;                                                                                                                                                                                                                                    \r\n   self)\r\n```\r\nThis means TmpBool.l and TmpFixedBoolArray.l returns `t` or `nil` and works correctly.\r\n- `:desiricalize` method in TmpBoolArray.l is generated like this:\r\n```\r\n  (:deserialize\r\n   (buf &optional (ptr- 0))\r\n   ;; bool[] _tmpboolarray                                                                                                                                                                                                               \r\n   (let (n)\r\n     (setq n (sys::peek buf ptr- :integer)) (incf ptr- 4)\r\n     (setq _tmpboolarray (let (r) (dotimes (i n) (push (instance object :init) r)) r))\r\n     (dolist (elem- _tmpboolarray)\r\n     (setq elem- (not (= 0 (sys::peek buf ptr- :char)))) (incf ptr- 1)\r\n     ))\r\n   ;;                                                                                                                                                                                                                                    \r\n   self)\r\n```\r\nIn this code,\r\n```\r\n     (dolist (elem- _tmpboolarray)\r\n     (setq elem- (not (= 0 (sys::peek buf ptr- :char)))) (incf ptr- 1)\r\n```\r\nthis `setq` does not overwrite `_tmpboolarray` elements.  \r\nSo, this program does not return `t` or `nil` and returns `object` class instance.  \r\nIs this expected behavior?\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/jsk-ros-pkg/geneus/issues/comments/119203203","html_url":"https://github.com/jsk-ros-pkg/geneus/issues/38#issuecomment-119203203","issue_url":"https://api.github.com/repos/jsk-ros-pkg/geneus/issues/38","id":119203203,"user":{"login":"k-okada","id":493276,"avatar_url":"https://avatars.githubusercontent.com/u/493276?v=3","gravatar_id":"","url":"https://api.github.com/users/k-okada","html_url":"https://github.com/k-okada","followers_url":"https://api.github.com/users/k-okada/followers","following_url":"https://api.github.com/users/k-okada/following{/other_user}","gists_url":"https://api.github.com/users/k-okada/gists{/gist_id}","starred_url":"https://api.github.com/users/k-okada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-okada/subscriptions","organizations_url":"https://api.github.com/users/k-okada/orgs","repos_url":"https://api.github.com/users/k-okada/repos","events_url":"https://api.github.com/users/k-okada/events{/privacy}","received_events_url":"https://api.github.com/users/k-okada/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T13:32:24Z","updated_at":"2015-07-07T13:32:24Z","body":"I have fixed this problem at https://github.com/jsk-ros-pkg/geneus/pull/39\r\n\r\nplease check https://github.com/snozawa/jsk_roseus/pull/1, this will change bool array from array to list"}}