Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request Fixes issue #91
The issue is caused by the
self._state_cb
where is going at the same rate of the Controller Manager.To solve this, the subscriber is created and destroyed every time the action is called using
wait_for_message
rlcpy function.Before the fix:
![cpu_consumption](https://private-user-images.githubusercontent.com/119340031/383253179-c71ad17c-6fab-4722-8e6d-0d5ca62fcb72.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5NzM3ODQsIm5iZiI6MTczOTk3MzQ4NCwicGF0aCI6Ii8xMTkzNDAwMzEvMzgzMjUzMTc5LWM3MWFkMTdjLTZmYWItNDcyMi04ZTZkLTBkNWNhNjJmY2I3Mi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxOVQxMzU4MDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00YzFjZGRmZmFmNmI1MmU4YzI4ZWYyYjEwNTBjNTAwN2Q2NDM2OGI1ZjRlODU4YmI0NTE0MjQ0NDlkOTUxODQ4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.geJaY0Bo13lB734BXeWXWV6A9WvTq_gJO_nc3A1e8H8)
After the fix:
![cpu_consumption_solved](https://private-user-images.githubusercontent.com/119340031/383253393-ae3b9b82-1356-47df-8355-799e45fdef57.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5NzM3ODQsIm5iZiI6MTczOTk3MzQ4NCwicGF0aCI6Ii8xMTkzNDAwMzEvMzgzMjUzMzkzLWFlM2I5YjgyLTEzNTYtNDdkZi04MzU1LTc5OWU0NWZkZWY1Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxOVQxMzU4MDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00MjJlMzFkYjFkMmUwYmNjYjdlZjI0ODQzYThhNjRiMTYxM2M1NjBjNGRmMDM5ZWUwNmE1MWE5MTZjY2VkOTY3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.imc9UiaAu_ao9TLfITGGSsSeu9OuzDcwWYwq4HL3WQ0)
fixes #91