apollo icon indicating copy to clipboard operation
apollo copied to clipboard

how to run perception module with rosbag playing?

Open hzdsdhr opened this issue 8 years ago • 12 comments

Hi all, I'm trying to do some offline test regarding the traffic light detection function of Apollo. Since I don't have cameras, I download the bag files provided by Apollo(demo-2.0, 3.2G). Here is what I do:

  1. scripts/bootstrap.sh
  2. chose map sunnyvale_loop and vehicle mkz8 in dreamview
  3. rosbag play -l demo2.0.bag
  4. check all the topics the traffic light detection needs:/tf, /tf_static, /apollo/sensor/camera/traffic/image_short(long), /apollo/localization/pose
  5. enable the perception module in dreamview I can see that the obstacle detection of perception works, since I can see obstacles in dreamview(there is no obstacle topic in bag file, only PointCLoud2 topic).But the traffic detection is not working, since in dreamview, the traffic light detection result is no signal, even when the car stops at the instersection. I check the log file named perception.ERROR, here it is: issue It seems to be the time issue of tf in ros, then I tried to play the bag file with /use_sim_time to be true and false, the same error occurs. Has someone figure this out? Thank you!

hzdsdhr avatar May 15 '18 05:05 hzdsdhr

@jinghaomiao @xiaohuitu Hi, do you have updates about this? Really appreciate your help.

hzdsdhr avatar May 21 '18 02:05 hzdsdhr

I've download rosbag from here(http://data.apollo.auto/help?name=data-sensor%20demostration-user%20guide&data_key=sensor&data_type=1&locale=zh-cn&lang=en). I found the timestamp is around 1513807824~1513807884 second, which is different from yours.

So where did you get the bag? could you give me the link?

ghdawn avatar May 25 '18 04:05 ghdawn

@ghdawn I use the same bag. The one named "demo-sensor-data-apollo-2.0.tar.gz", which size is 3.2GB. Have you successfully run the traffic light detection with rosbag playing?

hzdsdhr avatar May 28 '18 00:05 hzdsdhr

I can run detection with this bag. However, there is only one light at the beginning of bag, about 3 second. Then there is no light and you won't see any detection result.

screenshot - 2018 06 05 - 16 18 35

ghdawn avatar Jun 05 '18 08:06 ghdawn

@ghdawn How did you manage to see the video output with detection on it?

linux-devil avatar Jun 05 '18 11:06 linux-devil

vim modules/perception/conf/perception.conf find --output_debug_img set to true rerun perception , when querying hdmap successfully,you will see the video

ghdawn avatar Jun 06 '18 03:06 ghdawn

@ghdawn

Are you able to explain the difference between? --output_debug_img and --output_raw_img ?

I tried toggling both of these, and still do not understand how to see the video/images?

when using a camera or by playing one of the demo rosbags

Can you help?

snuffysasa avatar Jun 15 '18 20:06 snuffysasa

@ghdawn Just want to know, do you run the apollo system in docker? And do you have apollo RT kernel on your computer?

hzdsdhr avatar Jun 19 '18 10:06 hzdsdhr

@snuffysasa Hi, output_debug_img means : when traffic light module has query pose and hd-map successfully, a window (as I pasted) will show the image we choosed with some infomation. output_raw_img means, write images received to disk. User should create the directories, which names are defined in modules/perception/traffic_light/base/image.h ("short_focus_camera_6mm" and "long_focus_camera_25mm")

ghdawn avatar Jun 21 '18 10:06 ghdawn

@hzdsdhr I run the apollo system in docker following steps below: *./docker/scripts/dev_start.sh * *./docker/scripts/dev_into.sh *

I don't known what apollo RT kernel is .

ghdawn avatar Jun 21 '18 10:06 ghdawn

Thank you for your answer. And do you run /apollo/scripts/time_sync.sh before you run apollo?

hzdsdhr avatar Jun 21 '18 10:06 hzdsdhr

@ghdawn Should I re-build apollo after enabling --output_debug_img ?

wujiyoung avatar Oct 18 '18 08:10 wujiyoung