There's a line in: https://moveit.picknik.ai/humble/doc/tutorials/pick_and_place_with_moveit_task_constructor/pick_and_place_with_moveit_task_constructor.html
In this example, we do not cancel the executor once the task has finished executing to keep the node alive to inspect the solutions in RViz.
However the executor can be canceled. Keypoint is to make the Task instance alive, so the Introspection instance is alive to respond to GetSolution service calls.
Task class constructsIntrospection instance in constructor, and the Introspection instance in turn spins up its own executor and node in another thread. It's this node that responds to RViz's request.
https://github.com/moveit/moveit_task_constructor/blob/8e76def8545228f2947bea649583016bd363773b/core/src/introspection.cpp#L111-L128
Can be quickly verified by adding executor.cancel(); sleep(3600); to
Also I'd like to say statement about this should be bold to draw reader's attention. Take me for example, I took hours to realize why RViz couldn't view the solutions' detail.
Thanks!
There's a line in: https://moveit.picknik.ai/humble/doc/tutorials/pick_and_place_with_moveit_task_constructor/pick_and_place_with_moveit_task_constructor.html
However the executor can be canceled. Keypoint is to make the
Taskinstance alive, so theIntrospectioninstance is alive to respond toGetSolutionservice calls.Taskclass constructsIntrospectioninstance in constructor, and theIntrospectioninstance in turn spins up its own executor and node in another thread. It's this node that responds to RViz's request.https://github.com/moveit/moveit_task_constructor/blob/8e76def8545228f2947bea649583016bd363773b/core/src/introspection.cpp#L111-L128
Can be quickly verified by adding
executor.cancel(); sleep(3600);tomoveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/mtc_node.cpp
Line 378 in b0ba2a9
Also I'd like to say statement about this should be bold to draw reader's attention. Take me for example, I took hours to realize why RViz couldn't view the solutions' detail.
Thanks!