Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9150850
  • 博文数量: 1727
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 19860
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1727)

文章存档

2024年(2)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: 其他平台

2019-12-10 13:33:31

https://blog.csdn.net/xu_fengyu/article/details/86562827

RVIZ 使用的时候如果fixed frame选项设置不正确,那么就会无法显示显示相应的数据信息,并提示一下错误:“For frame [XX]: Fixed Frame [map] does not exist”
官方文档对该选项的解释为:


The Fixed Frame/固定参考系
The more-important of the two frames is the fixed frame. The fixed frame is the reference frame used to denote the “world” frame. This is usually the “map”, or “world”, or something similar, but can also be, for example, your odometry frame.
If the fixed frame is erroneously set to, say, the base of the robot, then all the objects the robot has ever seen will appear in front of the robot, at the position relative to the robot at which they were detected. For correct results, the fixed frame should not be moving relative to the world.
If you change the fixed frame, all data currently being shown is cleared rather than re-transformed.
The Target Frame
The target frame is the reference frame for the camera view. For example, if your target frame is the map, you’ll see the robot driving around the map. If your target frame is the base of the robot, the robot will stay in the same place while everything else moves relative to it.



如果显示不了topic报frame 、transform之类错误,就有两个办法,
1.把global fixed frame设成topic自己所在的坐标系,按照上图的显示,应该改为tramcar;
2.用tf包工具发布global fixed frame到topic所在坐标系的tf关系,例如:


 rosrun tf static_transform_publisher 0.0 0.0 0.0 0.0 0.0 0.0 map xxx 100 ;//将xxx映射为map
1
那么还有一个疑问: topic自己所在的坐标系名字(上图中为tramcar)是在那里设定的?
我们知道topic这一项(即话题的名字,上图中对应的是/cloud)是在程序里面指定的,同理消息的参考坐标系信息记录在消息的frame_id中,该值可以在程序中直接通过给消息头的frame_id字段赋值的方式指定也可以在.cfg配置文件中事先指定。查看一个消息的 fix frame:


   rostopic echo /cloud | grep frame_id
1


The frame_id in a message specifies the point of reference for data contained in that message.
消息的头 std_msgs/Header header中通常会有该信息 。标准头信息主要包括:seq是消息的顺序标识,不需要手动设置,发布节点在发布消息时,会自动累加。stamp 是消息中与数据相关联的时间戳,例如激光数据中,时间戳对应激光数据的采集时间点。frame_id 是消息中与数据相关联的参考系id,例如在在激光数据中,frame_id对应激光数据采集的参考系。


例如LaserScan消息结构:


    std_msgs/Header header    #   标准头信息
    uint32 seq
    time stamp           
    string frame_id        # in frame frame_id, angles are measured around  the positive Z axis (counterclockwise, if Z is up) with zero angle being forward along the x axis                              
    float32 angle_min        # start angle of the scan [rad]
    float32 angle_max        # end angle of the scan [rad]
    float32 angle_increment  # angular distance between measurements [rad]
    float32 time_increment   # time between measurements [seconds] - if your scanner
                             # is moving, this will be used in interpolating position of 3d points
    float32 scan_time        # time between scans [seconds
    float32 range_min        # minimum range value [m]
    float32 range_max        # maximum range value [m]
    float32[] ranges         # range data [m] (Note: values < range_min or > range_max should be discarded)
    float32[] intensities    # intensity data [device-specific units].  If your device does not provide intensities, please leave the array empty.

阅读(6156) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~