eigen座標變換 座標變換

2021-10-19 15:47:26 字數 2191 閱讀 4616

位姿變換(位姿在不同座標系中變換, 更常用): posest or t,

關鍵在於同乙個位姿(實際位姿固定不變),但是在不同座標系有不同的 表 示!

座標系變換(座標系本身變換), 並且 coordst: coordst = t.inverse().

注意: ros tf 發布的變換是座標系變換 coordst, 包括通過

tf2_ros static_transform_publisher, transformbroadcaster.sendtransform()等

發布. 但是獲取到的變換卻是位姿變換 posest, 例如 transformer.lookuptransform() !!

計算位姿變換 t

某個位姿在 a 座標系中為: pa, e.g. (0, 0, 0) * ri,

該位姿在 b 座標系中表示為 pb, e.g. (-1, 0, 0) * rb,

那麼 a 到 b 的位姿變換 ta2b = pb * pa.inverse(), e.g. (-1, 0, 0) * rt!!

即 a 原點位姿在 b 中的位姿值, 就是 a 到 b 的位姿變換!!

計算 coordst

注意: 以同乙個公共座標系計算的是 coordst, e.g. 都在 a 座標系中,

a 的原點為 p1, b 的原點為 p2, 那麼 coordst = p2 * p1.inverse(), and

ta2b = coordst.inverse()!

又或者都在 world 座標系中, a 的原點為 pw1 , b 的原點為 pw2, 那麼 coordst =

pw2 * pw1.inverse(), and ta2b = coordst.inverse()!

see also geometry: maketransform:

* make a transform: from @a from pose to @a to pose.

* if t is posest, then @a from usually should be (0, 0, 0) * ri,

* then @a to should be same real pose with @a from, but value is its value

* in coordinate of @a to.

* if t is coordst, then @a from pose and @a to pose should be values in the

* same coordinate, e.g. world or coordinate of @a from or coordinate of @a

* to or some other.

* and note: coordst = t.inverse()!!

* @param from from pose to build transform.

* @param to to pose to build transform.

* @return the @a from to @a to transform (from --transform--> to).

static inline eigen::affine3d maketransform(

eigen::affine3d const& from, eigen::affine3d const& to) noexcept

return to * from.inverse();

通過位姿變換 t 計算位姿

已知某個位姿在座標系 a 中為: pa, a 中位姿到 b 中位姿變換為 ta2b, 那麼,

pa 在座標系 b 中位姿 pb = ta2b * pa.

已知某個位姿在座標系 a 中為: pa, b 中位姿到 a 中位姿變換為 tb2a, 那麼,

pa 在座標系 b 中位姿 pb = tb2a.inverse() * pa

(ta2b = tb2a.inverse()).

座標變換矩陣

r00 r01 r02 tx

r10 r11 r12 ty

r20 r21 r22 tz

0 0 0 1

仿射表示位姿或者變換:

affine3d = translation3d(x, y, z) * quaterniond(w, x, y, z)

affine2d = translation2d(x, y) * rotation2d(angle))

座標系變換與座標變換理解

在slam中經常用到空間點的座標變換。假設已獲得相機某一位置的位姿pose,pose包括相機座標系相對於世界座標系的旋轉r和平移t,此時若已知某點p在相機座標系下的座標為pc,計算點p在世界座標系下的座標pw,可使用 pw r pc t t pc 開始的時候我有這樣的疑問 t表示世界座標到相機座標系...

基變換與座標變換

近來正在看 3d math primer for graphics and game development 3d數學基礎 圖形與遊戲開發 清華大學出版社,當看到第八章 矩陣與線性變換時,不禁產生疑問 當繞x軸旋轉時,求出旋轉後的基向量矩陣rx 1 0 0 rx p q r 0 cos sin 0 ...

openGL座標變換

座標變換 opengl的每一種變換都是乙個矩陣的運算。假設當前某頂點座標為c,現在要做某種變換 設矩陣為m 得到新的座標c1,那麼運算過程就是c1 t c。opengl應用 左乘規則 座標的變換就是用變換矩陣乘以座標向量 opengl變換在程式設計的時候順序是反過來的。想對目標 glutwiresp...