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

Cannot save behavior (Inconsistent paths!) #6

Open
y-masutani opened this issue Jul 13, 2024 · 4 comments
Open

Cannot save behavior (Inconsistent paths!) #6

y-masutani opened this issue Jul 13, 2024 · 4 comments

Comments

@y-masutani
Copy link

I just started using WebUI.

I created a project by running the following

ros2 run flexbe_widget create_repo foobar

After colcon build; source install/setup.bash, I launched WebUI by running the following

ros2 launch flexbe_webui flexbe_full.launch.py

Next I loaded the Example Behavior and confirmed it to work.

However, when I change the arrangement in the Statemachine Editor and click "Save Behavior" in Runtiem Control, I get an error as shown in the image.
Screenshot from 2024-06-28 12-18-18

It is said that the behavior Python file path and the manifest XML file path are inconsistent, so I checked them and found the paths are as follows.

  • /home/masutani/test_ws/install/foobar_flexbe_behaviors/local/lib/python3.10/dist-packages/foobar_flexbe_behaviors/example_behavior _sm.py
  • /home/masutani/test_ws/install/foobar_flexbe_behaviors/lib/foobar_flexbe_behaviors/manifest/example_behavior.xml

There must be a problem with the path checking.

@dcconner
Copy link
Member

dcconner commented Jul 15, 2024

I presume you are using Humble as it uses the "local/lib" path. Iron and Jazzy don't have that, and I've been testing in Iron lately so missed that when I added the validate_path_consistency method to tools.py in the flexbe_webui folder.

Just have that function return True, or add 'local' to the possible checks.

I think that we may want to change https://github.com/FlexBE/flexbe_webui/blob/beta/flexbe_webui/tools.py#L43
to be

if ndx > 2 and (python_path_elements[ndx - 1] == 'lib' or manifest_path_elements[ndx - 1] == 'share' or python_path_elements[ndx] == 'local'):

to work with Humble.

I would appreciate if you'd be willing to make the change and test.

On a related note, the copy_behavior scripts are out of date for Iron and Jazzy as it still includes the local path.

I need to create a special Humble branch for projects and update create_repo to pull from there.

We are still actively developing this flexbe_webui for the next few weeks, so I don't want to create separate branches for Humble, Iron, and Jazzy until we are ready for the "official" release, so I will ask users to make the above fix to validate_path_consistency if they are using Humble.

@MrKeith99
Copy link

MrKeith99 commented Jul 19, 2024

I am also testing FlexBE WebUI in ROS2 Humble, and facing the same trouble with PATH inconsistency.

I have already tried this solution in the tools.py (l43).

However, it seems that updates in webui_server.py and behavior_library.py in FlexBe Behavior Engine are also required.

- folder_path = os.path.join(package.path, 'lib', behavior.behavior_package, 'manifest')
+ folder_path = os.path.join(package.path, 'local/lib/python3.10/dist-packages', behavior.behavior_package, 'manifest')
  • For behavior_library.py (L70):
- self._add_behavior_manifests(os.path.join(pkg_path, 'lib', pkg_name, 'manifest'), pkg_name)
+ self._add_behavior_manifests(os.path.join(pkg_path, 'local/lib/python3.10/dist-packages', pkg_name, 'manifest'), pkg_name)

@dcconner , what do you think about this? Is there any other proper solution?

@y-masutani
Copy link
Author

Thanks for your reply.

Yes, I am using Humble. I rewrote tools.py as you wrote, and now the error no longer occurs.

Since I will still continue to use Humble for some years, I would be very happy if you support Humble as well.

@dcconner
Copy link
Member

@MrKeith99 We have stored the manifests in a different folder from the python scripts.
So I believe the use in manifest folders is consistent without change. It will create a different folder, but does so consistently.

While one fix to the path consistency issue might be to move the manifest packages, I suggest not doing that.

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

3 participants