close all; clear; clc;
global debugLevel_01; debugLevel_01 = 0;
global L1; L1 = 110.0;
global L2; L2 = 140.0;
global SUM_L1_L2; SUM_L1_L2 = L1 + L2;
initalizeArmCoordinates;
printArmCoordinates;
hf = figure('color','white');
axis equal
maximum_x_limit = ceil(SUM_L1_L2/100)*100;
maximum_y_limit = ceil(SUM_L1_L2/100)*100;
minimum_x_limit = - ceil(SUM_L1_L2/100)*100;
minimum_y_limit = - ceil(SUM_L1_L2/100)*100;
bk_image = imread('background_c.bmp');
bk_image = flipdim(bk_image,1);
imagesc([minimum_x_limit, maximum_x_limit], [minimum_y_limit, maximum_y_limit], bk_image);
clear bk_image
set(gca,'ydir','normal');
xlim([minimum_x_limit maximum_x_limit]);
ylim([minimum_y_limit maximum_y_limit]);
grid on
set(gca, 'GridLineStyle', '-');
title('Experiment: on setting a background image in an animation');
hold on
ht(1) = plot(lx(1:2), ly(1:2), 'color', [.4 .4 .8],'LineWidth',3);
ht(2) = plot(lx(2:3), ly(2:3), 'color', [.8 .4 .8],'LineWidth',3);
ht(3) = plot(lx(1),ly(1),'--mo', 'MarkerEdgeColor','k', 'MarkerFaceColor',[.49 1 .63], 'MarkerSize',6);
ht(4) = plot(lx(2),ly(2),'--mo', 'MarkerEdgeColor','k', 'MarkerFaceColor',[.99 1 .63], 'MarkerSize',6);
ht(5) = plot(lx(3),ly(3),'--mo', 'MarkerEdgeColor','k', 'MarkerFaceColor',[.49 0 .63], 'MarkerSize',6);
set(gca,'DataAspectRatio',[1 1 1]);
drawnow;
initalizeArmCoordinates_rest_horiz
for alpha = 1:19
for beta = 1:19
set(ht(1),'XData',lx(1:2)); set(ht(1),'YData',ly(1:2));
set(ht(2),'XData',lx(2:3)); set(ht(2),'YData',ly(2:3));
set(ht(3),'XData',lx(1)); set(ht(3),'YData',ly(1));
set(ht(4),'XData',lx(2)); set(ht(4),'YData',ly(2));
set(ht(5),'XData',lx(3)); set(ht(5),'YData',ly(3));
[ successFlag, lx, ly ] = rotate_motor_logically( 2, -10, lx, ly, debugLevel_01);
drawnow;
pause (0.01);
end
initalizeArmCoordinates_rest_horiz;
[ successFlag, lx, ly ] = rotate_motor_logically( 1, -alpha*10, lx, ly, debugLevel_01);
end
saveas(gcf,'output.jpg')
lx[1] = 0.00 lx[2] = 110.00 lx[3] = 110.00
ly[1] = 0.00 ly[2] = 0.00 ly[3] = 140.00