Ask Your Question
0

roslib.message.get_message_class returns None

asked 2018-12-13 05:54:50 -0500

G gravatar image

I'm trying to create a tool that can dynamicly read service call descriptions from a yaml file and call the services accordingly. (in rospy on kinetic)

If i try to resolve a non-standard service type form a string, roslib.message.get_message_class returns None. Why does this happen? Shouldn't it either throw an error, like when the string doesn't mean anything, or return the correct type?


try:
  msg_type = roslib.message.get_message_class('somethingstupid')
  if msg_type is None:
    rospy.logwarn('msg_type is None')
except:
  rospy.logerr('roslib.message.get_message_class failed')

results in

roslib.message.get_message_class failed

while

try:
  msg_type = roslib.message.get_message_class('my_package/MyMsgType')
  if msg_type is None:
    rospy.logwarn('msg_type is None')
except:
  rospy.logerr('roslib.message.get_message_class failed')

results in

msg_type is None

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-12-17 02:42:26 -0500

G gravatar image

"get_service_class" would have been the solution.

sorry for the useless question

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-12-13 05:54:50 -0500

Seen: 107 times

Last updated: Dec 17 '18