DLR-RM / RAFCON

RAFCON (RMC advanced flow control) uses hierarchical state machines, featuring concurrent state execution, to represent robot programs. It ships with a graphical user interface supporting the creation of state machines and contains IDE like debugging mechanisms. Alternatively, state machines can programmatically be generated using RAFCON's API.
https://dlr-rm.github.io/RAFCON/
Eclipse Public License 1.0
180 stars 34 forks source link

Script.py naming convention makes search difficult #894

Open sillkjc opened 2 months ago

sillkjc commented 2 months ago

Hi, A minor issue but its a little bit of a QOL pet peeve. Since states scripts are all called script.py it becomes difficult to see the context of a search result in most IDE's. You have to resort to the path to determine what state the script belongs to. In some cases, as shown below, this is impossible to see without clicking on each one individually. You should be able to get some context from the filename, but instead we need to use the file location: image

Git commit window in Pycharm: image

Searching by file name is also difficult (and will get worse when we produce hundreds of states: image

Would it be possible to include an option to name the script uniquely based on the state name? Many thanks

JohannesErnst commented 2 months ago

Hey @sillkjc,

I totally understand the bother. When using VSCode the whole path is usually showing which makes it easier to see or we mainly develop using the RAFCON GUI anyways.

While I think changing the name would make sense from a user perspective, I know that this would be quite some effort to actually implement. We would first need additional statements to check the name and also some functionality that keeps the naming of the path and script consistent. Especially when renaming (which we do quite often) this could quickly become messy if not properly implemented. Currently, we are also planning to reduce the memory consumption which runs a little opposite to the idea of more individualism in the naming convention in general... Because of this I don't think we will have the resources to tackle this anytime soon. However, I encourage you to contribute to the RAFCON project if you have time!

I will definitely leave this open for now, maybe we will see an urgent need for this change in the future as well.

For now I can only recommend some workaround: Maybe consider including a header to all your scripts which holds the state name, and some author and maybe description. This is also kinda ugly as this information should go into the dedicated description field of a state and also only solves half of your problem. But maybe worth trying out...