Simulation with obstacles?
Hello Apollo team,
Is it possible to set up obstacle vehicles in the dream view simulation (SimControl) environment or it is possible only in Azure based simulation service?
Thank you!
You can publish perception obstacles defined by yourself just like perception modules does.
Different modules communicate with each other by publishing/subscribing to ros topics. In the case of perception obstacles, the ros topic is /apollo/perception/obstacles. If you can mimic perception module by publishing the obstacle information via this ros topic, the other modules such as prediction and planning will be able to respond to it. What you need to do is to fill in the obstacle information according to the proto defined here, and publish the messages at your desired timestamp.
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()
Anybody able to fix this issue?
Yes you can use modules/tools/perception/garage_perception.bash to publish fake perception obstacles. ——Reply reference comes from the Apollo developer community issue master contest https://apollo.auto/developer/questiondata_cn.html?target=684