meta data for this page
差分
このページの2つのバージョン間の差分を表示します。
lab:ros:calculate-posture-by-tf2 [2020/06/02 20:43] strv 作成 |
lab:ros:calculate-posture-by-tf2 [2020/06/02 20:45] (現在) strv |
||
---|---|---|---|
行 64: | 行 64: | ||
### メッセージからtfに変換 | ### メッセージからtfに変換 | ||
- | ```c++ | + | ```c |
#include < | #include < | ||
#include < | #include < | ||
行 77: | 行 77: | ||
なんでかこれはconvertがうまくできない.ヒントを渡してもダメ.教えて偉い人. | なんでかこれはconvertがうまくできない.ヒントを渡してもダメ.教えて偉い人. | ||
- | ```c++ | + | ```c |
#include < | #include < | ||
#include < | #include < | ||
行 92: | 行 92: | ||
たとえば,タイムスタンプありのtransformは次のように定義できます. | たとえば,タイムスタンプありのtransformは次のように定義できます. | ||
- | ```c++ | + | ```c |
tf2:: | tf2:: | ||
``` | ``` | ||
行 98: | 行 98: | ||
これを使うと,次のような変換もできます. | これを使うと,次のような変換もできます. | ||
- | ```c++ | + | ```c |
geometry_msgs:: | geometry_msgs:: | ||
msg.child_frame_id = child_frame_id; | msg.child_frame_id = child_frame_id; | ||
行 114: | 行 114: | ||
例えば,2つのtfの姿勢の差をとりたいときはこんな感じです. | 例えば,2つのtfの姿勢の差をとりたいときはこんな感じです. | ||
- | ```c++ | + | ```c |
tf2:: | tf2:: | ||
tf_delta = tf2.inverse() * tf1; | tf_delta = tf2.inverse() * tf1; | ||
行 127: | 行 127: | ||
2つのquaternionを補間する例は次のようにかけます. | 2つのquaternionを補間する例は次のようにかけます. | ||
- | ```c++ | + | ```c |
double d = 0.1; | double d = 0.1; | ||
tf2:: | tf2:: |