Outputs trajectory to csv file