apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Simulation with obstacles?

Open wckorealsh opened this issue 8 years ago • 5 comments

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!

wckorealsh avatar Jun 01 '18 14:06 wckorealsh

You can publish perception obstacles defined by yourself just like perception modules does.

siyangy avatar Jun 04 '18 23:06 siyangy

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.

unacao avatar Jun 13 '18 17:06 unacao

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 17:06 lesun90

Anybody able to fix this issue?

kk2491 avatar Mar 29 '19 14:03 kk2491

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

apollodevcommunity avatar Feb 07 '21 06:02 apollodevcommunity