Wednesday, March 9, 2011

Exercise 3, Problem 8

The function was used in the following program:


T = 5;                                            % interval of time
ts = 0.01
pose = [0 0 0];                              % initial position

robotpar = [0.26 0.035 0.035];
wheelspeed = [5.714 5.714]
size = round(T/ts);                       % size of the array
array = zeros(size,3);                   % initializing the array
hold on;
for i=1:size
     array(i,:) = kinupdate(pose,robotpar,ts,wheelspeed); 
     a=[array(i,1) array(i,1)+0.5*cos(array(i,3))];
     b=[array(i,2) array(i,2)+0.5*sin(array(i,3))];
     line(a,b)
     pose = array(i,:);
end
array
xlabel('x [m]');
ylabel('y [m]');
plot(array(:,1),array(:,2),'Color','red','LineWidth',3);


The above program used the values from the first test. Both tests were performed and, in order to have a better understanding of the results, we implemented a graphical interpretation . The red line represents the trajectory of the robot and the blue line represents the orientation.


Test 1: The robot moves on a straight line on the OX axis.

 Test 2: Since the robot moves along its centre point, only its orientation changes and thus only the blue line can be seen.

No comments:

Post a Comment