{"action":"opened","issue":{"url":"https://api.github.com/repos/bponsler/roslaunch_to_dot/issues/2","labels_url":"https://api.github.com/repos/bponsler/roslaunch_to_dot/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/bponsler/roslaunch_to_dot/issues/2/comments","events_url":"https://api.github.com/repos/bponsler/roslaunch_to_dot/issues/2/events","html_url":"https://github.com/bponsler/roslaunch_to_dot/issues/2","id":127078825,"number":2,"title":"Does not handle relative paths","user":{"login":"bponsler","id":1627139,"avatar_url":"https://avatars.githubusercontent.com/u/1627139?v=3","gravatar_id":"","url":"https://api.github.com/users/bponsler","html_url":"https://github.com/bponsler","followers_url":"https://api.github.com/users/bponsler/followers","following_url":"https://api.github.com/users/bponsler/following{/other_user}","gists_url":"https://api.github.com/users/bponsler/gists{/gist_id}","starred_url":"https://api.github.com/users/bponsler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bponsler/subscriptions","organizations_url":"https://api.github.com/users/bponsler/orgs","repos_url":"https://api.github.com/users/bponsler/repos","events_url":"https://api.github.com/users/bponsler/events{/privacy}","received_events_url":"https://api.github.com/users/bponsler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-17T07:02:41Z","updated_at":"2016-01-17T07:02:41Z","closed_at":null,"body":"The roslaunch_to_dot script does not properly handle relative paths to the main launch file given. For example calling:\r\n\r\n    $ ./roslaunch_to_dot launch/example.launch /tmp/example.dot\r\n\r\nWill generate the following Exception output:\r\n\r\n    Traceback (most recent call last):\r\n      File \"roslaunch-to-dot.py\", line 1312, in <module>\r\n        dot = launchFile.toDot()\r\n      File \"roslaunch-to-dot.py\", line 401, in toDot\r\n        packageMap = self.getPackageMap()\r\n      File \"roslaunch-to-dot.py\", line 348, in getPackageMap\r\n        packageName = launchFile.getPackageName()\r\n      File \"roslaunch-to-dot.py\", line 225, in getPackageName\r\n        raise Exception(\"Failed to get package name for: %s\" % self.__filename)\r\n    Exception: Failed to get package name for: launch/example.launch\r\n    ERROR: failed to generate dot file contents...\r\n\r\nThis is because it is attempting to locate the name of the package that contains the launch file, and it does this by finding the directory directly before the 'launch' directory in the path. It was improperly assuming that the path would be an absolute path and thus breaks when it is not."}}