Example of ROS2 C++ blocking action request
I'm looking for a C++ example of a blocking action request. Basically I seek the C++ version of this Python answer: https://answers.ros.org/question/3772...
In other words, I want to do something like this:
my_action_client_->async_send_goal(my_request, send_goal_options);
// block until complete here
Hi @AndyZe, here you can find the C++ version of the Fibonnaci example shown in the previous answer. https://github.com/ros2/demos/tree/fo... Hope that's what you are looking for
Yep, thanks. It doesn't block until the action finishes, though.
I suspect the answer is to use
async_get_result()
but the syntax is a little tricky. I wish there were an example.There is a little bit of information in the source code