clearpathrobotics / robot_upstart

ROS package of helper functions related to bringing up roslaunch on system startup.
BSD 3-Clause "New" or "Revised" License
196 stars 96 forks source link

Clarify the reason of the error due to wrong pkgpath passed. #57

Closed 130s closed 7 years ago

130s commented 7 years ago

Issue When the path passed to pkgpath does NOT start from the path of the directory of the package your upstart launch is located at, the following error occurs, which does not provide enough info why failing.

$ rosrun robot_upstart install catkin_ws/src/foo/foo_support/launch/upstart.launch --user autoboot --setup /etc/ros/setup.bash
Unable to locate path src/foo/foo_support/launch/upstart.launch in package catkin_ws. Installation aborted.
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/robot_upstart/install", line 32, in <module>
    exit(main())
  File "/opt/ros/indigo/lib/python2.7/dist-packages/robot_upstart/install_script.py", line 80, in main
    if os.path.isfile(found_path[0]):
      IndexError: list index out of range

Solution In the error message, clearly instruct what path should be passed. Also add more description to the result of "help".

Output example

$ rosrun robot_upstart install /home/ros/catkin_ws/src/foo/foo_support/launch/upstart.launch --user autoboot --setup /etc/ros/setup.bash
Unable to locate package your job launch is in. Installation aborted. Make sure the path starts with the package name (e.g. don't pass absolute path nor a path starting from workspace top folder etc.)
pkgpath passed: home/ros/foo_ws/src/foo/foo_support/launch/upstart.launch.
mikepurvis commented 7 years ago

Looks reasonable, thanks!