apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Unable to connect subscriber to publisher [http://in_dev_docker:41833/] for topic [/apollo/perception/obstacles]: unable to requestTopic: [Errno 111] Connection refused

Open lesun90 opened this issue 8 years ago • 3 comments

Hi, I wrote a simple python tool to see the perception data (code below), basically, I subscribe to /apollo/perception/obstacles and print out the data It works well when I play a rosbag, it display the perception data as I wanted. But when not running a rosbag, and I turn on the perception module, I get this error Unable to connect subscriber to publisher [http://in_dev_docker:41833/] for topic [/apollo/perception/obstacles]: unable to requestTopic: [Errno 111] Connection refused

#!/usr/bin/env python
import rospy
from std_msgs.msg import String
import threading
import numpy as np
from modules.perception.proto import perception_obstacle_pb2


def callback(data):
    print data
    print '-----------------'

def listener():
    rospy.init_node('perception_sub', anonymous=True)
    rospy.Subscriber('/apollo/perception/obstacles',perception_obstacle_pb2.PerceptionObstacles, callback)
    rospy.spin()

if __name__ == '__main__':
    listener()

lesun90 avatar Jun 13 '18 16:06 lesun90

#4338 part of this request

unacao avatar Jun 13 '18 17:06 unacao

Without running the python script, do you get any results from running:

rostopic echo /apollo/perception/obstacles

jilinzhou avatar Jun 21 '18 03:06 jilinzhou

Same here. I got the same error output when I try to play a bag and echo some topic. I got the msg:

/use_sim_time is not set, will not subscribe to simulated time [/clock] topic

And I tried to set use_sim_time as true. Then I got the same error msg as:

[ERROR] [WallTime: 1529551855.971586] [0.000000] Unable to connect subscriber to publisher [http://in_dev_docker:39765/] for topic [/clock]: unable to requestTopic: [Errno 111] Connection refused

I don't know why. Right now I cannot echo any topic ... @unacao

ImCabbage avatar Jun 21 '18 03:06 ImCabbage