0
点赞
收藏
分享

微信扫一扫

yaml参数文件的使用

狐沐说 2022-01-25 阅读 45
自动驾驶

params.yaml文件中的内容如下,注意这里的hilbert_h:

hilbert_h:
  pointCloudTopic: "/velodyne_points"            # Point cloud data
  imuTopic: "/imu/data"                          # IMU data
  odomTopic: "odometry/imu"                      # IMU pre-preintegration odometry, same frequency as IMU
  gpsTopic: "odometry/gps"                       # GPS odometry topic from navsat, see module_navsat.launch file

使用时,在launch中加载该参数文件:

<rosparam file="$(find xxx)/config/params.yaml" command="load" />

加载后,即可在程序中使用参数,注意,此处的 hilbert_h/ 与上面的 hilbert_h: 相对应

nh.param<std::string>("hilbert_h/pointCloudTopic", pointCloudTopic, "points_raw");
nh.param<std::string>("hilbert_h/imuTopic", imuTopic, "imu_correct");
nh.param<std::string>("hilbert_h/odomTopic", odomTopic, "odometry/imu");
nh.param<std::string>("hilbert_h/gpsTopic", gpsTopic, "odometry/gps");
举报

相关推荐

0 条评论