function [Xtmotion, Xroll, Xpitch, Xrollrate, Xpitchrate]=read_Wband_crossbow(fm)


disp('read crossbow');
zm=[];
% fm = [way_raw_motion_wband '\' yyyy ddds hr '00Crossbow.txt'];
flist= fopen(fm,'r');
disp(fm)
if flist>0
    dummy=fgetl(flist);
    headr=fgetl(flist);%disp(headr)
    dummy=fgetl(flist);
    headr1=fgetl(flist);
    zm=fscanf(flist,'%2f/%2f/%4f %f:%f:%f %g %g %g %g %g %g %g',[13,inf]);
%                     1    2  3        4  5  6  7  8  9 10 11 12        
else
    zm=ones(36000,13)*NaN;
end;

% Xtmotion=zm(5,:)*60+zm(6,:);  %time in seconds
Xtmotion=zm(4,:)+zm(5,:)/60+zm(6,:)/3600;
Xroll=zm(7,:);                %roll (rad)
Xpitch=zm(8,:);               %pitch(rad)
Xrollrate=zm(9,:);            %roll rate(rad/s)
Xpitchrate=zm(10,:);           %pitch rate(rad/s)
Xrollrate=Xrollrate*(150/2^15);     %Converts to degrees 
Xpitchrate=Xpitchrate*(150/2^15);    %Converts to degrees
Xxac=zm(11,:);                %x acceleration(m/s2)
Xyac=zm(12,:);                %y acceleration(m/s2)
Xzac=-zm(13,:);                %z acceleration(m/s2)
Xroll=Xroll*(180/2^15);     %Converts to degrees  (why .005493 ??)  
% --> in the Corssbow manual 0.005493 is 180deg/(2^15), which converts the digital data to angle
Xpitch=Xpitch*(180/2^15);    %Converts to degrees

clear flist;