This commit is contained in:
Lucas MARAIS 2023-11-30 17:25:01 +01:00
parent b7ae1906b3
commit 17ed7458bf
2 changed files with 54 additions and 46 deletions

View File

@ -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;

54
buildRRT.m Normal file
View File

@ -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;