类似的错误信息如下:
[ERROR] [1611906790.607272604]: Client [/listener_5059_456439] wants topic /move_base_simple/goal to have datatype/md5sum [std_msgs/String/992ce8a1687cec8c8bd883ec73ca41d1], but our version has [geometry_msgs/PoseStamped/d3812c3cbc69362b77dc0b19b345f8f5]. Dropping connection.
表示 std_msgs/String 用错了,应该是用 geometry_msgs/PoseStamped
把代码中的 rospy.Subscriber("move_base_simple/goal", String, callback) 这一行改为:
rospy.Subscriber("move_base_simple/goal", PoseStamped, callback)
头部 from std_msgs.msg import String 改为 :from geometry_msgs.msg import PoseStamped