• Mr_matcher的细节3


    主要是订阅了playbag发布的scan话题和odom话题

    其类型分别为

     //cache the static tf from base to laser

    getBaseToLaserTf(scan_msg->header.frame_id);

    bool LaserScanMatcher::getBaseToLaserTf (const std::string& frame_id)
    {
      ros::Time t = ros::Time::now();//广播TF时的时间戳
    
      tf::StampedTransform base_to_laser_tf;
      try
      {
        tf_listener_.waitForTransform(
          base_frame_, frame_id, t, ros::Duration(1.0));
        tf_listener_.lookupTransform (//父(要将数据转换到本坐标系下)到子(将要转换的坐标系)的变换,从而求出子坐标系在父坐标系中的位置和方向,所以为什么说是base_to_laser的转换,这样就可以理解通了。
          base_frame_, frame_id, t, base_to_laser_tf);//在这里要想到相机在世界坐标系当中的移动,要求出相机在世界坐标系中的位置的话,那么旋转矩阵是从世界坐标系到相机坐标系的一个旋转,
      }
      catch (tf::TransformException ex)
      {
        ROS_WARN("Could not get initial transform from base to laser frame, %s", ex.what());
        return false;
      }
      base_to_laser_ = base_to_laser_tf;
      laser_to_base_ = base_to_laser_.inverse();
    
      return true;
    }
    
  • 相关阅读:
    mysql 练习题
    mysql 语法
    mysql数据库简单练习(创建表格,增删改查数据)
    dom对象基础
    JS定时器
    JS小测验
    JS事件练习题
    JS事件
    dom对象
    tiles介绍
  • 原文地址:https://www.cnblogs.com/gary-guo/p/7066991.html
Copyright © 2020-2023  润新知