How can i create xyz coordinant from pan-tilt system angles.

25 次查看(过去 30 天)
Hello guys, I have 3 data, First servo angle for pan, second servo angle for tilt and measurement from the laser. If I can able to get xyz points, so I can use it as meshing point to 3D mapping by using software such as CloudCompare or MeshLab.
  2 个评论
Jim Riggs
Jim Riggs 2018-11-2
Hard to understand what you want. Try drawing a picture to illustrate the problem.
Aui
Aui 2018-11-5
编辑:KSSV 2018-11-5
Dear Jim, https://www.youtube.com/watch?v=kJW9Uy4j-6k My project is as same as the project in this video.
I have 2 angle from servos and 1 data from laser meter. For mapping i need to get xyz coordinant from the datas
I hope you understand me now.

请先登录,再进行评论。

采纳的回答

Jim Riggs
Jim Riggs 2018-11-7
It seems that you want to convert from spherical coordinates to Cartesian coordinates. You have pan angle (azimuth) and a tile angle (elevation), and the "1 data from laser meters" I assume that this is the range (or radius) in meters.
Matlab has a function which will perform this conversion called sph2cart:
[x,y,z] = sph2cart(azimuth,elevation,radius);
This function performs the following transformation:
x = radius .* cos(elevation) .* cos(azimuth);
y = radius .* cos(elevation) .* sin(azimuth);
z = radius .* sin(elevation);
  5 个评论
Jim Riggs
Jim Riggs 2018-11-7
编辑:Jim Riggs 2018-11-7
I am not sure what you are asking. If you have pan/tilt/range measurements, you can convert them directly to X/Y/Z coordinates. Just make sure that your pan/tilt angles are in radians when you call the sph2cart function. Or, you can write your own function using the three equations, above, and use the sind and cosd functions to operate in your data in degrees.
function [x, y, z] = my_sph2cart(pan,tilt,range)
x = range .* cosd(tilt) .* cosd(pan);
y = range .* cosd(tilt) .* sind(pan);
z = range .* sind(tilt);
end

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Coordinate Systems 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by