怎么使用apollo1.5提供的模拟器
您好, 请问如何使用apollo1.5提供的模拟器,有具体操作手册?
https://github.com/ApolloAuto/apollo/blob/master/docs/demo_guide/README.md
rosbag play docs/demo_guide/demo_1.5.bag --loop
When I run this command, it shows "rosbag: command not found". Do I need to install anything?
@Gavin2318 you have to run this command inside docker environment
@Gavin2318 you can try to run "source /apollo/third_party/ros_x86_64/setup.bash" command to initialize ROS environment before running "rosbag" command.
@startcode Thanks for you your help! I have run the codes below:
bash docker/scripts/dev_start.sh
bash docker/scripts/dev_into.sh
So I assume I am in docker environment already? But when I ran rosbag play docs/demo_guide/demo_1.5.bag --loop, it still shows "rosbag: command not found".
Do you have any ideas why?
@fy2462 Thanks!
When I ran source /apollo/third_party/ros_x86_64/setup.bash, it shows
"bash: /apollo/third_party/ros_x86_64/setup.bash: No such file or directory", and I went to the folder and check, there is no folder " /apollo/third_party/ros_x86_64/"

@Gavin2318 did you build apollo insider docker? If not, you can build it and try again.
bash apollo.sh build
您好, 已经可以打开8887和8888端口,然后执行“rosbag play docs/demo_guide/demo_1.5.bag --loop” 也可以看到汽车行驶图,不过感觉这个似乎和apollo1.0的回放功能很相近,然后我想问如果没有实体车,可以测试“Follow Traffic”的“start auto”?
The demo_1.5.bag is a short snapshot. But you still can filter out the planning message of the bag, and run a live planning module to see how it behaves in realtime, this is a quick way to do a quick test of features like "Follow Traffic".
To filter out planning message
rosbag filter demo_1.5.bag demo_1.5_no_planning.bag "topic != '/apollo/planning'"
After that, play the filtered bag
rosbag play -l demo_1.5_no_planning.bag
Then you can see there is no green band in front of the car on the playback. After you modify the existing planning code, and successfully compiled, you can start the planning module by command
/apollo/bazel-bin/modules/planning/planning --flagfile=modules/planning/conf/planning.conf --log_dir=/apollo/data/log --align_prediction_time=false -v=4
or simply switch on the planning module in 8887 window.
Then, click "Default Routing" in dreamview (localhost:8888) to see the planning results. You will be able to see the green band, which is the realtime computed planning result.
In another terminal, you can use
python modules/tools/mapshow/plot_planning.py
to see intermediate results of planning.
进入docker之后,先执行rosbag play docs/demo_guide/demo_1.5.bag --loop之后,一切正常。然后再执行rosbag filter demo_1.5.bag demo_1.5_no_planning.bag "topic != '/apollo/planning'"报错如下:Cannot locate input bag file [demo_1.5.bag],然后我改为rosbag filter docs/demo_guide/demo_1.5.bag demo_1.5_no_planning.bag "topic != '/apollo/planning'"报错如下: IOError: [Errno 13] Permission denied: 'demo_1.5_no_planning.bag'
@ahuer2435 你进入 docs/demo_guide 这个目录再执行 rosbag filter ....
@westeast 进入docs/demo_guide应该是解决Cannot locate input bag file [demo_1.5.bag]问题,但是进入之后依然有IOError: [Errno 13] Permission denied: 'demo_1.5_no_planning.bag'问题。
@ahuer2435 这是你系统没权限了,或者没空间了,检查下其它文件能正常创建不
我是在docker image下运行的,rosbag play docs/demo_guide/demo_1.5.bag --loop这条命令可以运行,然后当前用户属于sudo组,磁盘也还有空间。如下:

@ahuer2435 happen to same problem, what is the final solution?
I cannot reproduce this issue. Could you show the result of "ls -al docs/demo_guide"?
今天重新试了下,问题不出现了,因为上次实验实在十一前,所以记不清中间都做过什么操作,不过我想可能和宿主机磁盘空间有关系,当时有问题时,虚拟磁盘所在的宿主机分区空间经常不足,经常90%多,后来清空了一部分,现在58%,没有再出现这个问题了@RH-Song @xiaoxq