Skip to content

Commit

Permalink
added factor counts
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoussan committed Jan 25, 2024
1 parent 47f2833 commit f70b7ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/localization_analysis/scripts/plot_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,9 @@ def timestamped_imu_biases_with_covariance_from_graph_vio_states(graph_vio_state
def optical_flow_feature_counts_from_graph_vio_states(graph_vio_states):
return [graph_vio_state.num_detected_of_features for graph_vio_state in graph_vio_states]

# Return list of number of optical flow factors from graph vio states
# Return list of optical flow factor counts from graph vio states
def optical_flow_factor_counts_from_graph_vio_states(graph_vio_states):
return [graph_vio_state.num_detected_of_features for graph_vio_state in graph_vio_states]

return [graph_vio_state.num_of_factors for graph_vio_state in graph_vio_states]

def velocity_plotter_from_graph_vio_states(graph_vio_states):
xs, ys, zs = xyz_velocity_vectors_from_graph_vio_states(graph_vio_states)
Expand All @@ -114,6 +113,11 @@ def gyro_bias_plotter_from_graph_vio_states(graph_vio_states):
return Vector3dPlotter("Graph VIO Gyro Bias", times, xs, ys, zs, ['X', 'Y', 'Z'])

def optical_flow_feature_count_plotter_from_graph_vio_states(graph_vio_states):
counts = optical_flow_feature_counts_from_graph_vio_states(graph_vio_states)
times = times_from_timestamped_objects(graph_vio_states)
return ValuePlotter("Graph VIO OF Counts", times, counts, "Time (s)", "Num Features", "OF")

def optical_flow_factor_count_plotter_from_graph_vio_states(graph_vio_states):
counts = optical_flow_factor_counts_from_graph_vio_states(graph_vio_states)
times = times_from_timestamped_objects(graph_vio_states)
return ValuePlotter("Graph VIO OF Counts", times, counts, "Time (s)", "Count", "OF")
return ValuePlotter("Graph VIO OF Factors", times, counts, "Time (s)", "Num Factors", "OF")
5 changes: 5 additions & 0 deletions tools/localization_analysis/scripts/vio_results_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ def plot_vio_results(
of_count_plotter = plot_conversions.optical_flow_feature_count_plotter_from_graph_vio_states(graph_vio_states)
of_count_plotter.plot(pdf)

of_num_factors_plotter = plot_conversions.optical_flow_factor_count_plotter_from_graph_vio_states(graph_vio_states)
of_num_factors_plotter.plot(pdf)






Expand Down

0 comments on commit f70b7ea

Please sign in to comment.