Skip to content

Commit f240b2d

Browse files
author
AndyZe
authored
Add hints on debugging MTC from terminal output (#371)
1 parent c3c6511 commit f240b2d

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed
-121 KB
Binary file not shown.
-145 KB
Binary file not shown.
-193 KB
Binary file not shown.
-302 KB
Binary file not shown.

doc/tutorials/pick_and_place_with_moveit_task_constructor/pick_and_place_with_moveit_task_constructor.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,6 @@ All these stages should be added above these lines.
880880
return task;
881881
}
882882

883-
884883
Congratulations! You've now defined a pick and place task using MoveIt Task Constructor!
885884

886885
Visualizing with RViz
@@ -898,10 +897,30 @@ And in a second terminal: ::
898897

899898
ros2 launch moveit2_tutorials pick_place_demo.launch.py
900899

900+
Debugging from terminal
901+
^^^^^^^^^^^^^^^^^^^^^^^
902+
903+
When running MTC, it prints a diagram like this to terminal:
904+
905+
.. code-block:: bash
906+
907+
[demo_node-1] 1 - ← 1 → - 0 / initial_state
908+
[demo_node-1] - 0 → 0 → - 0 / move_to_home
909+
910+
This example^ shows two stages. The first stage ("initial_state") is a ``CurrentState`` type of stage, which initializes a PlanningScene and captures any collision objects that are present at that moment. A pointer to this stage can be used to retrieve the state of the robot. Since CurrentState inherits from ``Generator``, it propagates solutions both forward and backward. This is denoted by the arrows in both directions. The first ``1`` indicates that one solution was successfully propagated backwards to the previous stage. The second ``1``, between the arrows, indicates that one solution was generated. The ``0`` indicates that a solution was not propagated forward successfully to the next stage, because the next stage failed.
911+
912+
The second stage ("move_to_home") is a ``MoveTo`` type of stage. It inherits its propagation direction from the previous stage, so both arrows point forward. The ``0``'s indicate that this stage failed completely. From left to right, the ``0``'s mean:
913+
914+
- The stage did not receive a solution from the previous stage
915+
- The stage did not generate a solution
916+
- The stage did not propagate a solution forward to the next stage
917+
918+
In this case, we could tell that "move_to_home" was the root cause of the failure. The problem was a home state that was in collision. Defining a new, collision-free home position fixed the issue.
919+
901920
Various hints
902921
^^^^^^^^^^^^^
903922

904-
Information about individual stages can be retrieved like this. For example, here we retrieve a unique ID for a stage: ::
923+
Information about individual stages can be retrieved from the task. For example, here we retrieve the unique ID for a stage: ::
905924

906925
uint32_t const unique_stage_id = task_.stages()->findChild(stage_name)->introspectionId();
907926

0 commit comments

Comments
 (0)