0
$\begingroup$

Rosanswers logo

I have two nodes, one publishes a topic (https://github.com/pitosalas/easy_filter/blob/master/scripts/obstacle_detector.py) that the other one (https://github.com/pitosalas/easy_filter/blob/master/scripts/livelyobstacles.py) subscribes to. What happens is if I run the publsher by itself, all is well. But if I do a rostopic echo on the relevant topic then the publisher starts throwing that exception.

Three notes:

  1. I've been debugging for a while, with control-c and kill commands to try and cleanup. I could be in some kind of bad state. But then my question is: how do I tell and how do I get out of the bad state? What do I reboot, my development computer, my robot, my roscore computer, all of them? And how do I avoid getting into this state.
  2. Minor: is the / before the topic name (when used in the publish or subscribe call) required, optional or sometimes yes and sometimes no?
  3. I am working in python,

Originally posted by pitosalas on ROS Answers with karma: 628 on 2018-08-01

Post score: 0


Original comments

Comment by NEngelhard on 2018-08-01:
It's much more likely that someone can help you debug your code if you show the code.

Comment by pitosalas on 2018-08-01:
Done. See links added above.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Sorry, I found the bug. See line 11 and 12 of the obstacle_detector.py:

    self.sub = rospy.Subscriber('/scan', LaserScan, self.scan, queue_size=1)
    self.pub = rospy.Publisher('obstacle', Obstacle, self.scan, queue_size =10)

As they say... "never mind" :(


Originally posted by pitosalas with karma: 628 on 2018-08-01

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by sirrarthur on 2021-06-29:
I made the same mistake putting the wrong arguments into the publisher. In my case I just wrote "10" instead of "queue_size = 10"

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.