cmower / optas

OpTaS: An optimization-based task specification library for trajectory optimization and model predictive control.
https://cmower.github.io/optas/
Other
98 stars 14 forks source link

AttributeError: module 'xacro' has no attribute 'process' #78

Closed joaomoura24 closed 1 year ago

joaomoura24 commented 1 year ago

When running the simple_joint_space_planner.py example in the master branch i get the following error related with the xacro functionality:

Traceback (most recent call last): File "example/simple_joint_space_planner.py", line 138, in <module> main() File "example/simple_joint_space_planner.py", line 102, in main kuka = KukaLBR() File "/home/joao/Documents/Projects/test/optas/example/pybullet_api.py", line 168, in __init__ urdf_string = xacro.process(xacro_filename) AttributeError: module 'xacro' has no attribute 'process'

cmower commented 1 year ago

Ahh, I can reproduce this error. This is happening because you have ROS1 sourced and the xacro module is being imported from the ROS1 distribution packages - and I believe this is an older version of xacro. I have the updated version installed so works for me, but when I source ROS1, the old package is imported and I get the same failure.

I will look into how to resolve this issue in general.

joaomoura24 commented 1 year ago

Ok. Ideally this wouldn't depend on having ROS installed at all even. Using some package for xacro that is available through pip.

cmower commented 1 year ago

Ok, this is a little more difficult than I thought. So, xacro can run in a ROS agnostic environment. However, "this implies that you cannot use ROS-specific features in xacro". We can look into modifying the med7 xacro file, but we should make a "Known issues" section in the README/documentation.

cmower commented 1 year ago

I changed the label for this issue from bug to invalid, since it is not a bug with optas.

cmower commented 1 year ago

011f77ea30f3b70ef88a10ce34aaed44b63e6d2c is a small example of the things that need to be removed from the xacro file so it can be loaded in a ROS agnostic environment.

cmower commented 1 year ago

Closing, this will be resolved when #79 is merged.