zoukankan      html  css  js  c++  java
  • 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;
    }
    
  • 相关阅读:
    3164 质因数分解
    codevs3249搭积木
    codevs 2964公共素数因数
    爱改名的小融1
    单链表基础练习
    并查集(union-find sets)
    string类中字符的大小写转换
    蒜头君学英语--set()练习
    打印锯齿矩阵
    堆积木
  • 原文地址:https://www.cnblogs.com/gary-guo/p/7066991.html
Copyright © 2011-2022 走看看