%--------------------------------------------------------------------------
% Script:       SimParam.m
% Purpose:      Define simulation parameters: one-leg with 3dof-3D
%--------------------------------------------------------------------------
 go=9.8;                        % Gravity vector 
%-- Mechanical links ------------------------------------------------------
 l0=0.05;	 r0=l0/2; m0=0.28;  % Foot/ankle link's length and mass
 l1=0.14;	 r1=l1/2; m1=0.20;  % Ankle/knee link's length and mass 
 l2=0.145;	 r2=l2/2; m2=0.63;	% Knee/hip link's length & mass
 
 global L R M
 L=[l0 l1 l2];   R=[r0,r1,r2];  M=[m0 m1 m2];   % To be seen by the servos! 
%-- Joint vector: zero position ------------------------------------------- 
 global qi dqi CTRL_mode Ts NUM_samples JointSpeed % To be seen by the servomotors!!!
 Ts = 5e-3;  % Servo clock rate ------------------------------------------
  qi = [0 pi/4 -pi/4]';
 dqi = [0 0 0]';
%-----------------------------------------------------------------endscript
%//////////////////////////////////////////////////////////////////////////
% SIMULATION
%//////////////////////////////////////////////////////////////////////////
% Graphical representation of the single-leg at the initial configuration
%--------------------------------------------------------------------------
 P = DirKin3dof_sim(qi,L);
 C = JointCoordinates( qi,L );
 COG = RobCOG( qi,L,R,M );
 CreateWorldBodies( P,C,[P(10) P(11) P(12)]',COG )
%////////////////////////////////////////////////////////////end_SIMULATION
