Closed RobertBlakeAnderson closed 1 year ago
Any feedback on this?
Could you add tests? @RobertBlakeAnderson
Sure thing! I'll get to it shortly.
Done. I also fixed a couple tiny issues that I found while creating and running the tests.
Got it working with Substitutions in the constructor. Updated tests and added new ones for the XML. I'll now look into the matter of keying the definitions to their modules, with backwards compatibility. As for naming, maybe python_modules
or python_deps
would be less ambiguous.
Done. The expressions will now require the module names before the definitions you use. For backwards compatibility, math definitions will work with or without the module name, and the tests include cases for both. If you wish, the implicit references could be considered deprecated for removal at a future date.
I think this PR is ready to go now.
Flake 8 issues :o
https://ci.ros2.org/job/ci_linux-aarch64/12418/testReport/launch.test/test_flake8/test_flake8/
I think just change the name locals
Added ability to pass Python modules to the PythonExpression substitution. Allows eval of more expressions.
For example, my motivating use case was:
robot_desc = PythonExpression(["process_file('", filepath, "').toprettyxml(indent=' ')"], xacro.__dict__)