This commit is contained in:
parent
b7ae1906b3
commit
17ed7458bf
46
buildPRM.m
46
buildPRM.m
|
|
@ -1,46 +0,0 @@
|
|||
function path = buildPRM(L1, L2, x1, y1, x2, y2)
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% function path = buildPRM(L1, L2)
|
||||
% Task: Determine the 3D transformation matrix corresponding to a set of Denavit-Hartenberg parameters
|
||||
%
|
||||
% Inputs:
|
||||
% - L1: first length
|
||||
% - L2: second length
|
||||
% - x1: start point x
|
||||
% - y1: first point y
|
||||
% - x2: end point x
|
||||
% - y2: end point y
|
||||
%
|
||||
% Output:
|
||||
% -path: Vector of points
|
||||
%
|
||||
% author: Marais Lucas
|
||||
% date: 22/11/2023
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
x3 = [-L2 L2 -L2 L2];
|
||||
y3 = [-L2 -L2 L2 L2];
|
||||
x1 = [-L1-L2 L1+L2 -L1-L2 L1+L2];
|
||||
y1 = [-L1-L2 -L1-L2 L1+L2 L1+L2];
|
||||
x2 = [-L1 -L1 L1 L1];
|
||||
y2 = [-L1 L1 -L1 L1];
|
||||
|
||||
|
||||
fill(x1, y1, 'r');
|
||||
|
||||
hold on;
|
||||
|
||||
t = linspace(0, 2*pi, 100)';
|
||||
r=L1+L2;
|
||||
circsx = r.*cos(t) + 0;
|
||||
circsy = r.*sin(t) + 0;
|
||||
fill(circsx, circsy, 'w');
|
||||
|
||||
hold on;
|
||||
fill(x2, y2, 'b');
|
||||
hold on;
|
||||
plot(x4, y4, 'g');
|
||||
hold on;
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
function path = buildRRT(L1, L2, x1, y1, x2, y2)
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% function path = buildPRM(L1, L2)
|
||||
% Task: Determine the 3D transformation matrix corresponding to a set of Denavit-Hartenberg parameters
|
||||
%
|
||||
% Inputs:
|
||||
% - L1: first length
|
||||
% - L2: second length
|
||||
% - x1: start point x
|
||||
% - y1: first point y
|
||||
% - x2: end point x
|
||||
% - y2: end point y
|
||||
%
|
||||
% Output:
|
||||
% -path: Vector of points
|
||||
%
|
||||
% author: Marais Lucas
|
||||
% date: 22/11/2023
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
x3 = [-L2 -L2 L2 L2];
|
||||
y3 = [-L2 L2 L2 -L2];
|
||||
x1 = [-L1-L2 -L1-L2 L1+L2 L1+L2];
|
||||
y1 = [-L1-L2 L1+L2 L1+L2 -L1-L2];
|
||||
x2 = [-L1-L2 -L1-L2 L1+L2 L1+L2];
|
||||
y2 = [-L1 L1 L1 -L1];
|
||||
|
||||
|
||||
fill(x1, y1, 'r');
|
||||
|
||||
hold on;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
t = linspace(0, 2*pi, 100)';
|
||||
r=L1+L2;
|
||||
circsx = r.*cos(t) + 0;
|
||||
circsy = r.*sin(t) + 0;
|
||||
hold on;
|
||||
fill(x2, y2, 'w');
|
||||
hold on;
|
||||
plot(circsx, circsy, 'b');
|
||||
|
||||
hold on;
|
||||
fill(x3, y3, 'b');
|
||||
hold on;
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue