Open sudo-panda opened 5 years ago
I checked the design for parameterization, It looks good, let's develop parameters taking the easiest example of Kobuki Obstacle Avoidance, further we'll iterate on the design with the help of examples. I believe we have the parameter for LaserThreshold in the example, thus we can develop using it.
kobuki_obstacle_avoidance.txt This the xml file for the modified kobuki obstacle avoidance. I changed the extension to txt so the I can upload it here.
Hi @sudo-panda. I tried importing the behavior. I have the following reviews -
First of all, I mean the design of the functionality. We need to discuss a little how the feature will work and how we can implement this feature as part of the current visualstates.
States already have variables individually so why create a new way to add state wise variables. We can just convert the variables to act the way parameters do now. I had initially thought of parameters as a part of VisualStates and not individual states because I thought that parameters that needed to be tweaked were usually used globally in various states. We could also make the parameters global and mention during import the parameters used by each state. What do we do?
I agree that we should make the UI similar everywhere in the whole tool and I will place the new button at the top and try to make other changes that feel suitable.
Since, we aim to import particular state from a visualstate, individual parameterization of whole visualstate does not make sense. Parameters can be thought in that sense a public variable of the state/behavior. For example, if parameters are at the root state, they will be used in whole visualstate. However, I am not sure which approach is better. Let's discuss this further by considering the case where the use wants to import a particular state of a complex behavior.
Currently, in VisualStates we have a Global Namespace which contains the ROS parameters and global variables which are accessible by any state or transition. Each state also contains a Local Namespace in which variables only accessible by that particular state exists. A variable, whether defined in the global namespace or local namespace may act as a parameter. But I think it is not necessary that every variable declared by the user is a parameter. I also think it is a good topic for discussion on whether to keep parameters individually or state specific. I have two examples in mind -
obstacle_threshold
is in Local Namespace i.e only accessible by the states under the root states. Ok so we make parameters a local namespace variable in the source code. Do we only show the list of parameters during import or allow them to be modified?
Final design:
Right now the parameters behave exactly like local variables except for how they are created. So they don't have much advantage over the local namespace variables. This will change when we added the selective import of states and the online importer exporter to the tool.
Since I have to show the use of parameters and their advantage in the demonstration video I have nothing to show. Hence I was wondering if I could add a dialog that comes up during the generation of code that lists out all the parameters along with their states and allows users to only change the values. This will make it easier for the users to tweak their values to perfection
@okanasik You asked me to display a list of parameters added on import of a VisualStates file. Do I just show them or let the users edit the value too?
@sudo-panda I am not sure whether letting the user to change the parameters while importing the state will be useful. The user may need to test the behavior to find the correct parameters. What do you think?
The auotmata parameters is more an edition topic than an import topic. Isn't it?
I mean, the user imports an automaton (an existing HFSM from the library) to include it on her new automaton that is being created, and AFTER that import she can fine tune the particular behavior of the imported automaton changing its parameters at will. This remains me like importing a software library: the programmer imports a library and after that calls its functions with the corresponding parameters/arguments....
So what are you suggesting @jmplaza ?
Is this representation fine?
@sudo-panda this representation looks good. Nice work.
The auotmata parameters is more an edition topic than an import topic. Isn't it?
I mean, the user imports an automaton (an existing HFSM from the library) to include it on her new automaton that is being created, and AFTER that import she can fine tune the particular behavior of the imported automaton changing its parameters at will. This remains me like importing a software library: the programmer imports a library and after that calls its functions with the corresponding parameters/arguments....
Actually, we do not design this way. We assume that parameter update and change is part of the import process. Also, user can change the parameter at any point of the development. The only difference is that user can import states from a repository of behavior. Also, the user can cherry-pick which ever state, she wants to import.
Is this representation fine?
Week 7 discussion: Tree of states with parameters are going to be shown during import and the the states can be selected right there and states are collapsible
Hi @sudo-panda , I found a minor bug while checking the PR. Here's the issue - #6
I have already added parameterization to VisualStates tool but as Sir Okan said, and I agree, that it would better to discuss it with everyone to better the design.
Here are some screenshots of the current design:
Pull request #1 adds this feature to VisualStates