Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Add SubscriberTopicStatisticsNode and tests #112

Merged
merged 7 commits into from Apr 1, 2020

Conversation

prajakta-gokhale
Copy link
Member

@prajakta-gokhale prajakta-gokhale commented Mar 12, 2020

@prajakta-gokhale prajakta-gokhale force-pushed the prajaktg/subscriber-topic-stats branch 2 times, most recently from 988bb36 to da58418 Compare March 12, 2020 23:08
Copy link
Member

@mm318 mm318 left a comment

Choose a reason for hiding this comment

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

A lot of the code in SubscriberTopicStatistics look the same as the PeriodicMeasurementNode. Can they be refactored to have a common base class?

@prajakta-gokhale prajakta-gokhale marked this pull request as ready for review March 20, 2020 08:43
@prajakta-gokhale prajakta-gokhale changed the title [WIP] Add subscriber_topic_statistics class and tests Add SubscriberTopicStatisticsNode and tests Mar 20, 2020
@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #112 into master will increase coverage by 1.52%.
The diff coverage is 41.63%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
+ Coverage   33.54%   35.06%   +1.52%     
==========================================
  Files          26       29       +3     
  Lines        1106     1363     +257     
  Branches      724      878     +154     
==========================================
+ Hits          371      478     +107     
- Misses         63       81      +18     
- Partials      672      804     +132     
Flag Coverage Δ
#unittests 35.06% <41.63%> (+1.52%) ⬆️
Impacted Files Coverage Δ
...ics_collector/test_subscriber_topic_statistics.cpp 35.84% <35.84%> (ø)
...atistics_collector/subscriber_topic_statistics.hpp 44.87% <44.87%> (ø)
...src/topic_statistics_collector/parameter_utils.hpp 75.00% <75.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 22f8de5...0564745. Read the comment docs.

@prajakta-gokhale prajakta-gokhale changed the title Add SubscriberTopicStatisticsNode and tests [WIP] Add SubscriberTopicStatisticsNode and tests Mar 20, 2020
@prajakta-gokhale prajakta-gokhale changed the title [WIP] Add SubscriberTopicStatisticsNode and tests Add SubscriberTopicStatisticsNode and tests Mar 20, 2020
@prajakta-gokhale prajakta-gokhale force-pushed the prajaktg/subscriber-topic-stats branch 3 times, most recently from 2b8b9ba to 63a0924 Compare March 20, 2020 23:07
Copy link
Contributor

@dabonnie dabonnie left a comment

Choose a reason for hiding this comment

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

This is a fairly large PR (currently +849) and isn't the easiest to review: I probably need to make another pass. If possible I would suggest breaking this up.

@prajakta-gokhale
Copy link
Member Author

This is a fairly large PR (currently +849) and isn't the easiest to review: I probably need to make another pass. If possible I would suggest breaking this up.

Refactored version is smaller and more straight-forward imo. Figured it's easier to view class+unit tests together, if not I can separate the two into different PRs.

Copy link
Contributor

@dabonnie dabonnie left a comment

Choose a reason for hiding this comment

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

This is getting close. Once the lifecycle transitions are fixed this is pretty much done.

Prajakta Gokhale added 5 commits March 30, 2020 21:29
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
Copy link
Contributor

@emersonknapp emersonknapp left a comment

Choose a reason for hiding this comment

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

minor non-blocking nits

@@ -27,6 +27,7 @@
<test_depend>ament_lint_common</test_depend>
<test_depend>class_loader</test_depend>
<test_depend>lifecycle_msgs</test_depend>
<test_depend>sensor_msgs</test_depend>
Copy link
Member

Choose a reason for hiding this comment

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

can we avoid this by using a dummy message in the test folder?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it is possible to use a dummy message with Header. Currently multiple packages use IMU messages in tests, I have filed #120 to change them.

/**
* Class which makes periodic topic statistics measurements, using a ROS2 timer.
*/
template<typename T>
Copy link
Member

Choose a reason for hiding this comment

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

Please document what is T here. Can we add a static_assert to make sure only "allowed types" are passed?

Copy link
Member Author

Choose a reason for hiding this comment

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

T here is for any ROS 2 message type. I'm not sure how we can enforce that using static_assert?

Signed-off-by: Prajakta Gokhale <prajaktg@amazon.com>
@prajakta-gokhale prajakta-gokhale merged commit aae3cb5 into master Apr 1, 2020
@prajakta-gokhale prajakta-gokhale deleted the prajaktg/subscriber-topic-stats branch April 1, 2020 01:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants