Find Yaw and Pitch of center point of a line segment with respect to static frame
15 次查看(过去 30 天)
显示 更早的评论
Assuming I have 2 points in 3D space A (x1,y1,z1) and B(x2, y2, z2) with respect to the same reference frame.
3D reference frame is a right handed coordinate frame with +Z-axis up, +X-axis front and +Y-axis left
Q1: I need to calculate the position and orientation (roll, pitch, yaw) of the center point between these two points in 6DoF with respect to the origin frme. Aka the orientation of the center point of the line connecting this two points wrt to the origin frame.
To get the position coordinates of centroid point wrt to origin C: C ( (x1+x2)/2 , (y1+y2)/2 ,(z1+z2)/2).
To calculate yaw:
project both points on to the XY plane. then calculate the angle between the projection segment and the Y-axis.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1239482/image.jpeg)
Q2: Do both points need to be coplanar on the Z axis?
TO CALCULATE THE PITCH.
Q2: I try to calculate it by projecting the points into the ZX axis and calculating the angle between the segment connecting the projected points and the X axis. Is this approach correct?
If you have any suggestions or can correct me if my thinking is wrong here please. thank you for your help.
1 个评论
Paul
2022-12-22
Hi VR,
The axes in the figure do not form a right-handed coordinate frame. It looks like the x- and y-axes are reversed relative to the description in the question.
采纳的回答
William Rose
2022-12-22
@VR,
It is not possible to "calculate the position and orientation (roll, pitch, yaw) of the center point". A point does not have a roll, pitch, and yaw. A line segment (such as the segment from A to B) also does not have a roll pitch , and yaw. To get roll, pitch, and yaw, you need at least 3 non-colinear points, and you need a rule which defines a coordinate system in terms of those three points. Your point C will not suffice, since it is on the same line as A and B.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!