FlexBE / flexbe_app

The classic user interface (editor + runtime control) for the FlexBE behavior engine. See the flexbe_webui for latest
BSD 3-Clause "New" or "Revised" License
48 stars 49 forks source link

FlexBE app wont recognize second subclass from EventState class #71

Open tremblay0934 opened 3 years ago

tremblay0934 commented 3 years ago

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

pschillinger commented 3 years ago

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.

dcconner commented 1 year ago

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