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

way to create loop without rospy.spin

asked 2022-05-02 02:49:52 -0600

distro gravatar image

updated 2022-05-02 03:17:17 -0600

Is there a way to make a node keep looping(publishing and subscribing) without using rospy.spin()? Do I need to use rospy.spin for my subscriber to to keep seeking out messages from the the topics its subscribed to?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-05 09:42:12 -0600

Alex-SSoM gravatar image

rospy.spin() is the way. Your subscriber callback will be called each time a new message comes in.

Here's a good reference on how to write a python ROS node with procedural programming and OPP https://roboticsbackend.com/oop-with-...

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-05-02 02:49:52 -0600

Seen: 103 times

Last updated: May 05 '22