Advertisement
Guest User

Untitled

a guest
Oct 5th, 2011
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.93 KB | None | 0 0
  1. % Run analysis on data
  2.  
  3.  
  4. clear;clc;close all;
  5. load('drivehome_data.mat');
  6. data_coefficients;
  7.  
  8. time_calib = time+.2/60;
  9. x_accel_calib = x_accel + 1.3;
  10. y_accel_calib = y_accel - 1.3;
  11. z_accel_calib = z_accel + .65;
  12.  
  13. x_jerk = diff(x_accel_calib);
  14. y_jerk = diff(y_accel_calib);
  15. z_jerk = diff(z_accel_calib);
  16. y_jerk(359)=y_jerk(358);
  17.  
  18. phi=0;
  19. phi_rad = deg2rad(phi);
  20. for (i=1:1:3)
  21.     ra(i) = .5*(atl(i) - dtl(i));
  22.     rj(i) = jtl(i);
  23.     ca(i) = (atl(i)-ra(i));
  24.     cj(i) = (jtl(i)-rj(i));
  25.     for (theta=0:1:360)
  26.         theta_rad = deg2rad(theta);
  27.         a(i, theta+1) = ra(i)*cos(phi_rad)*cos(theta_rad)-rj(i)*sin(phi_rad)*sin(theta_rad)+ca(i);
  28.         j(i, theta+1) = rj(i)*cos(phi_rad)*sin(theta_rad)+ra(i)*sin(phi_rad)*cos(theta_rad)+cj(i);
  29.     end
  30. end
  31.  
  32. hold on
  33. plot(a(1,:),j(1,:))
  34. plot(a(2,:),j(2,:))
  35. plot(a(3,:),j(3,:))
  36. plot(y_accel_calib/9.81, y_jerk, '*');
  37. xlabel('y accceleration (g)');
  38. ylabel('y jerk (m/s^3)');
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement