Skip to content

Instantly share code, notes, and snippets.

@AtsushiSakai
Created March 23, 2013 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AtsushiSakai/5229819 to your computer and use it in GitHub Desktop.
Save AtsushiSakai/5229819 to your computer and use it in GitHub Desktop.
座標変換ライブラリtfのlistenerサンプルコード
#include "tf/transform_listener.h"
tf::TransformListener tflistener;
//それぞれの座標系におけるレーザの点群のデータ変数
sensor_msgs::PointCloud laserPointsRobot;
sensor_msgs::PointCloud laserPointsGlobal;
//robot座標系におけるレーザ点群の情報の取得
laserPointsRobot=getLaserPoints();
//レーザの点群をrobot座標系からglobal座標系に変換
//変換されたデータはlaserPointsGlobalに格納される.
tflistener.transformPointCloud("robot",laserPointsRobot.header.stamp,laserPointsRobot,"global",laserPointsGlobal);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment