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
2018-11-2
Hard to understand what you want. Try drawing a picture to illustrate the problem.
采纳的回答
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
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 Center 和 File Exchange 中查找有关 Coordinate Systems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!