Why are we using ${} for assigning lists in Xacro property?

@staff From URDF XACRO course,

In below case, When we are assigning a list to value below, why are we using ${}

<xacro:property name="neck_indexes" value="${[1,2,3,4,5]}" />

Instead why not just assign directly without ${} as shown below:

<xacro:property name="neck_indexes" value="[1,2,3,4,5]" />

I understand that ${} approach is usually used for logical operations like ${radius<=2}, but in the above case, we are just assigning a list and this does not include any logical or mathematical operations.

Then why are we using ${} for assigning lists?

You can use Python to perform basin Python operations inside the ${} elements.

The above quote is from course material, is it safe to assume that since list is part of python, we are using ${} to represent lists in XACRO?

Other members of the team may know better, but I assume that if you do not use ${}, the value would be interpreted as a string rather than as a list.

1 Like

I also feel this is the answer.
thanks @ralves

1 Like