简介
代码结构
├── autoware #主要源代码
├── car_demo #主要与仿真相关
├── citysim #主要与仿真相关
├── drivers #不需要太关注,主要与上车测试相关
└── vendor #不需要太关注,主要与上车测试相关
├── autoware
│ ├── common #通用功能
│ ├── core_perception #感知定位
│ ├── core_planning #规划控制
│ ├── documentation #
│ ├── messages #较重要,定义接口
│ ├── simulation #仿真可视化
│ ├── utilities #通用工具
│ └── visualization #仿真可视化
修改launch文件也要编译,因为用的是install里的launch文件
调试时node加上output
编译所有包:
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
编译单个包:
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-select "packagename"
启动顺序
这里直接用launch文件启动,不要官方UI界面
修改点:
- 在my_map.launch中启动的tf.launch中,添加雷达到底盘的变换,并换成tf2_ros包,如下:
<!---->
<launch>
<!-- 从world到map的变换 -->
<node pkg="tf2_ros" type="static_transform_publisher" name="world_to_map" args="14771 84757 -39 0 0 0 /world /map" />
<!--从map到mobility的变换-->
<node pkg="tf2_ros" type="static_transform_publisher" name="map_to_mobility" args="0 0 0 0 0 0 /map /mobility" />
<!--从base_link到雷达点云的变换-->
<node pkg="tf2_ros" type="static_transform_publisher" name="base_link_to_velodyne" args="1.2 0 2 0 0 0 /base_link /velodyne" />
</launch>
- 在启动my_localization.launch前,加载无界面时的参数
dianhua@xie:~/autoware.ai/relative_files$ rosparam load headless_setup.yaml
然后依次启动autoware_quickstart_examples包的地图加载、定位、决策规划启动文件
视频笔记记录
-
关于坐标系
/map:地图坐标系
/world:世界坐标系,真正地理意义上的,主要为了和GPS匹配。
另外由于官方demo地图比较大,/map坐标系很远,可以通过tf.launch修改。在找地图坐标系时回不去车体,换成第三视角即可 -
data/tf.launch中如果用tf1显示会出现问题
-
建图与定位实质就是研究坐标系之间的线性关系,定位指base_link在map下的位置
-
官方感知只做了第一步---点云聚类
-
miss和motion两个启动文件启动有问题,miss文件中加载路径点的目录写法有问题
-
然后做了gazbo环境下的仿真,还演示了astar和op_planner规划
答疑
安装运行
安装教程参考:这篇博客
- 未定义的引用关于CV::MAT,没有包含opencv库,找到对应CMakeLists.txt参考下面添加:
cmake_minimum_required( VERSION 2.8 )
project(imageBasics)
set( CMAKE_CXX_FLAGS "-std=c++11 -O3")
find_package(OpenCV)
include_directories(${OpenCV})
add_executable(imageBasics imageBasics.cpp)
链接OpenCV库
target_link_libraries(imageBasics ${OpenCV_LIBS})
add_executable(undistortImage undistortImage.cpp)
链接OpenCV库
target_link_libraries(undistortImage ${OpenCV_LIBS})
-
依赖包
sudo apt -y install ros-melodic-gazebo-dev
sudo apt -y install ros-melodic-controller-manager
sudo apt -y install ros-melodic-joint-state-controller
sudo apt -y install ros-melodic-rqt-gui
sudo apt -y install ros-melodic-rqt-gui-py -
Could not find a package configuration file provided by "OpenCV" with any of the following names:或者image_viewer_plugin.cpp:(.text+0x1e12):对‘cv::Mat::Mat()’未定义的引用image_viewer_plugin.cpp:(.text+0x1e1a):对‘cv::Mat::Mat()’未定义的引用CMakeFiles/integrated_viewer.dir/node/image_viewer_plugin/draw_rects.cpp
find_package(OpenCV 3.4.16 REQUIRED) include_directories( ${OpenCV_INCLUDE_DIRS} ) target_link_libraries( ${OpenCV_LIBS})
- error: conversion from ‘cv::Mat’ to non-scalar type ‘CvMat’ requested
CvMat cvmat = sum_mat;
找到报错行,修改如下(opencv版本问题)
// CvMat cvmat = sum_mat;
CvMat* cvmat;
for(size_t i=0; i< sum_mat.rows; ++i)
for(size_t j=0; j< sum_mat.cols; ++j)
{
((double)(cvmat->data.ptr + icvmat->step))[j] = sum_mat.at(i,j);
}
看这篇博客https://www.jianshu.com/p/6ef8a6f55aba
error: no match for ‘operator=’ (operand types are ‘CvPoint’ and ‘cv::Point {aka cv::Point_
textOrg = cv::Point(ctx.topLeft.x, ctx.botRight.y + baseline);
cv::Point-->cvPoint
运行记录
2. PluginlibFactory: The plugin for class 'autoware_rviz_debug/DecisionMakerPanel' failed to load. Error: According to the loaded plugin descriptions the class autoware_rviz_debug/DecisionMakerPanel with base class type rviz::Panel does not exist. Declared types are NodeVirtue jsk_rviz_plugin/CancelAction jsk_rviz_plugin/EmptyServiceCallInterfaceAction jsk_rviz_plugin/ObjectFitOperatorAction jsk_rviz_plugin/PublishTopic jsk_rviz_plugin/RecordAction jsk_rviz_plugin/RobotCommandInterfaceAction jsk_rviz_plugin/SelectPointCloudPublishAction jsk_rviz_plugin/TabletControllerPanel jsk_rviz_plugin/YesNoButton rviz_plugin_tutorials/Teleop
source一下工作空间