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

Support inclusion or aggregation of other XML files #17

Closed
v-lopez opened this issue Nov 23, 2018 · 7 comments
Closed

Support inclusion or aggregation of other XML files #17

v-lopez opened this issue Nov 23, 2018 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@v-lopez
Copy link
Contributor

v-lopez commented Nov 23, 2018

The use case is simple, if I create a BehaviorTree that implements a funcionality in an xml, I'd like to be able to include it from multiple XML's without having to duplicate it.

@facontidavide facontidavide self-assigned this Nov 23, 2018
@facontidavide facontidavide added the enhancement New feature or request label Nov 23, 2018
@facontidavide
Copy link
Collaborator

image

@facontidavide
Copy link
Collaborator

Ok, I implemented the feature in a new branch. Once you give me some feedback I will merge it into master.

https://github.com/BehaviorTree/BehaviorTree.CPP/tree/include_xml

To see it in action, execute bin/t07_include_trees passing as first argument either the absolute or relative path to examples/test_files/subtree_test.xml.

Cheers

@v-lopez
Copy link
Contributor Author

v-lopez commented Dec 3, 2018

Looks great.

ROS users could probably implement on their own application, some sort of preprocessing of the xml to expand paths relative to a package, ie expand <ros_include pkg="other_pkg" path="subtrees/Talk.xml" /> into <include path="/absolute_path_to_other_pkg/subtrees/Talk.xml" />

@facontidavide
Copy link
Collaborator

facontidavide commented Dec 3, 2018

Indeed. As usual, I prefer to focus on platform independent features first and ROS specific ones later.

facontidavide pushed a commit that referenced this issue Dec 3, 2018
This new syntax is now supported when library is compiled with catkin:

<include ros_pkg="my_package" path="my_tree.xml" />
@facontidavide
Copy link
Collaborator

facontidavide commented Dec 3, 2018

Please take a look at db72762

I haven't tested it through yet, but it should work.

@v-lopez
Copy link
Contributor Author

v-lopez commented Dec 3, 2018

I tested it modifying your example with:
<include ros_pkg="pal_statistics" path="foo.xml" />

And it worked like a charm!

@facontidavide
Copy link
Collaborator

Nice!!!

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

No branches or pull requests

2 participants