dynamic path names using xacro
Hello
I am using xacro to generate sdf and urd files for ros and gazebo. And I like to have my robot describtion as modular as possible but I have an issue with relative path names. The following example shows a working xacro example:
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="dsa" >
<xacro:include filename="$(find dsa_gazebo)/xacro/tricycle/tricycle_body.xacro"/>
<xacro:tricycle_body name="chassis" parent="base_link" meshes="package://dsa_gazebo/meshes/tricycle"/>
</robot>
but I like to put the ros package name into a variable which does NOT work
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="dsa" >
<property name="CURRENT_PKG" value="dsa_gazebo" /> <!-- variable for the current pkg -->
<xacro:include filename="$(find ${CURRENT_PKG})/xacro/tricycle/tricycle_body.xacro"/> <!-- solving find with a xacro varaible does not work :-( -->
<xacro:tricycle_body name="chassis" parent="base_link" meshes="package://${CURRENT_PKG}/meshes/tricycle"/>
</robot>
Any ideas Greetings Markus