Introspection

The state machine we design or create in smach_ros can be visualized for debugging or analysis through a tool called SMACH viewer. The following diagram shows the use of SMACH viewer with the preceding PR2 robot example (the text and numbers in this image are intentionally illegible):

SMACH viewer representation (source: http://wiki.ros.org/smach_viewer. Image from ros.org. Licensed under Creative Commons CC-BY-3.0: https://creativecommons.org/licenses/by/3.0/us/legalcode)

The robot is currently in the DETECT_OUTLET state, which is indicated in green.

To view these states in the SMACH viewer, you must define an introspection ...

Get ROS Robotics Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.