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;
    }
    
  • 相关阅读:
    SerializationUtility
    ExtendHelper
    AutoTransformHandler
    Parameter Config
    Tools Function
    谈谈对C#中反射的一些理解和认识(上)
    WPF程序中App.Config文件的读与写
    WPF实现Windows资源管理器(附源码)
    安装VC++2015运行库时出现0x80240037错误
    对C#调用C++的dll的一点思考
  • 原文地址:https://www.cnblogs.com/gary-guo/p/7066991.html
Copyright © 2011-2022 走看看