- 添加urdf配置文件:
添加IMU配置关节点和laser关节点
<!-- imu livox -->
<joint name="livox_frame_joint" type="fixed">
<parent link="base_link" />
<child link="livox_frame" />
<origin xyz="0 0 0" rpy="3.1416 0 0" />
</joint>
- 配置文件cartographer_ros/configuration_files/backpack_3d.lua
使用base_link
map_frame = "map", --map
tracking_frame = "base_link", --base_link imu_link rslidar
published_frame = "base_link", --base_link rslidar
- 配置cartographer_ros/launch/backpack_3d.launch....貌似这个建图的时候配置的,定位没用着!
转换topic:使用mid360的topic!
<remap from="points2" to="/livox/lidar />
<remap from="imu" to="/livox/imu" /> <!-- -->
4.配置 cartographer_ros/configuration_files/backpack_3d_localization.lua
把纯定位给去掉,不知道为什么,应该是pure_localization参数多了一个
include "backpack_3d.lua"
--TRAJECTORY_BUILDER.pure_localization = true
POSE_GRAPH.optimize_every_n_nodes = 100
return options
5.修改 cartographer_ros/launch/3d_local_wish.launch文件,就是3d_localization.launch文件,其它不做任何修改
<remap from="points2" to="/livox/lidar />
<remap from="imu" to="/livox/imu" /> <!-- -->
6.测试launch启动:使用提前建好的图
roslaunch cartographer_ros 3d_local_wish.launch load_map:=/home/wishchin/map3d/innercross.pbstream
结果:mid360的数据就是比较恍眼,定位成功