Skip to content

Commit

Permalink
Merge pull request start-jsk#496 from 130s/impr/exceptionmsg
Browse files Browse the repository at this point in the history
[ros_bridge] Improve error message when no running ROS found.
  • Loading branch information
130s authored Apr 5, 2017
2 parents b01ea5e + 2bd1166 commit 2125a56
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hironx_ros_bridge/scripts/hironx.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
from hrpsys import rtm
import argparse

errormsg_noros = 'No ROS Master found. Without it, you cannot use ROS from' \
' this script, but can use RTM. To use ROS, do not forget' \
' to run rosbridge. How to do so? --> http://wiki.ros.org/rtmros_nextage/Tutorials/Operating%20Hiro%2C%20NEXTAGE%20OPEN'

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='hiro command line interpreters')
parser.add_argument('--host', help='corba name server hostname')
Expand Down Expand Up @@ -81,9 +85,9 @@
try:
ros = ROS_Client()
except ROSInitException as e:
print("\033[31m%s\n%s\033[0m" % (e.strerror, errormsg))
print('[nextage.py] {}'.format(e))
except socket.error as e:
print("\033[31m%s\n%s\033[0m" % (e.strerror, errormsg))
print("\033[31m%s\n%s\033[0m" % (e.strerror, errormsg_noros))

# for simulated robot
# $ ./hironx.py
Expand Down

0 comments on commit 2125a56

Please sign in to comment.