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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.