#307·slambook

/ch3/examples/coordinateTransform.cpp 关于书中 3.6.2 章节的代码示例

作者: xingzai1创建于 2025年11月8日更新于 2025年11月8日

The coordinate system of the carrots is R1 and R2. Carrot 1's position is q1=[0.35,0.2,0.3,0.1]T, t1=[0.3,0.1,0.1]T. Carrot 2's position is q2=[-0.5,0.4,-0.1,0.2]T, t2=[-0.1,0.5,0.3]T. That is, the transformation relationship from the world coordinate system to the camera coordinate system. Now, Carrot 1 sees a point whose coordinates in its own coordinate system are pR1=[0.5,0,0.2], and we need to calculate the coordinates of this vector in Carrot 2's coordinate system. In the code, the author uses T1w.inverse()*p1 to transform p1 to the world coordinate system, but I understand that the transformation of p1 to the world coordinate system should be T1w*p1, and I also verified my understanding by modifying the code. Assuming that Carrot 1 and Carrot 2 have no changes in their positions in the world coordinate system, that is, q1=[1,0,0,0]T, q2=[1,0,0,0]T, and they only have changes in their positions. Then, the value obtained by transforming the previous point p1 using the new T1w*p1 is [0.8,0.1,0.3]T, which is a correct position in the world coordinate system according to my understanding. If the p1 value obtained by T1w.inverse()*p1 provided in the book is [0.2,-0.1,0.1]T, it is not a correct answer.

内容来源: gaoxiang12/slambook