ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The problem could be in this line:

h = rospy.Header()

Header belongs to std_msgs, and it's already being imported in from std_msgs.msg import Header, Float32. Try this instead:

h = Header()
h.stamp = rospy.Time.now()

The problem could be in this line:

line: h = rospy.Header()
rospy.Header()

Header belongs to std_msgs, and it's already being imported in from std_msgs.msg import Header, Float32. Try this instead:

h = Header()
h.stamp = rospy.Time.now()

The problem could be in this line: h = rospy.Header()

Header belongs to std_msgs, and it's already being imported in from std_msgs.msg import Header, Float32. Try this instead:

h = Header()
h.stamp = rospy.Time.now()

(check out the accepted answer to What is the proper way to create a Header with python?)