Event Types & Labels

EventTypes may have option meta-information about “transition edge labels and transition node TagNames”.For example, during the implementation of EvSucceded we specify the following metainformation:

  • ¬†Default transition edge label: type of the action client, move_base::MoveBaseAction
  • Default transition tagname: “SUCCESS”what this mean?the case of the transition edge label: at the current moment for any transition that is activated by this EvSucceded will be labeled the edge with that c++ name

The second line move_base_msgs::MoveBaseAction is that label, that is by default empty for any event——————-For the case of the transition nodes “transitionTagNames”:by default transition tagnames are named automatically: transition_1, transition_2, etc…

You can specify manually an alternative name, ie: “SUCCESS”, and that name will be shown. Some of these names in the viewer have some specific style. In this case, SUCCESS is painted as green, but there is an additional functionality to set the value of “TransitionTagName”s automatically. Any event type can define the preferred “TransitionTagName”, overriding the convention “transition_1”, “transition_2”, etc. if you specify manually in the transition line some explicit TransitionTagName, that will be used.

For instance smacc::transition<EvSucceded<MoveBaseActionClient>, DstState, MYTRANSITION>MYTRANSITION will be shown but if you do not specify MYTRANSITIONit will be shown SUCCESS, because the EvSucceded already defines that default/automatic transitionTagNameThis is an example of implementation of the EvSucceded event in c++template

struct EvActionSucceded : sc::event>, IActionResult
{
typename TSource::Result resultMessage;

static std::string getEventLabel()
{
// show ros message type
std::string label;
EventLabel(label);
return label;
}

static std::string getDefaultTransitionTag()
{
return "SUCCESS";
}
};

you can see how the event defines two static methods getEventLabel and getDefaultTransitionTagthe getEventLabel may be a bit complicated implementation, but essentially it extract from metaprograming the type of the ActionClient, on the other hand getDefaultTransitionTag is very easy to understandOther methods that also implement some of these two functions are EvSucceded, EvAborted, EvPreempt, EvRejected, EvTopicMessage