Refactor PeriodicMeasurementNode to inherit from LifecycleNode #72
Conversation
Will remove from draft after adding support for the lifecycle message types (instead of comparing expected lifecycle states to integer values, compare to the actual name). |
Manually tested the launch script using
|
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.cpp
Outdated
Show resolved
Hide resolved
Are |
Reading the last part of the post, I think we are OK given that this PR manually invokes the state transitions. We could do the same for the composable process nodes in their constructor (autostart flag?). |
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.hpp
Show resolved
Hide resolved
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.hpp
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After hallway discussion, LGTM 👍
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Refactor unit tests to use lifecycle methods Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Revert unrelated changes Manually invoke lifecycle transition in main.cpp Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.hpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/system_metrics_collector/test_periodic_measurement_node.cpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A few nits. You should also probably update the README to explain why this is a managed node? And maybe explain what is the value/how to do things? (e.g. I want to pause data collection, how I do this with the ROS2 cli?)
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comment suggestions, otherwise LGTM
system_metrics_collector/src/system_metrics_collector/periodic_measurement_node.cpp
Outdated
Show resolved
Hide resolved
system_metrics_collector/test/system_metrics_collector/test_periodic_measurement_node.cpp
Show resolved
Hide resolved
system_metrics_collector/test/system_metrics_collector/test_periodic_measurement_node.cpp
Show resolved
Hide resolved
system_metrics_collector/test/system_metrics_collector/test_periodic_measurement_node.cpp
Show resolved
Hide resolved
Signed-off-by: Devin Bonnie <dbbonnie@amazon.com>
Build and tests pass, but codecov is still broken. |
Inherit from LifecycleNode in order to use the existing state machine for a user to start and stop collection. This PR does the following: