felipecode / coiltraine

Training framework for conditional imitation learning
MIT License
230 stars 68 forks source link

Fix issue with parsing csv headers in the plotter. #26

Open tomcur opened 4 years ago

tomcur commented 4 years ago

Description

Fixes an issue with parsing csv column header names in the plotter code. On my Linux machine, the last name in the header list had its last character stripped (e.g. end_point would be parsed as end_poin). This PR changes the parsing to use a more generic whitespace stripper.

The original code resulted in the following error:

Traceback (most recent call last):
  File "/home/thomas/code/autonomous-driving/carla/coiltraine/coil_core/run_drive.py", line 128, in driving_benchmark
    checkpoint_number, town_name, g_conf.PROCESS_NAME.split('_')[1])
  File "/home/thomas/code/autonomous-driving/carla/coiltraine/plotter/plot_on_map.py", line 170, in plot_episodes_tracks
    episodes_positions, travelled_distances = split_episodes(meas_file)
  File "/home/thomas/code/autonomous-driving/carla/coiltraine/plotter/plot_on_map.py", line 87, in split_episodes
    previous_end_point = details_matrix[0, header_details.index('end_point')]
ValueError: 'end_point' is not in list

Where has this been tested?

Platform(s): linux
Python version(s): 3.5

Possible Drawbacks

None.