Skip to content

Commit

Permalink
fix(track_path): limit the number of displayed data
Browse files Browse the repository at this point in the history
Signed-off-by: takeshi.iwanari <take.iwiw2222@gmail.com>
  • Loading branch information
iwatake2222 committed Feb 26, 2024
1 parent 47d45e4 commit 19d6db2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions report/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export note_text_bottom=./note_text_bottom.txt # Path to setting file
export start_strip=120 # strip time at the start [sec] for analysis
export end_strip=30 # strip time at the end [sec] for analysis
export sim_time=false # use simulation time (ROS time) or system time
export find_valid_duration=false # (optional) Set true so that start_strip is automatically detected
export duration=0 # (optional) Set a value (second) for duration to calculate end_strip
export trace_data=~/.ros/tracing/session-yyyymmddhhmmss # Path to CARET trace data (CTF file)
sh ${script_path}/make_report.sh
```
Expand Down Expand Up @@ -63,6 +65,8 @@ export note_text_bottom=./note_text_bottom.txt # Path to setting file
export start_strip=120 # strip time at the start [sec] for analysis
export end_strip=30 # strip time at the end [sec] for analysis
export sim_time=false # use simulation time (ROS time) or system time
export find_valid_duration=false # (optional) Set true so that start_strip is automatically detected
export duration=0 # (optional) Set a value (second) for duration to calculate end_strip
export trace_data=~/.ros/tracing/session-yyyymmddhhmmss # Path to CARET trace data (CTF file)
sh ${script_path}/make_report.sh
```
Expand Down
8 changes: 6 additions & 2 deletions report/track_path/make_report_track_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import numpy as np
import pandas as pd
from bokeh.plotting import figure, save
from bokeh.models import FixedTicker
from bokeh.models import FixedTicker, DataRange1d
from bokeh.resources import CDN
import flask

Expand Down Expand Up @@ -205,7 +205,7 @@ def make_stats(dest_dir: str, report_store_dir: str, relpath_from_report_store_d
for target_path_name in target_path_name_list:
for target_path_info in stats:
if target_path_info['target_path_name'] == target_path_name:
df_per_path.loc[version][target_path_name] = [
df_per_path.loc[version, target_path_name] = [
target_path_info[val] if type(target_path_info[val]) is float else np.nan for val in value_name_list]
break

Expand All @@ -223,6 +223,10 @@ def make_stats(dest_dir: str, report_store_dir: str, relpath_from_report_store_d
fig.xaxis.major_label_orientation = -math.pi/2
fig.xaxis.ticker = FixedTicker(ticks=list(range(len(df.index))))
fig.add_layout(fig.legend[0], "right")
NUM_DISPLAYED_DATA = 17
if len(df) > NUM_DISPLAYED_DATA:
fig.x_range = DataRange1d(start=max(0, len(df)-NUM_DISPLAYED_DATA), end=len(df))

save(fig, filename=make_file_name(target_path_name, dest_dir) , title=target_path_name, resources=CDN)
filename_path_dict[target_path_name] = make_file_name(target_path_name, dest_dir, False)

Expand Down
6 changes: 0 additions & 6 deletions sample_autoware/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ export duration=0

export trace_data=~/work/caret_tracedata/universe/session-20231114050140/session-20231114050140

Check warning on line 19 in sample_autoware/run.sh

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (tracedata)

## Use this to find the valid start/end of the trace data automatically
# sh ../report/find_valid_duration/find_valid_duration.sh
# export start_strip=$(cat start_strip.txt)
# export end_strip=$(cat end_strip.txt)
# rm start_strip.txt end_strip.txt

# Create analysis report
sh ../report/report_analysis/make_report.sh

Expand Down

0 comments on commit 19d6db2

Please sign in to comment.