function  BVH2CSV( bvhfilename )

% [skel1, chh, fl ] = bvhReadFile(bvhfilename);
% for i=1:size(chh,1)
% [skel2,echh(i,:)] = bvh2expmap(skel1,chh(i,:));
% end


[skel2,echh] = ConvertBVH2EXP(bvhfilename);
skel1 = skel2;

for ii=1:length(skel2.tree)
skel1.tree(ii).expmapInd = skel2.tree(ii).rotInd;
end

a = ch_exp2xyz(echh, skel1);
       
csvwrite(strcat(strrep(bvhfilename,'.bvh','.csv')),a);
    

end

