From efa78977a9708f8796f8d29a9d299b0821ccf2da Mon Sep 17 00:00:00 2001 From: Ken Conley Date: Fri, 16 Oct 2009 16:24:58 +0000 Subject: [PATCH] better error message if message load fails. suggests rosmake --- tools/rostopic/src/rostopic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/rostopic/src/rostopic.py b/tools/rostopic/src/rostopic.py index 8e691c1c..94990c10 100644 --- a/tools/rostopic/src/rostopic.py +++ b/tools/rostopic/src/rostopic.py @@ -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