Question: i wrote a subscriber python code but i did not find the mistake #!/usr/bin/env python import rospy from std_msgs.msg import String def talker() : pub

i wrote a subscriber python code but i did not find the mistake

#!/usr/bin/env python

import rospy

from std_msgs.msg import String

def talker() :

pub = rospy.Publisher('our_first_topic',String,queue_size=10)

rospy.init_node('publisher_node' ,anonymous=True)

rate = rospy.Rate(10)

while not rospy.is_shutdown():

first_msg = "Catch me :)"

rospy.loginfo(first_msg)

pub.publish(first_msg)

rate.sleep()

if __name__ == '__main__':

talker()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!