flexbe_app icon indicating copy to clipboard operation
flexbe_app copied to clipboard

FlexBE app wont recognize second subclass from EventState class

Open tremblay0934 opened this issue 4 years ago • 2 comments

To clarify the problem, I designed a state called State1 which has EventState has a parent class, so

class State1(EventState):
    def __init__(self, dx_node_list, dx_topic_list, msg_type_list, max_time):
        super().__init__(outcomes=['completed', 'failed'])
...

And a made a second class like this:

class State2(State1):
    def __init__(self, max_time):
        super().__init__('/video_source', 'raw', Image, max_time)

State 2 is not recognized by FlexBE App. I am using ROS melodic built with python3.

I would like to know if this behavior is intended

tremblay0934 avatar Feb 13 '21 00:02 tremblay0934

This is the normal behavior of the default "Regex" parser. If you need support for such cases, there is an alternative parser that can be used. To change it, got to the "Configuration" panel of the FlexBE App and under "Workspace" change "State parser" tp "Python". Then, it uses python to determine whether a class is a state, fully supporting sub-classes.

pschillinger avatar Sep 11 '21 15:09 pschillinger

@pschillinger is there a reason for using regex as default parser instead of Python? Should we consider changing default for ROS 2 ?

dcconner avatar Apr 28 '23 19:04 dcconner