Given are two sets of gyro data received from two IMUs.
One IMU is mounted on a car. X-Direction is in driving direction. Z is upwards to the sky.
The second IMU is mounted to the steering wheel. The Wheel rotates around the Z-axis. When the steering angle is 0° the XZ-plane is parallel with the driving direction. The steering wheel is tilted 65° ( around the y-axis).
When the steering wheel is e.g. turned 45° the car is driving in a curve. Therefore the IMU mounted on the wheel measures not only the 45° but also a fraction of the turning car-rotation. This results in a small error.
I want to transform the car gyro data into the frame of the steering wheel mounted IMU. After that those two could be subtracted leaving pure steering wheel rotation.
How can such a transformation be achieved?
I've tried this with Matlab and the robotic toolbox from Peter Corke
% Integrating gyro data
eulSteering = cumtrapz(steering_imu_gyro)*sampleRate;
eulCar = cumtrapz(carframe_imu_gyro)*sampleRate;
% correction
tilt = roty(-65*pi/180); % 65° rotation
for i = 2 : length(s2.gyr)
rot = rotz(-angle(i-1));
carIMU = rpy2r(eulCar(i-1,:)*pi/180);
rotatedCarIMU = rot*(tilt*carIMU);
angle(i,:) = (eulSteering(i-1,:)*pi/180-tr2rpy(rotatedCarIMU));
end
Wasn't totally wrong, but didn't improved the result either (I know the actual steering angle due to the cars CAN BUS).