apollo icon indicating copy to clipboard operation
apollo copied to clipboard

怎么使用apollo1.5提供的模拟器

Open ahuer2435 opened this issue 9 years ago • 17 comments

您好, 请问如何使用apollo1.5提供的模拟器,有具体操作手册?

ahuer2435 avatar Sep 22 '17 08:09 ahuer2435

https://github.com/ApolloAuto/apollo/blob/master/docs/demo_guide/README.md

rosbag play docs/demo_guide/demo_1.5.bag --loop

ycool avatar Sep 22 '17 16:09 ycool

When I run this command, it shows "rosbag: command not found". Do I need to install anything?

Gavin2318 avatar Sep 22 '17 17:09 Gavin2318

@Gavin2318 you have to run this command inside docker environment

startcode avatar Sep 23 '17 00:09 startcode

@Gavin2318 you can try to run "source /apollo/third_party/ros_x86_64/setup.bash" command to initialize ROS environment before running "rosbag" command.

fy2462 avatar Sep 23 '17 07:09 fy2462

@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?

Gavin2318 avatar Sep 24 '17 02:09 Gavin2318

@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/" screen shot 2017-09-24 at 10 23 51

Gavin2318 avatar Sep 24 '17 02:09 Gavin2318

@Gavin2318 did you build apollo insider docker? If not, you can build it and try again.

bash apollo.sh build

startcode avatar Sep 24 '17 05:09 startcode

您好, 已经可以打开8887和8888端口,然后执行“rosbag play docs/demo_guide/demo_1.5.bag --loop” 也可以看到汽车行驶图,不过感觉这个似乎和apollo1.0的回放功能很相近,然后我想问如果没有实体车,可以测试“Follow Traffic”的“start auto”?

ahuer2435 avatar Sep 25 '17 03:09 ahuer2435

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.

startcode avatar Sep 25 '17 17:09 startcode

进入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 avatar Sep 26 '17 01:09 ahuer2435

@ahuer2435 你进入 docs/demo_guide 这个目录再执行 rosbag filter ....

westeast avatar Sep 28 '17 06:09 westeast

@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 avatar Sep 28 '17 06:09 ahuer2435

@ahuer2435 这是你系统没权限了,或者没空间了,检查下其它文件能正常创建不

westeast avatar Sep 28 '17 06:09 westeast

我是在docker image下运行的,rosbag play docs/demo_guide/demo_1.5.bag --loop这条命令可以运行,然后当前用户属于sudo组,磁盘也还有空间。如下: error3

ahuer2435 avatar Sep 28 '17 06:09 ahuer2435

@ahuer2435 happen to same problem, what is the final solution?

RH-Song avatar Oct 09 '17 13:10 RH-Song

I cannot reproduce this issue. Could you show the result of "ls -al docs/demo_guide"?

xiaoxq avatar Oct 09 '17 13:10 xiaoxq

今天重新试了下,问题不出现了,因为上次实验实在十一前,所以记不清中间都做过什么操作,不过我想可能和宿主机磁盘空间有关系,当时有问题时,虚拟磁盘所在的宿主机分区空间经常不足,经常90%多,后来清空了一部分,现在58%,没有再出现这个问题了@RH-Song @xiaoxq

ahuer2435 avatar Oct 10 '17 00:10 ahuer2435