Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reload/refresh state modules from Statemachine Editor function #61

Open
GerardHarkemaAvans opened this issue Apr 11, 2020 · 7 comments
Open

Comments

@GerardHarkemaAvans
Copy link

As mentioned in #10 there should be a function to update the states after changing ist python script. Sorry, but i cannot find this function in the user-interface of the flexbe app. What is the correct procedure to update the design?

Thanks in advance,

Gerard

@pschillinger
Copy link
Member

The referenced update function is automatic and works in the background. Using Ubuntu's mechanism to receive updates about changed files, the state files are automatically re-loaded when such notifications are received. No need to do something manually, just save the state's python file.

@asierfernandez
Copy link

We are experiencing the same issue. We've tested it under Ubuntu 16.04 and Ubuntu 18.04, in both cases with flexbe_app version 2.2.4

If we edit a python script and save it, flexbe_app automatically detects it and its integrated console prompts and through this error:

ERROR: ENOENT: no such file or directory, open
`path_to_state.py.xxx____xxxx.py`

Even that error, the application can be launched, but changes made in the script are not available. We need to re-launch flexbe_app.

If more info is required, please let me know.

@pschillinger
Copy link
Member

I indeed found an issue that prevented the automated state reloading when using the Python parser: Since Python internally caches any previously imported module and does not reload it again, the state did not update despite being triggered correctly. This was not an issue for the (default) regex parser and should be fixed for the Python parser by the above commit. Does this help?

The file path path_to_state.py.xxx____xxxx.py from the error message looks weird, not sure where this could come from. What would be the correct path?

@asierfernandez
Copy link

Even applying aa61ea9, I continue having the same behavior.

I've figured out what path_to_state.py.xxx____xxxx.pyis.
path_to_python_script.py + md5sum of previous path + .py

I hope it helps!

@ghost
Copy link

ghost commented Jun 3, 2020

OS: Ubuntu 18.04
ROS: Melodic
Flexbe_app: 2.2.1
Flexbe_behavior_enginer: 1.2.1

The problem is still here. If I update the Python code of a state and save it, flexbe app does not execute the updated state but the previous version of it. However, if I launch the flexbe app again, it executes the updated version. It makes it really difficult for debugging..
Any plan to fix it?

@joao-aguizo
Copy link

joao-aguizo commented Nov 22, 2021

I think this issue was caused by this hotfix: team-vigir/flexbe_behavior_engine@bbe82cf, since only after applying it to an older version of flexbe_behavior_engine that I am using (https://github.com/team-vigir/flexbe_behavior_engine/tree/1.2.5), I have started watching the aforementioned issue.

UNRELATED: I had to apply this hotfix so that I can consistently run some behaviors. That being said, had I not applied this fix I would only be able to run some behaviors that rely on services once, being that the second time would fail with the following error:
ImportError: No module named srv

@dcconner
Copy link
Member

Any status updates on this? Are people still experiencing issues?

If I understand correctly, you are editing the python state implementation files, and want those changes reflected when you run a behavior without rebuilding and restarting FlexBE.

I presume this is on a single machine running from devel in ROS 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants