Why the output of some topic delays with IDEs?
I wrote small code to see the time of the output for "/move_base/status"
topic.
This is my code:
#!/usr/bin/env python
import rospy
from actionlib_msgs.msg import GoalStatusArray
def callback(data):
print(data.status_list[0].status)
def listener():
rospy.init_node('listener', anonymous=True)
rospy.Subscriber("/move_base/status", GoalStatusArray, callback)
rate = rospy.Rate(50)
while not rospy.is_shutdown():
rate.sleep()
if __name__ == '__main__':
listener()
At the same time, I run the topic in the terminal $ rostopic echo /move_base/status
here it was fast
I observed around 6 sec delay with pycharm
compared to the terminal.
Is there a scientific explanation for this?
Hey Redhwan, maybe it's a configuration problem?
For example I'm using the ros environment with visual studio code combined with a ssh connection and my rostopic data needs 10 - 20ms.
First of all, thank you for your comment. This topic is depending on actionlib_msgs, which is installed without configuration. I really confused. I used both
pycharm
andvisual studio
. The same results.This topic only late, rest of topics are fine.