cartographer(2)-launch-lua的配置

1.了解bag

|---|-------------------------------------|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| | | | |
| 1 | roscore | | |
| 2 | rosbag info rslidar-outdoor-gps.bag | 了解bag中topic的名称与类型 | duration: 3:33s types: geometry_msgs?QuaternionStamped nav_msgs_Odometry sensor_msgs/Imu sensor_msgs/IaserScan sensor_msgs/NavSatFix sensor_msgs/PointCloud2 tf2 msgs/TFMessage topics:/fix:gps的 /front_scan: 单线雷达数据 /heading: 两个GPS执行出来的航向 /imu: IMU的topic /odom_scout:里程计 /rslidar_points: 速腾的16点云数据 /tf: /tf_static: 静态的tf数据 |
| 3 | rosbag play rslidar-outdoor-gps.bag | 运行bag中topic的名称与类型 | 空格用于启动和停止 |
| 4 | rqt | 了解bag中的tf树. 1.plugins ->visualization->tf tree 2.plugins ->Introspection->node graph 看节点树 发布了很多topic数据 | |
| 5 | rviz | 可视化雷达数据与tf数据 rviz左侧最顶上的Fixed frame,手动输入 rviz左侧下方可添加显示的插件,选择添加pointcloud2,laserscan | |

2.配置launch文件

目录:~/carto_ws/cartographer_detailed_comments_ws/src/cartographer_ros/cartographer_ros/launch

2.1 bag文件的地址和bag文件的名字

cp lx_rs16_2d_outdoor_l.launch mytest.launch

修改 mytest.launch

复制代码
#1.修改default值

#1.<!--bag的地址与名称 -->
<arg name="bag_filename" default="$(env HOME)/bagfiles/rslidar-outdoor-gps.bag"


#2. 修改.lua文件

# $(find cartographer_ros)/configuration_files ~/carto_ws/cartographer_detailed_comments_ws/src/cartographer_ros/cartographer_ros/configuration_files
#<!--启动cartographer -->  修改lua文件
-configuration_directory $(find cartographer_ros)/configuration_files
-configuration_basename mytest.lua "


#3.修改点云 points2 单线雷达数据:scan  里程计odom
配置文件中的 与bag中的要一致

<remap from="scan" to="front_scan"/>  #front_scan
<remap from="odom" to="odom_scout"/>  #front_scan
<remap from="imu" to="imu"/>  #front_scan

2.2 lua文件的名字

2.3 topic需要remap成bag文件中发布的topic

3.配置Lua文件

cd:~/carto_ws/cartographer_detailed_comments_ws/src/cartographer_ros/cartographer_ros/configuration_files/

cp backpack_2d.lua mytest.lua

|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|
| | | |
| | tracking_frame: imu link base_link | imu_link |
| | published_frame cartographer: tf:最下边的一个坐标系 bag,tf树最上面一个坐标系 | odom |
| | provide_odom_frame:是否提供里程计 bag中有,此处为false | false |
| | use_pose_extrapolator :一定是false | false |
| | use_odometry:是否使用里程计的传感器数据,如果为true,tf树中存odom这个坐标系 | false |
| | use_nav_sat:是否使用GPS数据,true时会订阅gps的topic | false |
| | use_landmarks: | false |
| | num_laser_scans=1 #单线云 num_multi_echo_laser_scans=0 #多回声雷达 num_subdivisions_per_laser_scan=1 num_point_clouds=1 #多线点云 num_point_clouds 多线点云的话题的数量,可以同时为1,不可以同时为0 订阅话题的个数 {}内参数是有,的 外参数没有, | |
| | MAP_BUILDER.use_trajectory_builder_2d=true TRAJECTORY_BUILDER_2D.use_imu_data=true 是否使用imu, tracking_frame一定要设置成imu的link | |
| | TRAJECTORY_BUILDER_2D.min_z=-0.1 点云的最小z的范围,单线点云不能设置大于0的值(不设置),多线点云的这个值要大于0 | |

1.重新编译

cd ~/carto_ws/cartographer_detailed_comments_ws/

./catkin_make.sh

2.重新启动

roslaunch cartographer_ros mytest.launch

相关推荐
金銀銅鐵1 天前
浅解 JUnit 4 第十二篇:如何生成 @Before 注解的替代品?(上)
junit·单元测试
Apifox2 天前
【测试套件】当用户说“我只想跑 P0 用例”时,我们到底在说什么
单元测试·测试·ab测试
金銀銅鐵5 天前
浅解 JUnit 4 第十一篇:@Before 注解和 @After 注解如何发挥作用?
junit·单元测试
金銀銅鐵6 天前
浅解 JUnit 4 第十篇:方法上的 @Ignore 注解
junit·单元测试
阿狸猿8 天前
单元测试中静态测试、动态测试及白盒测试、回归测试实践
单元测试·软考
Max_uuc8 天前
【工程心法】从“在板盲调”到“云端验证”:嵌入式单元测试与 TDD 的工程化革命
单元测试·tdd
feathered-feathered9 天前
测试实战【用例设计】自己写的项目+功能测试(1)
java·服务器·后端·功能测试·jmeter·单元测试·压力测试
测试渣9 天前
持续集成中的自动化测试框架优化实战指南
python·ci/cd·单元测试·自动化·pytest
minh_coo9 天前
Spring单元测试之反射利器:ReflectionTestUtils
java·后端·spring·单元测试·intellij-idea