better error message if message load fails. suggests rosmake

This commit is contained in:
Ken Conley 2009-10-16 16:24:58 +00:00
parent dd3d0de2eb
commit efa78977a9
1 changed files with 2 additions and 1 deletions

View File

@ -935,7 +935,8 @@ def create_publisher(topic_name, topic_type, latch):
except:
raise ROSTopicException("invalid topic type: %s"%topic_type)
if msg_class is None:
raise ROSTopicException("invalid topic type: %s"%topic_type)
pkg = roslib.names.resource_name_package(topic_type)
raise ROSTopicException("invalid message type: %s.\nIf this is a valid message type, perhaps you need to type 'rosmake %s'"%(topic_type, pkg))
rospy.init_node('rostopic', anonymous=True)
pub = rospy.Publisher(topic_name, msg_class, latch=latch)
return pub, msg_class