AttributeError: 'String' object has no attribut 'ip'
I try to run the code that is listed but it gives me the attribute error. The package is called "communication" and the message file is called "ipadres.msg". The goal is that I create a subsciber to my custom message
!/usr/bin/env python
import rospy
from std_msgs.msg import String
from communication.msg import ipadres
rospy.init_node('odometry_publisher')
def callback(data):
print data.ip
subscriber = rospy.Subscriber('ipadres',String,callback)
rospy.spin()
My message file looks like this:
string ip