Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add topic statistics helper plot #49

Merged
merged 2 commits into from
Oct 4, 2020
Merged

Conversation

carlossvg
Copy link
Contributor

@carlossvg carlossvg commented Sep 20, 2020

This PR adds a script to plot metrics from the topic statistics topic.

  • Test script with all the options

Instructions

  1. Enable enable_topic_stats: True param

  2. Launch demo

 ros2 launch pendulum_bringup pendulum_bringup.launch.py
  1. Log controller_stats in csv format
ros2 topic echo /controller_stats --csv > controller_stats.csv
  1. Run script passing the csv file:
python3 topic_statistics_plot.py path/to/controller_stats.csv --show -m message_period
  1. Check plot

Figure_1

python3 topic_statistics_plot.py path/to/controller_stats.csv --show -m message_age

Figure_2

Notes

  • Apparently the topic statistics maximum and minimum are not calculated for the measurement window but for the whole time. This makes the plot less informative.
  • The script assumes the order of the metrics is fixed. This could change in the future. This can be improved by using the data_types information.
  • The script will fail if there are NaN.

@carlossvg carlossvg requested a review from LanderU September 20, 2020 11:24
@carlossvg carlossvg force-pushed the add-topic-statistics-plot-script branch from dd5cfe0 to 4d3cd6a Compare September 20, 2020 13:44
Copy link
Member

@LanderU LanderU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor python style suggestions added.

@LanderU LanderU self-requested a review October 4, 2020 11:19
Copy link
Member

@LanderU LanderU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@LanderU LanderU merged commit 88cfe60 into foxy Oct 4, 2020
@carlossvg carlossvg deleted the add-topic-statistics-plot-script branch October 4, 2020 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants