Conditional block for params on macro xacro

hi everyone, i was wondering how can i use if condition in params on macro?
for example
<xacro:macro name="leg" params="prefix suffix">
I want to use if condition about the suffix
if suffix == left so create "A", but if suffix != left so create "A"
or the concept is like if-else condition on programming language.

because the documentation on ros wiki doesn’t explain that.

thank you


Here is everything explained, it depends on which ROS distro you have, you will be able to do more or less things:

Conditional block in XACRO

the documentation doesn’t give me explain about conditional block for param on macro.
It just show conditional block in in property.

I’ve tried all of this line :
<xacro:if params="${suffix} == 'left'"> execute </xacro:if>
<xacro:if params="${suffix == 'left'}"> execute </xacro:if>
<xacro:if value="${suffix == 'left'}"> execute </xacro:if>
<xacro:if value="${suffix} == 'left'"> execute </xacro:if>

for macro <xacro:macro name="leg" params="prefix suffix"> but it doesn’t work.

Oh it solved, i added <xacro:property name="suffix" value="left"/> when i call the macro. it give the property name suffix to the value “kanan”, so i can execute the conditional block using <xacro:if value="${suffix == 'left'}">