LoginSignup
3
3

More than 3 years have passed since last update.

ROSのTFとTF2の対照(Python)

Last updated at Posted at 2020-09-26

はじめに

本記事は、ROS(Robot Operating System)の座標変換ライブラリであるTFおよびその再実装であるTF2の使い方を整理したものです。
(Tensor Flowとは関係ありません。)

ROSのTFとTF2の対照表

tfにおいて、TransformListener経由で行うことのほとんどは、tf2のBufferクラス経由で行う。

やりたいこと tf.TransformListener tf2_ros.Buffer
変換行列の取得 lookupTransform lookupTransform
lookupTransformFull lookupTransformFull
waitForTransform lookupTransformのtimeout引数
waitForTransformFull lookupTransformFullのtimeout引数
メッセージの座標変換 transformPoint transform
transformPose transform

座標変換の計算

tfでは、tf.transformationsモジュールの関数を用いるが、tf2では、PyKDLを用いる。

やりたいこと tf.transformations PyKDL
座標変換 euler_from_quaternion PyKDL.Rotation.Quaternion(x,y,z,w).getEulerZYX()
quaternion_matrix PyKDL.Rotation.Quaternion(x,y,z,w)
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3