模拟localization运行
需要先将rosbag play demo_2.5.bag --loop
然后中断,再播放只有imu和odom数据的bag
localization才能定位,应该是里面有哪个topic先初始化了localization,然后才能正常地识别imu和odom数据.
模拟percetion运行
使用的bag: demo_2.5.bag ,场景 : navi percetion
配置文件:默认的 modules/perception/conf/dag_streaming_lowcost.config
。
dag_streaming_lowcost.config
文件可以看出percetion的数据流动图
订阅的topics
/apollo/sensor/camera/obstacle/front_6mm
/apollo/canbus/chassis //非必须
/apollo/sensor/conti_radar
/apollo/sensor/camera/traffic/image_long //非必须
/apollo/sensor/camera/traffic/image_short //非必须
/apollo/sensor/velodyne64/compensator/PointCloud2
/apollo/localization/pose
/tf //非必须
发布的topics
/apollo/perception/traffic_light [pb_msgs/TrafficLightDetection]
/apollo/perception/obstacles [pb_msgs/PerceptionObstacles]
/rosout [rosgraph_msgs/Log]
模拟过程:
在dreamview中只打开navi percetion模块,然后用rosbag 播放demo_2.5.bag数据
模拟结果:
a.
最少topics数据模拟出障碍信息
rosbag play --loop demo_2.5.bag --topics /apollo/sensor/camera/obstacle/front_6mm /apollo/sensor/conti_radar /apollo/localization/pose
b.
fusion subnode 输出障碍信息
c.
没有摄像头数据,只有毫米波数据,无法生成障碍数据
rosbag play --loop demo_2.5.bag --topics /apollo/sensor/conti_radar /apollo/canbus/chassis /tf /apollo/localization/pose
没有毫米波数据,只有摄像头数据,可以生成障碍数据,输出的数据与带有毫米波topics的一致
rosbag play --loop demo_2.5.bag --topics /apollo/sensor/camera/obstacle/front_6mm /apollo/canbus/chassis /tf /apollo/localization/pose
踩坑
0.需要提前安装NVIDIA驱动和cuda组件
nvidia驱动,可以用命令nvidia-smi验证是否安装成功
cuda组件,不要到博客里面找攻略,要去官网上找安装指导,虽然都是英文的,但比博客里的攻略靠谱很多
1.安装完NVIDIA驱动和cuda组件后,重启有很大概率无法正常进入桌面,有些是卡死在密码输入之后,有些是卡死在登录界面。网上的解决方法很多,但没有几个靠谱的。我们这里也没有,目前进入系统的方法是,在选择系统时,进入
adventure选项->再进入recovery当中->在选择Resume启动,哎,都时泪啊~~
2.运行navi percetion必须需要nvidia驱动和cuda组件,并且,编译命令是build_opt_gpu
,使用build_gpu
编译选项percetion运行时会出现空指针问题。问题日志如下,这个空指针问题在最新的代码(不包括2.5)中已被修改。
[NVBLAS] NVBLAS_CONFIG_FILE environment variable is NOT set : relying on default config filename 'nvblas.conf'
[NVBLAS] Cannot open default config file 'nvblas.conf'
[NVBLAS] Config parsed
[NVBLAS] CPU Blas library need to be provided
perception: /usr/include/boost/circular_buffer/base.hpp:461: boost::circular_buffer<T, Alloc>::reference boost::circular_buffer<T, Alloc>::back() [with T = apollo::perception::VehicleStatus; Alloc = std::allocator<apollo::perception::VehicleStatus>; boost::circular_buffer<T, Alloc>::reference = apollo::perception::VehicleStatus&]: Assertion `!empty()' failed.
[ WARN] [1528084727.152928984]: transport file: /home/tmp/ros/etc/ros/transport_mode.yaml is not map
[ WARN] [1528084727.153111661]: Parse transport_mode file failed
#0 0x00007f211df54c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007f211df58028 in __GI_abort () at abort.c:89
#2 0x00007f211df4dbf6 in __assert_fail_base (fmt=0x7f211e0a2018 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x120f05c "!empty()",
file=file@entry=0x120f030 "/usr/include/boost/circular_buffer/base.hpp", line=line@entry=461,
function=function@entry=0x1210580 <boost::circular_buffer<apollo::perception::VehicleStatus, std::allocator<apollo::perception::VehicleStatus> >::back()::__PRETTY_FUNCTION__> "boost::circular_buffer<T, Alloc>::reference boost::circular_buffer<T, Alloc>::back() [with T = apollo::perception::VehicleStatus; Alloc = std::allocator<apollo::perception::VehicleStatus>; boost::circ"...) at assert.c:92
#3 0x00007f211df4dca2 in __GI___assert_fail (assertion=0x120f05c "!empty()",
file=0x120f030 "/usr/include/boost/circular_buffer/base.hpp", line=461,
function=0x1210580 <boost::circular_buffer<apollo::perception::VehicleStatus, std::allocat