{"action":"created","comment":{"url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/comments/44620433","id":44620433,"diff_hunk":"@@ -55,6 +55,68 @@\n     ;; FIXME:: add coordinates of camera\n     (make-camera-from-ros-camera-info-aux pwidth pheight p nil)))\n \n+;; Image\n+(unless (fboundp 'version-string-p)\n+(defun version-string-p (str)\n+  \"Return T if STR is string of version defined below, return NIL otherwise.\n+VERSION := NUMBER (DOT NUMBER)*\n+NUMBER := (0|1|2|3|4|5|6|7|8|9)*\"\n+  (null (find-if-not #'(lambda (x)\n+                         (and (integerp x) (not (minusp x))))\n+                     (read-from-string (format nil \"(~A)\" (substitute #\\Space #\\. str)))))))\n+(unless (fboundp 'version-string-to-list)\n+(defun version-string-to-list (str)\n+\"Return list of version numbers of version string STR\"\n+  (unless (version-string-p str)\n+    (error \"version string must be number or dot: ~A~%\" str))\n+  (read-from-string (format nil \"(~A)\" (substitute #\\Space #\\. str)))))\n+(unless (fboundp 'version-list-not-zero)\n+(defun version-list-not-zero (lst)\n+  \"Return the first non-zero element of LST, which is a list of integers\"\n+  (while (and lst (zerop (car lst)))\n+    (setq lst (cdr lst)))\n+  (if lst (car lst) 0)))\n+(unless (fboundp 'version<)\n+(defun version< (ver1 ver2)\n+  \"Return T if version VER1 is lower (older) than VER2, return NIL otherwise\"\n+  (let ((l1 (version-string-to-list ver1))\n+        (l2 (version-string-to-list ver2)))\n+    (while (and l1 l2 (= (car l1) (car l2)))\n+      (setq l1 (cdr l1) l2 (cdr l2)))\n+    (cond\n+     ((and l1 l2) (< (car l1) (car l2)))\n+     ((and (null l1) (null l2)) nil)\n+     (l1 (< (version-list-not-zero l1) 0))\n+     (t (< 0 (version-list-not-zero l2)))))))\n+\n+;; this function is valid only on 1.0.12 and later\n+(unless (version< (car (last lisp-implementation-version)) \"1.0.11\")","path":"roseus/euslisp/roseus-utils.l","position":39,"original_position":39,"commit_id":"f5cf65326bc6ed299abd878846fcfd25e85584c4","original_commit_id":"17ac4fd815929cc28c326dd1051a1926a4fa7d99","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},"body":"does this mean load can file relateive to EUSDIR, but probe-file is not\n\n(probe-file (format nil \"~A/irteus/dmeo/sample-camera/model.l\" *eusdir*))\n\n\n--\n◉ Kei Okada\n\n\nOn Thu, Nov 12, 2015 at 1:15 PM, Furushchev <notifications@github.com>\nwrote:\n\n> In roseus/euslisp/roseus-utils.l\n> <https://github.com/jsk-ros-pkg/jsk_roseus/pull/393#discussion_r44620252>:\n>\n> > +  (if lst (car lst) 0)))\n> > +(unless (fboundp 'version<)\n> > +(defun version< (ver1 ver2)\n> > +  \"Return T if version VER1 is lower (older) than VER2, return NIL otherwise\"\n> > +  (let ((l1 (version-string-to-list ver1))\n> > +        (l2 (version-string-to-list ver2)))\n> > +    (while (and l1 l2 (= (car l1) (car l2)))\n> > +      (setq l1 (cdr l1) l2 (cdr l2)))\n> > +    (cond\n> > +     ((and l1 l2) (< (car l1) (car l2)))\n> > +     ((and (null l1) (null l2)) nil)\n> > +     (l1 (< (version-list-not-zero l1) 0))\n> > +     (t (< 0 (version-list-not-zero l2)))))))\n> > +\n> > +;; this function is valid only on 1.0.12 and later\n> > +(unless (version< (car (last lisp-implementation-version)) \"1.0.11\")\n>\n> I think it is ok!\n>\n> BTW, how can we check if exists the file to load in irteus directory?\n>\n> $ (load \"irteus/demo/sample-camera-model.l\") ;; it loads file correctly because this file actually exists.\n> $ (probe-file \"irteus/demo/sample-camera-model.l\") ;; => nil  ;; how can I detect ?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/jsk-ros-pkg/jsk_roseus/pull/393/files#r44620252>.\n>\n","created_at":"2015-11-12T04:20:50Z","updated_at":"2015-11-12T04:20:50Z","html_url":"https://github.com/jsk-ros-pkg/jsk_roseus/pull/393#discussion_r44620433","pull_request_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/393","_links":{"self":{"href":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/comments/44620433"},"html":{"href":"https://github.com/jsk-ros-pkg/jsk_roseus/pull/393#discussion_r44620433"},"pull_request":{"href":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/393"}}},"pull_request":{"url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/393","id":49813527,"html_url":"https://github.com/jsk-ros-pkg/jsk_roseus/pull/393","diff_url":"https://github.com/jsk-ros-pkg/jsk_roseus/pull/393.diff","patch_url":"https://github.com/jsk-ros-pkg/jsk_roseus/pull/393.patch","issue_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/issues/393","number":393,"state":"open","locked":false,"title":"[roseus/euslisp/roseus-utils.l] add image conversion to ros msg","user":{"login":"furushchev","id":1901008,"avatar_url":"https://avatars.githubusercontent.com/u/1901008?v=3","gravatar_id":"","url":"https://api.github.com/users/furushchev","html_url":"https://github.com/furushchev","followers_url":"https://api.github.com/users/furushchev/followers","following_url":"https://api.github.com/users/furushchev/following{/other_user}","gists_url":"https://api.github.com/users/furushchev/gists{/gist_id}","starred_url":"https://api.github.com/users/furushchev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furushchev/subscriptions","organizations_url":"https://api.github.com/users/furushchev/orgs","repos_url":"https://api.github.com/users/furushchev/repos","events_url":"https://api.github.com/users/furushchev/events{/privacy}","received_events_url":"https://api.github.com/users/furushchev/received_events","type":"User","site_admin":false},"body":"not yet included test code and docs (I'll make after rinko)\r\n but like below\r\n\r\n@mizmizo you can use this\r\n\r\n```lisp\r\n;; test-img.l\r\n;; Author: Yuki Furuta <furushchev@jsk.imi.i.u-tokyo.ac.jp>\r\n\r\n(require :pr2 \"package://pr2eus/pr2.l\")\r\n\r\n(ros::roseus \"hoge\")\r\n(pr2)\r\n(send *pr2* :look-at-target (send *pr2* :rarm :end-coords))\r\n\r\n(setq cam (send *pr2* :wide_stereo-left))\r\n(send cam :create-viewer)\r\n(send cam :draw-objects (list *pr2*))\r\n(setq img (send cam :get-image))\r\n\r\n(ros::advertise \"image\" sensor_msgs::Image 5)\r\n(unix:sleep 2)\r\n(setq seq 0)\r\n(ros::rate 10)\r\n(do-until-key\r\n (setq msg (ros::image->sensor_msgs/Image img :seq (inc seq) :frame_id \"hoge\"))\r\n (ros::publish \"image\" msg)\r\n (ros::sleep))\r\n```","created_at":"2015-11-05T11:43:28Z","updated_at":"2015-11-12T04:20:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6eeba9c4f6c15b4377db4495f0e81230d06ec66b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/393/commits","review_comments_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/393/comments","review_comment_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/issues/393/comments","statuses_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/statuses/f5cf65326bc6ed299abd878846fcfd25e85584c4","head":{"label":"furushchev:add-image-conversion","ref":"add-image-conversion","sha":"f5cf65326bc6ed299abd878846fcfd25e85584c4","user":{"login":"furushchev","id":1901008,"avatar_url":"https://avatars.githubusercontent.com/u/1901008?v=3","gravatar_id":"","url":"https://api.github.com/users/furushchev","html_url":"https://github.com/furushchev","followers_url":"https://api.github.com/users/furushchev/followers","following_url":"https://api.github.com/users/furushchev/following{/other_user}","gists_url":"https://api.github.com/users/furushchev/gists{/gist_id}","starred_url":"https://api.github.com/users/furushchev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furushchev/subscriptions","organizations_url":"https://api.github.com/users/furushchev/orgs","repos_url":"https://api.github.com/users/furushchev/repos","events_url":"https://api.github.com/users/furushchev/events{/privacy}","received_events_url":"https://api.github.com/users/furushchev/received_events","type":"User","site_admin":false},"repo":{"id":27227483,"name":"jsk_roseus","full_name":"furushchev/jsk_roseus","owner":{"login":"furushchev","id":1901008,"avatar_url":"https://avatars.githubusercontent.com/u/1901008?v=3","gravatar_id":"","url":"https://api.github.com/users/furushchev","html_url":"https://github.com/furushchev","followers_url":"https://api.github.com/users/furushchev/followers","following_url":"https://api.github.com/users/furushchev/following{/other_user}","gists_url":"https://api.github.com/users/furushchev/gists{/gist_id}","starred_url":"https://api.github.com/users/furushchev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furushchev/subscriptions","organizations_url":"https://api.github.com/users/furushchev/orgs","repos_url":"https://api.github.com/users/furushchev/repos","events_url":"https://api.github.com/users/furushchev/events{/privacy}","received_events_url":"https://api.github.com/users/furushchev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/furushchev/jsk_roseus","description":"JSK euslisp packages","fork":true,"url":"https://api.github.com/repos/furushchev/jsk_roseus","forks_url":"https://api.github.com/repos/furushchev/jsk_roseus/forks","keys_url":"https://api.github.com/repos/furushchev/jsk_roseus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/furushchev/jsk_roseus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/furushchev/jsk_roseus/teams","hooks_url":"https://api.github.com/repos/furushchev/jsk_roseus/hooks","issue_events_url":"https://api.github.com/repos/furushchev/jsk_roseus/issues/events{/number}","events_url":"https://api.github.com/repos/furushchev/jsk_roseus/events","assignees_url":"https://api.github.com/repos/furushchev/jsk_roseus/assignees{/user}","branches_url":"https://api.github.com/repos/furushchev/jsk_roseus/branches{/branch}","tags_url":"https://api.github.com/repos/furushchev/jsk_roseus/tags","blobs_url":"https://api.github.com/repos/furushchev/jsk_roseus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/furushchev/jsk_roseus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/furushchev/jsk_roseus/git/refs{/sha}","trees_url":"https://api.github.com/repos/furushchev/jsk_roseus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/furushchev/jsk_roseus/statuses/{sha}","languages_url":"https://api.github.com/repos/furushchev/jsk_roseus/languages","stargazers_url":"https://api.github.com/repos/furushchev/jsk_roseus/stargazers","contributors_url":"https://api.github.com/repos/furushchev/jsk_roseus/contributors","subscribers_url":"https://api.github.com/repos/furushchev/jsk_roseus/subscribers","subscription_url":"https://api.github.com/repos/furushchev/jsk_roseus/subscription","commits_url":"https://api.github.com/repos/furushchev/jsk_roseus/commits{/sha}","git_commits_url":"https://api.github.com/repos/furushchev/jsk_roseus/git/commits{/sha}","comments_url":"https://api.github.com/repos/furushchev/jsk_roseus/comments{/number}","issue_comment_url":"https://api.github.com/repos/furushchev/jsk_roseus/issues/comments{/number}","contents_url":"https://api.github.com/repos/furushchev/jsk_roseus/contents/{+path}","compare_url":"https://api.github.com/repos/furushchev/jsk_roseus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/furushchev/jsk_roseus/merges","archive_url":"https://api.github.com/repos/furushchev/jsk_roseus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/furushchev/jsk_roseus/downloads","issues_url":"https://api.github.com/repos/furushchev/jsk_roseus/issues{/number}","pulls_url":"https://api.github.com/repos/furushchev/jsk_roseus/pulls{/number}","milestones_url":"https://api.github.com/repos/furushchev/jsk_roseus/milestones{/number}","notifications_url":"https://api.github.com/repos/furushchev/jsk_roseus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/furushchev/jsk_roseus/labels{/name}","releases_url":"https://api.github.com/repos/furushchev/jsk_roseus/releases{/id}","created_at":"2014-11-27T13:56:41Z","updated_at":"2014-11-27T13:56:42Z","pushed_at":"2015-11-12T04:08:10Z","git_url":"git://github.com/furushchev/jsk_roseus.git","ssh_url":"git@github.com:furushchev/jsk_roseus.git","clone_url":"https://github.com/furushchev/jsk_roseus.git","svn_url":"https://github.com/furushchev/jsk_roseus","homepage":"https://github.com/jsk-ros-pkg/jsk_roseus","size":2179,"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":"master"}},"base":{"label":"jsk-ros-pkg:master","ref":"master","sha":"39b20a530503f1733d89a12798d451a5723cce3e","user":{"login":"jsk-ros-pkg","id":6836654,"avatar_url":"https://avatars.githubusercontent.com/u/6836654?v=3","gravatar_id":"","url":"https://api.github.com/users/jsk-ros-pkg","html_url":"https://github.com/jsk-ros-pkg","followers_url":"https://api.github.com/users/jsk-ros-pkg/followers","following_url":"https://api.github.com/users/jsk-ros-pkg/following{/other_user}","gists_url":"https://api.github.com/users/jsk-ros-pkg/gists{/gist_id}","starred_url":"https://api.github.com/users/jsk-ros-pkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsk-ros-pkg/subscriptions","organizations_url":"https://api.github.com/users/jsk-ros-pkg/orgs","repos_url":"https://api.github.com/users/jsk-ros-pkg/repos","events_url":"https://api.github.com/users/jsk-ros-pkg/events{/privacy}","received_events_url":"https://api.github.com/users/jsk-ros-pkg/received_events","type":"Organization","site_admin":false},"repo":{"id":17374645,"name":"jsk_roseus","full_name":"jsk-ros-pkg/jsk_roseus","owner":{"login":"jsk-ros-pkg","id":6836654,"avatar_url":"https://avatars.githubusercontent.com/u/6836654?v=3","gravatar_id":"","url":"https://api.github.com/users/jsk-ros-pkg","html_url":"https://github.com/jsk-ros-pkg","followers_url":"https://api.github.com/users/jsk-ros-pkg/followers","following_url":"https://api.github.com/users/jsk-ros-pkg/following{/other_user}","gists_url":"https://api.github.com/users/jsk-ros-pkg/gists{/gist_id}","starred_url":"https://api.github.com/users/jsk-ros-pkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsk-ros-pkg/subscriptions","organizations_url":"https://api.github.com/users/jsk-ros-pkg/orgs","repos_url":"https://api.github.com/users/jsk-ros-pkg/repos","events_url":"https://api.github.com/users/jsk-ros-pkg/events{/privacy}","received_events_url":"https://api.github.com/users/jsk-ros-pkg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jsk-ros-pkg/jsk_roseus","description":"ROS EusLisp Client","fork":false,"url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus","forks_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/forks","keys_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/teams","hooks_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/hooks","issue_events_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/issues/events{/number}","events_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/events","assignees_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/assignees{/user}","branches_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/branches{/branch}","tags_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/tags","blobs_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/git/refs{/sha}","trees_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/statuses/{sha}","languages_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/languages","stargazers_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/stargazers","contributors_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/contributors","subscribers_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/subscribers","subscription_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/subscription","commits_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/commits{/sha}","git_commits_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/git/commits{/sha}","comments_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/comments{/number}","issue_comment_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/issues/comments{/number}","contents_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/contents/{+path}","compare_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/merges","archive_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/downloads","issues_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/issues{/number}","pulls_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls{/number}","milestones_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/milestones{/number}","notifications_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/labels{/name}","releases_url":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/releases{/id}","created_at":"2014-03-03T18:00:06Z","updated_at":"2015-11-03T07:41:54Z","pushed_at":"2015-11-12T04:08:10Z","git_url":"git://github.com/jsk-ros-pkg/jsk_roseus.git","ssh_url":"git@github.com:jsk-ros-pkg/jsk_roseus.git","clone_url":"https://github.com/jsk-ros-pkg/jsk_roseus.git","svn_url":"https://github.com/jsk-ros-pkg/jsk_roseus","homepage":"http://wiki.ros.org/roseus/Tutorials","size":4176,"stargazers_count":4,"watchers_count":4,"language":"Common Lisp","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":32,"forks":22,"open_issues":32,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/393"},"html":{"href":"https://github.com/jsk-ros-pkg/jsk_roseus/pull/393"},"issue":{"href":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/issues/393"},"comments":{"href":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/issues/393/comments"},"review_comments":{"href":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/393/comments"},"review_comment":{"href":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/pulls/393/commits"},"statuses":{"href":"https://api.github.com/repos/jsk-ros-pkg/jsk_roseus/statuses/f5cf65326bc6ed299abd878846fcfd25e85584c4"}}}}