3d Helix trajectory generation in robotics toolbox
조회 수: 3 (최근 30일)
이전 댓글 표시
I would like to modify the following proram from here to generate a helix trajectory instead of a circular one. Here is the part that should be modified:
t = (0:0.2:10)'; % Time
count = length(t);
center = [0.3 0.1 0];
radius = 0.15;
theta = t*(2*pi/t(end));
points =center + radius*[cos(theta) sin(theta) zeros(size(theta))];
It's supposed to be like that.
I tried substituting zeros(size(theta)) by a vector of the same size using linspace but it still gives me a circle.
Thanks in advance.
댓글 수: 0
채택된 답변
Shadaab Siddiqie
2021년 4월 27일
From my understanding you want to create a 3d helix path. Here is the code which might help you.
r=100;
theta=0:pi/50:10*pi;
%Trajectory in x-direction
x=-r.*cos(theta);
%Trajectory in y-direction
y=r.*sin(theta);
%Trajectory in z-direction
z=theta;
plot3(x,y,z);
For more advanced 3d shapes refer 3d-curves.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Robotics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!