ros / xacro

Xacro is an XML macro language. With xacro, you can construct shorter and more readable XML files by using macros that expand to larger XML expressions.

Home Page:http://www.ros.org/wiki/xacro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SyntaxWarning: invalid escape sequence '\$'

bjsowa opened this issue · comments

Whenever I run xacro on ROS Rolling and Ubuntu Noble, I get this stderr output:

/opt/ros/rolling/lib/python3.12/site-packages/xacro/__init__.py:558: SyntaxWarning: invalid escape sequence '\$'
  default_value = '''\$\{.*?\}|\$\(.*?\)|(?:'.*?'|\".*?\"|[^\s'\"]+)+|'''
/opt/ros/rolling/lib/python3.12/site-packages/xacro/__init__.py:559: SyntaxWarning: invalid escape sequence '\s'
  re_macro_arg = re.compile(r'^\s*([^\s:=]+?)\s*:?=\s*(\^\|?)?(' + default_value + ')(?:\s+|$)(.*)')

If I build this package locally (version 2.0.10) I only get these warnings upon building.

I'm invoking xacro in command substitution in launch file like this:

<param name="robot_description" value="$(command 'xacro $(var model)')" />

The ros2 launch command complains about the stderr output and stops execution. This breaks the whole startup procedure of my robot.

I believe the fix to this was implemented in #336 but it was only commited to noetic-devel branch. Could you please backport the fix to ros2 branch and release a new version of the package to rosdistro?