LookUpTransform and Transformation matrix
I want to create a transformation matrix from the information I get from (trans, rot) =tf.TransformListener().lookupTransform('from_frame', 'to_frame', rospy.Time(0))
. So that I can just have a matrix I can multply with a co-ordinate from one frame to another. I have been looking at how to make a homogenous transformatio matrix [[R,d][0,1]]
where I use both the quaternion info(rot) and translation info(d) to make the matrix.Does any one know the right formula to make the 3x3 rotation part of the matrix? I was looking at this. But other sources give completely different formuli, I am also confused about the right arrangement of rot
data, which element is w
, is it rot[0] or rot[3].
As follow up, after I have made the correct 4x4 matrix. How do I set up what co-ordinate I wish to transform?I have the (x,y and z) but I need another element to make it 4 so that its possible to multiply it by the 4x4 transformation matrix.I dont know what the 4th element should be really, I'm assuming it has something to do with translation though.
Asked by distro on 2022-08-10 14:46:33 UTC
Comments
Given a transformation, are you looking for a way to transform your point? If so, please check out the following URL: https://gist.github.com/ravijo/cb560eeb1b514a13dc899aef5e6300c0
Asked by ravijoshi on 2022-08-10 22:55:34 UTC