SMACC Viewer

What we want: Sidebar

We want the userdata sidebar to be able to toggle between the following data sources (which may or may not exist yet)…

  • Event Log (Event Name, Parent?, Timestamp, ElapsedTime)
  • State Log (Event Name, Parent?, Timestamp, Elapsed Time
  • Transition Log (Transition Name, Parent, Timestamp, Elapsed Time)
  • State Machine Stats (Event Count, State Count, Total States, Timestamp, Elapsed Time)
  • State Machine Variables
  • Current State Variables

What we want: Controls

We want the following buttons added

  • + Zoom In
  • – Zoom Out
  • -> Pan Right
  • <- Pan Left
  • ^ Pan Up
  • v Pan Down

What we want: Buttons

We want 4 buttons (taken from PackML) that will each send a message on a topic…

  • Reset
  • Stop
  • E-Stop

Introspection Server

What we currently have SMACC state_machine_base.h set up as the introspection server

https://github.com/reelrbtx/SMACC/blob/master/smacc_core/include/smacc/smacc_state_machine_base.h

See lines 356, 401, 440 & 591

and we’re using these msgs…

https://github.com/ros/executive_smach/tree/indigo-devel/smach_msgs/msg

We will need to fork this package as well, and modify the SMACC Viewer to use smacc_msgs, to add the debug messages that will turn the SMACC Viewer into the IDE we need.

——————————————————————

SMACC Viewer

This is the main file… (Adapted from Johnathon Bohren’s Smach viewer)

https://github.com/reelrbtx/SMACC/blob/master/smacc_viewer/scripts/smacc_viewer.py

The SMACC viewer is written in python, and itself is a wrapper for the xdot package written by Jonathon Fonseca, and uses the dot language (which is what graphviz/doxygen use).

 

Outcomes = transition::destination

Userdata = state local data (& perhaps state machine local data)

https://wiki.wxwidgets.org/Documentation

———————————————–

xdot.py

From the readme…

xdot.py is an interactive viewer for graphs written in Graphviz‘s dot language.

It uses internally the GraphViz’s xdot output format as an intermediate format, Python GTK bindings, and Cairo for rendering.

https://github.com/jrfonseca/xdot.py

When I do a search for record, in this repo, the only things that return are in the /test folder. So I think that xdot doesn’t support records & mrecords, and may require a pull request, forking, etc.

The relevant parts of the code are in these two files…

https://github.com/jrfonseca/xdot.py/blob/master/xdot/dot/parser.py

https://github.com/jrfonseca/xdot.py/blob/master/xdot/ui/elements.py

The idea being to create a record class in elements.py and a function to deal with the class in parser.py – I think.

Although there are alternatives to xdot.py (see bottom of xdot.py’s github page above for a good set of links), Jonathon Bohren seems to have spent some time integrating xdot and the smach viewer, so currently I (Brett) am of the opinion is that we should fork xdot to support mrecords. xdot.py is not a huge package or anything.

https://github.com/jbohren/xdot

https://github.com/jrfonseca/xdot.py/issues/9

————————————-

Graphviz

Here is a link to the up-to-date documentation

https://graphviz.gitlab.io/documentation/

From the first paragraph on this page…

https://graphviz.gitlab.io/_pages/doc/info/shapes.html

"The record-based shape has largely been superseded and greatly generalized by HTML-like lables." That is, intead of using shape=record, one might consider using shape=none, margin=0 and an HTML-like label."

https://graphviz.gitlab.io/_pages/doc/info/shapes.html#html

Here is a code sample that appears to be right up our alley..

https://spin.atomicobject.com/2017/11/15/table-rel-diagrams-graphviz/

————————————

For a nice little primer on the dot language (used by graphviz & smach viewer)

http://www.graphviz.org/pdf/dotguide.pdf

See below for a nice set of examples…

https://renenyffenegger.ch/notes/tools/Graphviz/examples/index


wxGlade

I think this is an interesting option for development…

http://wxglade.sourceforge.net/

https://www.youtube.com/results?search_query=wxglage+crash+course