function [t,w_R,w_L] = WheelMotionGenerator(Ts,Texe,ANG_vel,MotionType)
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
% 
switch MotionType,
    
%     case 0, % Left-rotation about itself 
%             t = 0:Ts:Texe; % 1.65(s)!
%             DIM = length(t);
%             w_R = ANG_vel*ones(1,DIM);
%             w_L = -ANG_vel*ones(1,DIM);
%     case 1, % Right-rotation about itself
%             t = 0:Ts:Texe; % 0.82(s)!
%             DIM = length(t);
%             w_R = -ANG_vel*ones(1,DIM);
%             w_L = ANG_vel*ones(1,DIM);            
%     case 2, % Forward oscillatory motion        
%             t = 0:Ts:Texe; % 6.05(s)
%             DIM = length(t);
%             % Rotational motion
%             [pos1,vel,ace] = PolyTrajGenerator(0:Ts:0.175-Ts,20,-20,3);
%             [pos2,vel,ace] = PolyTrajGenerator(0:Ts:0.175,-20,20,3);
%             w_rot = [pos1 pos2];
%             % Angular velocity of the right wheel
%             I11 = find(abs(t-0.20)<1e-6); I12 = find(abs(t-0.55)<1e-6); 
%             I21 = find(abs(t-0.75)<1e-6); I22 = find(abs(t-1.10)<1e-6); 
%             I31 = find(abs(t-1.20)<1e-6); I32 = find(abs(t-1.65)<1e-6); 
%             I41 = find(abs(t-1.85)<1e-6); I42 = find(abs(t-2.20)<1e-6); 
%             I51 = find(abs(t-2.40)<1e-6); I52 = find(abs(t-2.75)<1e-6); 
%             I61 = find(abs(t-2.95)<1e-6); I62 = find(abs(t-3.20)<1e-6); 
%             I71 = find(abs(t-3.50)<1e-6); I72 = find(abs(t-3.85)<1e-6); 
%             I81 = find(abs(t-4.05)<1e-6); I82 = find(abs(t-4.40)<1e-6); 
%             I91 = find(abs(t-4.60)<1e-6); I92 = find(abs(t-4.95)<1e-6); 
%             I101 = find(abs(t-5.15)<1e-6); I102 = find(abs(t-5.50)<1e-6); 
%             I111 = find(abs(t-5.70)<1e-6); I112 = find(abs(t-6.05)<1e-6); 
%             w_R = [ 20*ones(1,I11-1)   20*ones(1,I12-I11) ...
%                     20*ones(1,I21-I12) w_rot(1:end-1) ...
%                     20*ones(1,I31-I22) 20*ones(1,I32-I31) ...
%                     20*ones(1,I41-I32) w_rot(1:end-1) ...
%                     20*ones(1,I51-I42) 20*ones(1,I52-I51)...
%                     20*ones(1,I61-I52) w_rot(1:end-1) ...
%                     20*ones(1,I71-I62) 20*ones(1,I72-I71) ...
%                     20*ones(1,I81-I72) w_rot(1:end-1) ...
%                     20*ones(1,I91-I82) 20*ones(1,I92-I91) ...
%                     20*ones(1,I101-I92) w_rot(1:end-1) ...
%                     20*ones(1,I111-I102) 20*ones(1,I112-I111) ];
%             w_L = [ 20*ones(1,I11-1) w_rot(1:end-1)   ...
%                     20*ones(1,I21-I12) 20*ones(1,I22-I21) ...
%                     20*ones(1,I31-I22) w_rot(1:end-1)   ...
%                     20*ones(1,I41-I32) 20*ones(1,I42-I41) ...
%                     20*ones(1,I51-I42) w_rot(1:end-1) ...
%                     20*ones(1,I61-I52) 20*ones(1,I62-I61) ...
%                     20*ones(1,I71-I62) w_rot(1:end-1)   ...
%                     20*ones(1,I81-I72) 20*ones(1,I82-I81) ...
%                     20*ones(1,I91-I82) w_rot(1:end-1) ...
%                     20*ones(1,I101-I92) 20*ones(1,I102-I101) ...
%                     20*ones(1,I111-I102) w_rot(1:end) ];
                
    case 1, % Forward motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = ANG_vel*ones(1,DIM);
            w_L = ANG_vel*ones(1,DIM);
    
    case 2, % Forward-Right 1 motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = ANG_vel*ones(1,DIM);
            w_L = 1.25*ANG_vel*ones(1,DIM);
    case 3, % Forward-Right 2 motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = ANG_vel*ones(1,DIM);
            w_L = 2*ANG_vel*ones(1,DIM);   
    case 4, % Forward-Right 3 motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = ANG_vel*ones(1,DIM);
            w_L = 3*ANG_vel*ones(1,DIM);
    case 5, % Forward-Right 4 motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = ANG_vel*ones(1,DIM);
            w_L = 4*ANG_vel*ones(1,DIM);           
    case 6, % Forward-Left 1 motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = 1.25*ANG_vel*ones(1,DIM);
            w_L = ANG_vel*ones(1,DIM);   
    case 7, % Forward-Left 2 motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = 2*ANG_vel*ones(1,DIM);
            w_L = ANG_vel*ones(1,DIM);  
    case 8, % Forward-Left 3 motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = 3*ANG_vel*ones(1,DIM);
            w_L = ANG_vel*ones(1,DIM);
    case 9, % Forward-Left 4 motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = 4*ANG_vel*ones(1,DIM);
            w_L = ANG_vel*ones(1,DIM); 
    case 10, % Forward-Left 4 motion        
            t = 0:Ts:Texe; % 6.05(s)
            DIM = length(t);
            % Rotational motion
            w_R = -ANG_vel*ones(1,DIM);
            w_L = -ANG_vel*ones(1,DIM);         
            % Time courses
            %figure, plot(t,w_R,'r', t,w_L,'b')
            %xlabel('Time (s)'), ylabel('Angular velocities (rad/s)')
            %legend('w_R','w_L')
   case 11, % Left-rotation about itself 
            t = 0:Ts:Texe; % 1.65(s)!
            DIM = length(t);
            w_R = ANG_vel*ones(1,DIM);
            w_L = -ANG_vel*ones(1,DIM);         
%--------------------------------------------------------------------------            
end
end

