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

Feature request: abs() function in ${.} expressions

mfbehrens99 opened this issue · comments

While implementing some too complicated calculations in xacro I noticed that python's abs is not usable in xacro.
Sorry if it is available, but I could not find it in the python nor in the math namespace, and I could not find it in any documentation.

I can reproduce the missing abs function. However, I don't understand why it is missing. Here is a simple alternative: Use fabs:

<bar function="${fabs(-3)}"/>

Thank you! That would fix it.
I created a pull request to add support for abs. If you want to merge it, do so, otherwise just close it.