天天看點

cartotgrapher錯誤終結者 lookupTransform argument source_frame in tf2 frame_ids cannot be empty

問題描述

小編在運作自己編寫的odom跑cartographer時候出現下列錯誤:

$ roslaunch cartographer_ros xxx.launch bag_filename:=xxx.bag
           

[ WARN] [1623375390.352953001, 1623136574.864343084]: W0610 18:36:30.000000 63556 tf_bridge.cc:52] Invalid argument passed to lookupTransform argument source_frame in tf2 frame_ids cannot be empty Warning: Invalid argument passed to canTransform argument source_frame in tf2 frame_ids cannot be empty

原因分析

通過檢視話題消息

$ rostopic echo /odom/data 
           

發現

frame_id: ''

child_frame_id: ''

均為空

于是設定如下的值

nav_msgs::Odometry odom_msg;
odom_msg.header.frame_id = "odom"; // 對應odom_frame 的值
odom_msg.child_frame_id="base_link";
           

與之對應的lua配置如下

map_frame = "map",
  tracking_frame = "base_link",--base_footprint base_link
  published_frame = "base_link",
  odom_frame = "odom",--odom
  provide_odom_frame = true,--true
  publish_frame_projected_to_2d = false,
  use_pose_extrapolator = true,--true
  use_odometry = true,--false
           

重新釋出odom話題後,順利運作。

繼續閱讀