filepath = fullfile('C:\Users\dell\Desktop\rosbag\imu.bag');
bag = rosbag(filepath)
bagselect_imu = select(bag, 'Topic', '/imu_data')
msgs_imu = readMessages(bagselect_imu);
ts_imu_X = timeseries(bagselect_imu, 'Orientation.X')
ts_imu_Y = timeseries(bagselect_imu, 'Orientation.Y')
ts_imu_Z = timeseries(bagselect_imu, 'Orientation.Z')
ts_imu_W = timeseries(bagselect_imu, 'Orientation.W')
imu_orientation_x = ts_imu_X.data
imu_orientation_y = ts_imu_Y.data
imu_orientation_z = ts_imu_Z.data
imu_orientation_w = ts_imu_W.data
q = [imu_orientation_x,imu_orientation_y,imu_orientation_z,imu_orientation_w]
%ts_imu.data
%plot(ts_imu)
[r1 r2 r3] = quat2angle(q)
plot(r3)
%a = ts_odom.data
%b = ts2_odom.data
%plot(a,b,'b');
%hold on;
%plot(c,d,'r');
%axis equal;
%axis([0 3.5 0 2.0]);