-
Notifications
You must be signed in to change notification settings - Fork 299
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
Async Function Handler for Controllers #1489
Merged
Merged
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
e8130a4
Add first version of the async controllers
saikishor 062a445
removed extra notify one
saikishor fd270ca
added async_update_ready_ to use with conditional variable to avoid s…
saikishor 703f91f
call notify_one after setting the async_update_ready
saikishor c09339f
add precommit changes
saikishor 1f58a2d
add missing this in the conditional variable callback
saikishor c2f7192
change atomic bool to normal bool
saikishor 4255cc3
add wait_for_update_to_finish method
saikishor 9f7c0b4
add notify_one in different places to wait properly to finish update …
saikishor faba7cd
added unique lock and check with try_lock for triggering calls
saikishor 4ffa885
use try_to_lock for better checking of owning the lock or not
saikishor f575440
add current update time and period to be able to update them
saikishor 4348019
update documentation of the async method
saikishor a2469ca
added some comments about the issue with the get_state method
saikishor ffaad19
use atomic_bool
saikishor b7586a2
minor change in the logic
saikishor 0772c49
initialize the duration to fix the compilation error
saikishor bf2a2d3
Move the main async logic into a separate method
saikishor 89e6a7b
Add async function handler to handle parsed functions
saikishor 2e0a0d2
add missing template typenames on functions
saikishor bfae6a1
set wait_for_update_to_finish to const
saikishor c2adc42
change async_update_ready_ to atomic bool
saikishor 5ca2e5d
use also async_update_stop_ also in the conditional wait predicate fu…
saikishor c5a00e6
Add some utility methods
saikishor b83157d
modify the std::function arguments of async_update method
saikishor 225c96f
Fix the issue with the overidding template names and typo in the std:…
saikishor 1f3377c
fix the wait for update to finish method
saikishor fd8be6d
Check if the parsed functions are valid or not in the init method
saikishor 794a8c0
unlock the mutex before notifying the conditional variable
saikishor 619f46d
Do not check if the thread is joinable in the is_initialized method
saikishor 98aa3b0
added a explicit method to join the async thread
saikishor 7f9e47f
Add missing includes
saikishor b5ad675
change the way the initialization in done
saikishor 3cd856f
Added tests for the new async function handler
saikishor f88fe20
extend the tests with another loop
saikishor eb7da6b
Added test case to check for triggering
saikishor b61b8cd
Also test the case of triggering without initialization
saikishor 3fe3d31
Add test triggering the handler for several cycles
saikishor 1fb5955
Add the test cases of changes in the lifecycle state
saikishor 6952577
remove is_async method and added is_preempted method + changes to the…
saikishor b3975db
Use the AsyncFunctionHandler instead of implementing in the controlle…
saikishor 47d5928
Add documentation to the methods
saikishor d86be02
remove the arguments to initialize_async_update_thread method
saikishor 76e3f30
simplify the is_initialized method check
saikishor f1634bc
rename preempt_async_update to stop_async_update
saikishor c094f81
Separate the exceptions for the parsed methods
saikishor 88ceb3c
change the exception inside the initialize_async_update_thread
saikishor cecb00b
move the test implementations to the cpp file
saikishor f61e382
Remove the unlock when preempted as the lock goes out of scope
saikishor c070ed6
rename async_update_ready_ to trigger_in_progress_
saikishor fff989e
update the docs
saikishor 71f7ad9
rename the method wait_for_update_to_finish to wait_for_trigger_cycle…
saikishor fa6a88c
Add documentation to the trigger_update method and add it to the cont…
saikishor 91aab1f
added a method to stop the async update cycle before deactivating the…
saikishor 6ad0c1b
return std::pair to check if the trigger is successful or not
saikishor d2c6692
update the runtime error throw message
saikishor c4b9f82
rename is_preempted to is_stopped for the context of the threads
saikishor 48b2c2f
change EXPECT_THROW to ASSERT_THROW
saikishor a62da78
Update the documentation of the init return entity
saikishor f8a93ff
Fix the doc of stop_async_update_cycle
saikishor 5d4b4e2
add minor information
saikishor 20bc5d1
add missing functional include
saikishor 600da5c
check if lock is owned or not before in the condition
saikishor 7f2aa64
Use separated arguments for better clarity
saikishor 679fbf9
Move the lock within a scope to avoid exclusive unlock within the thread
saikishor d1ac8df
notify other waiting threads before stopping
saikishor 4e3dbb1
Scope the lock to avoid manual unlock in the trigger_async_update method
saikishor 30be210
Update async_update_stop_ within the scope of the lock to avoid missi…
saikishor e54e613
Add new conditional variable to have unexpected behavior when working…
saikishor 47f6b02
Changes for the starting thread upon activation
saikishor 8525725
remove unused notify at the end of the thread
saikishor 4eb74cc
simplify the logic inside the thread
saikishor a131029
add pre-commit formatting changes
saikishor b4b2afa
remove the AsyncControllerThread integration to replace it with Async…
saikishor ee64bc7
move the async function handler to the realtime_tools and integrate f…
saikishor 469682a
start the async thread when configuring the controller
saikishor f3b5d43
remove the get_state bind for API change
saikishor 408780c
add new API naming changes
saikishor 8f10adc
added thread priority argument to be able to set the scheduler priority
saikishor a40b005
stop the thread on cleanup of the controller
saikishor aa9a81e
wait for cycle to finish in the switch controllers before deactivatin…
saikishor 023a204
fix the thread_priority parameter declaration type
saikishor 3bd19bf
change conditioning to not trigger logging for a failed return as well
saikishor ebb69c5
Add tests for the async controller
saikishor e38f567
Update controller_interface/src/controller_interface_base.cpp
saikishor cbc3638
Merge branch 'master' into async_controllers
saikishor 00228c4
Update controller_interface/include/controller_interface/controller_i…
destogl df9378f
Fixing pre-commit.
destogl dd89180
skip triggeting update cycle before deactivating the async controller
saikishor 5a85a24
fix the testing for the recent change in the deactivation scheme
saikishor 75754de
Add controller update stats to print every 20 seconds when there is a…
saikishor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 0 additions & 112 deletions
112
controller_interface/include/controller_interface/async_controller.hpp
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
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.
For the future: why not just to have this once using
<depend>
tag?